diff --git a/vimrc b/vimrc index d47e7ae8ded0da2b70e6b88f00d1ccbd76c0af13..26d9d47aa9be5bd3d7b1a4f241a93615d53800b7 100644 --- a/vimrc +++ b/vimrc @@ -17,6 +17,11 @@ nnoremap :buffers:buffer nnoremap :Explore nnoremap :copen +" Personal tabs/spaces settings. +autocmd Filetype make,go,sh setlocal noexpandtab tabstop=4 shiftwidth=4 +autocmd Filetype c,cpp,lua setlocal expandtab tabstop=4 shiftwidth=4 +autocmd Filetype nix,html,javascript,css setlocal expandtab tabstop=2 shiftwidth=2 + " Commenting blocks of code. " https://stackoverflow.com/a/1676672 augroup commenting_blocks_of_code @@ -29,11 +34,6 @@ autocmd FileType vim let b:comment_leader = '" ' augroup END noremap cc :silent s/^/=escape(b:comment_leader,'\/')/:nohlsearch noremap cu :silent s/^\(\s*\)\V=escape(b:comment_leader,'\/')//e:nohlsearch - -" Personal tabs/spaces settings. -autocmd Filetype make,go,sh setlocal noexpandtab tabstop=4 shiftwidth=4 -autocmd Filetype c,cpp,lua setlocal expandtab tabstop=4 shiftwidth=4 -autocmd Filetype nix,html,javascript,css setlocal expandtab tabstop=2 shiftwidth=2 " Function to auto format source code files. function! Format()