Last active
December 10, 2019 09:45
-
-
Save yurenchen000/4e99a6ad2131fb2bff539f53faccea51 to your computer and use it in GitHub Desktop.
vimrc snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" show line number | |
set nu | |
" hi cursor line | |
set cursorline | |
"hi CursorLine cterm=NONE ctermbg=darkred ctermfg=white | |
"hi CursorLine cterm=NONE ctermbg=darkred | |
" highlight search | |
se hls | |
" increse search | |
se is | |
" tab width | |
set ts=4 | |
set sw=4 | |
set nowrap | |
set modeline | |
" format & encoding | |
set ff=unix | |
set enc=utf-8 | |
set fenc=utf-8 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" https://unix.stackexchange.com/questions/196098 | |
" turn off paste escape | |
" printf "\e[?2004l" | |
" :h xterm-bracketed-paste | |
se t_BE= | |
se t_BD= | |
" Set to auto read when a file is changed from the outside | |
set autoread | |
" no auto comment | |
set formatoptions-=cro | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" tab switch | |
nn <F2> :tabp<CR> | |
nn <F3> :tabn<CR> | |
" diff next | |
nn <F12> ]c | |
nn <F10> [c | |
nn <S-F12> [c | |
" :W sudo saves the file | |
" (useful for handling the permission-denied error) | |
command W w !sudo tee % > /dev/null | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment