6 Jun 2013

My Vim configuration

Recently, I got used to Vim, and it's really cooooooooool and it looks way so professional :D
I think I will keep it as my favorite text editors ;)

Anyway, I would like to save and share my Vim configuration here and it will be updated as  soon as I found something new ;)

Copy following configuration into your ~/.vimrc or ~/.exrc (well, I'm really not sure which one will be loaded by Vim :D)

syntax on                               "turn syntax on
set number                              "show line number
set autoindent                          "turn auto indent on
set tabstop=4                           "set tab = 4 spaces
set shiftwidth=4                        "set tab when use > or < = 4 spaces
set colorcolumn=81                      "show margin line
set cursorline                          "hightlight current line

autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete
autocmd FileType perl set omnifunc=perlcomplete#Complete
"change ^x^o to ^space
inoremap   pumvisible() \|\| &omnifunc == '' ?
\ "\C-n>" :
\ "\C-x>\C-o>=pumvisible() ?" .
\ "\"\\c-n>\\c-p>\\c-n>\" :" .
\ "\" \\bs>\\C-n>\"\"

No comments:

Post a Comment