Vim cut paste

From INIwiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "Please create the following file: '''/etc/vim/vimrc.local''' " This file loads the default vim options at the beginning and prevents " that they are being loaded again late...")
 
 
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
 
Please create the following file: '''/etc/vim/vimrc.local'''
 
Please create the following file: '''/etc/vim/vimrc.local'''
 +
 +
Vi /etc/vim/vimrc.local
  
 
  " This file loads the default vim options at the beginning and prevents
 
  " This file loads the default vim options at the beginning and prevents
Line 8: Line 10:
 
  " Load the defaults
 
  " Load the defaults
 
  source /usr/share/vim/vim80/defaults.vim
 
  source /usr/share/vim/vim80/defaults.vim
 +
" May need to update to
 +
" source /usr/share/vim/vim80/defaults.vim
 
   
 
   
 
  " Prevent the defaults from being loaded again later, if the user doesn't
 
  " Prevent the defaults from being loaded again later, if the user doesn't
 
  " have a local vimrc (~/.vimrc)
 
  " have a local vimrc (~/.vimrc)
 
  let skip_defaults_vim = 1
 
  let skip_defaults_vim = 1
 
 
   
 
   
 
  " Set more options (overwrites settings from /usr/share/vim/vim80/defaults.vim)
 
  " Set more options (overwrites settings from /usr/share/vim/vim80/defaults.vim)
Line 21: Line 24:
 
   set mouse=r
 
   set mouse=r
 
  endif
 
  endif
 +
 +
 +
To paste in the default VI
 +
Hols Ctrl then Right-Click and select paste
 +
  
 
If you also want to enable the "old copy/paste behaviour", add the following lines at the end of that file as well:
 
If you also want to enable the "old copy/paste behaviour", add the following lines at the end of that file as well:

Latest revision as of 02:25, 8 October 2019

Please create the following file: /etc/vim/vimrc.local

Vi /etc/vim/vimrc.local
" This file loads the default vim options at the beginning and prevents
" that they are being loaded again later. All other options that will be set,
" are added, or overwrite the default settings. Add as many options as you
" whish at the end of this file.

" Load the defaults
source /usr/share/vim/vim80/defaults.vim
" May need to update to
" source /usr/share/vim/vim80/defaults.vim

" Prevent the defaults from being loaded again later, if the user doesn't
" have a local vimrc (~/.vimrc)
let skip_defaults_vim = 1

" Set more options (overwrites settings from /usr/share/vim/vim80/defaults.vim)
" Add as many options as you whish

" Set the mouse mode to 'r'
if has('mouse')
  set mouse=r
endif


To paste in the default VI

Hols Ctrl then Right-Click and select paste

If you also want to enable the "old copy/paste behaviour", add the following lines at the end of that file as well:

" Toggle paste/nopaste automatically when copy/paste with right click in insert mode:
let &t_SI .= "\<Esc>[?2004h"
let &t_EI .= "\<Esc>[?2004l"

inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()

function! XTermPasteBegin()
  set pastetoggle=<Esc>[201~
  set paste
  return ""
endfunction
Personal tools