Difference between revisions of "VIM"
Line 8: | Line 8: | ||
" wish at the end of this file. | " wish at the end of this file. | ||
" Load the defaults | " Load the defaults | ||
+ | |||
" source /usr/share/vim/vim80/defaults.vim | " 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 | ||
+ | |||
" Disable syntax highlighting | " Disable syntax highlighting | ||
syntax off | syntax off | ||
+ | |||
" Set more options (overwrites settings from /usr/share/vim/vim80/defaults.vim) | " Set more options (overwrites settings from /usr/share/vim/vim80/defaults.vim) | ||
" Add as many options as you wish | " Add as many options as you wish | ||
Line 20: | Line 24: | ||
set mouse=r | set mouse=r | ||
endif | endif | ||
+ | |||
" Toggle paste/nopaste automatically when copy/paste with right click in insert mode: | " Toggle paste/nopaste automatically when copy/paste with right click in insert mode: | ||
let &t_SI .= "\<Esc>[?2004h" | let &t_SI .= "\<Esc>[?2004h" |
Latest revision as of 06:33, 2 July 2025
Create the /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 " wish at the end of this file. " Load the defaults " 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 " Disable syntax highlighting syntax off " Set more options (overwrites settings from /usr/share/vim/vim80/defaults.vim) " Add as many options as you wish " Set the mouse mode to 'r' if has('mouse') set mouse=r endif " 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
Commands:
Add string to the beginning of each line:
:%s/^/string/
Add string to the end of each line:
:%s/$/\string/g