Advertisement
metalx1000

My Vimrc

Dec 30th, 2014
507
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 1.70 KB | None | 0 0
  1. "this is my VIMRC file
  2. syntax on
  3. set shiftwidth=2 softtabstop=2 expandtab
  4.  
  5. "I don't like auto indent
  6. set noautoindent
  7.  
  8. command! Wq :wq
  9. command! W :w
  10.  
  11. set path+=**
  12. set wildmenu
  13.  
  14. nnoremap <C-n> :bnext<CR>
  15. nnoremap <C-p> :bprevious<CR>
  16.  
  17. " Uncomment the following to have Vim jump to the last position when
  18. " reopening a file
  19. if has("autocmd")
  20.   au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
  21. endif
  22.  
  23. "insert templates
  24. nnoremap ,html :-1read $HOME/.vim/skeleton/bootlist.html<CR>3j9li
  25. nnoremap ,getlist :-1read $HOME/.vim/skeleton/getlist.js<CR>i
  26.  
  27. nnoremap ,fun :call Jfun()<CR>$kkbi
  28. function Jfun()
  29.   execute "normal i function (){\<enter>\<enter>}\<esc>v="
  30. endfunction
  31.  
  32. nnoremap ,post :call Jpost()<CR>i
  33. function Jpost()
  34.   execute "normal i function (){\<enter>\<esc>"
  35.   execute "normal i var url = 'submit.php';\<enter>\<esc>"
  36.   execute "normal i $.post( url, {data:'test'}, function( data ) {\<enter>\<esc>"
  37.   execute "normal i console.log( data );\<enter>\<esc>"
  38.   execute "normal i });\<enter>\<esc>"
  39.   execute "normal i }\<esc>vkkkk=v>jv>jjv<"
  40.   execute "normal kkkkf("
  41. endfunction
  42.  
  43. "CSS autocomplete Ctrl + x followed by  Ctrl + o
  44. autocmd FileType css set omnifunc=csscomplete#CompleteCSS
  45.  
  46. "JavaScript Autocomplete Ctrl + x followed by  Ctrl + o
  47. autocmd FileType js set omnifunc=javascriptcomplete#CompleteJS
  48.  
  49. "html Autocomplete Ctrl + x followed by  Ctrl + o
  50. autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
  51. "auto close tags on space
  52. inoremap </ </<C-X><C-O>
  53.  
  54. "line numbering
  55. set relativenumber
  56. set number
  57.  
  58. "remove all trailing whitespace by pressing F5
  59. nnoremap <F5> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar><CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement