Skip to content

Instantly share code, notes, and snippets.

@yurenchen000
Last active December 10, 2019 09:45
Show Gist options
  • Save yurenchen000/4e99a6ad2131fb2bff539f53faccea51 to your computer and use it in GitHub Desktop.
Save yurenchen000/4e99a6ad2131fb2bff539f53faccea51 to your computer and use it in GitHub Desktop.
vimrc snippets
" 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
" 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
" 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