Created
June 8, 2014 15:46
-
-
Save dekarrin/b788af8816c2fe61e977 to your computer and use it in GitHub Desktop.
Vim RC
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
" Ensure that sourcing twice doesn't set autocmds twice | |
autocmd! | |
" Remember things on exit | |
" 'x : save marks in up to x last files | |
" "x : save up to x lines for each register | |
" :x : save up to x lines of command history | |
" % : save and restore buffer list | |
" nX : save viminfo in path X | |
set viminfo='10,\"100,:20,%,n~/.viminfo | |
" function to restore cursor position | |
function! RestoreCursor() | |
if line("'\"") <= line("$") | |
normal! g`" | |
return 1 | |
endif | |
endfunction | |
" auto restore cursor | |
augroup resCur | |
autocmd! | |
autocmd BufWinEnter * call RestoreCursor () | |
augroup END | |
" Enable omnicompletion | |
filetype plugin on | |
set omnifunc=syntaxcomplete#Complete | |
" Enable syntax | |
syntax on | |
" Enable highlighting lines over 80 characters | |
augroup longlines | |
autocmd BufEnter * highlight OverLength ctermbg=blue ctermfg=white guibg=#592929 | |
autocmd BufEnter * match OverLength /\%81v.\+/ | |
augroup END | |
" Always show line numbers | |
set number | |
highlight LineNr term=bold cterm=NONE ctermfg=DarkGray ctermbg=NONE gui=NONE guifg=NONE guibg=DarkGray |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment