etrunko

vimrc Indent

Aug 9th, 2012
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 1.00 KB | None | 0 0
  1. function! DefaultIndent()
  2.     " Use spaces instead of tabs
  3.     set expandtab
  4.  
  5.     " Be smart when using tabs ;)
  6.     set smarttab
  7.  
  8.     " 1 tab == 4 spaces
  9.     set shiftwidth=4
  10.     set tabstop=4
  11.  
  12.     set ai "Auto indent
  13.     set si "Smart indent
  14.     set cindent
  15.     set cinoptions=(0,:0,l1,t0
  16. endfunction
  17.  
  18. function! LibvirtCIMIndent()
  19.     :call DefaultIndent()
  20.     set shiftwidth=8
  21.     set tabstop=8
  22.     set softtabstop=8
  23. endfunction
  24.  
  25. function! EDCIndent()
  26.     set tabstop=3
  27.     set shiftwidth=3
  28.     set softtabstop=3
  29.     set nocindent
  30.     "set syntax=edc
  31. endfunction
  32.  
  33. function! EIndent()
  34.     :call DefaultIndent()
  35.     set tabstop=8
  36.     set shiftwidth=4
  37.     set softtabstop=8
  38.     set cinoptions=>5n-2f0^-2{2(0W1st0
  39. endfunction
  40.  
  41.  
  42. call DefaultIndent()
  43. map <F6> :call DefaultIndent() <BAR> echo "Default Mode"<CR>
  44. map <F7> :call LibvirtCIMIndent() <BAR> echo "Libvirt CIM Mode"<CR>
  45. map <F8> :call EDCIndent() <BAR> echo "EDC Mode"<CR>
  46. map <F9> :call EIndent() <BAR> echo "E Mode"<CR>
Advertisement
Add Comment
Please, Sign In to add comment