aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2024-06-20 02:46:05 +0200
committerMitja Felicijan <mitja.felicijan@gmail.com>2024-06-20 02:46:05 +0200
commitf15fa3fd8f409df7c755f925108c40d6924ed631 (patch)
treebe0c3909a5862c5b26e00ed2c9c7f0adb15d86ce
parent382295fe653fa9937c4cd66350f718ee072bb93d (diff)
downloaddotfiles-f15fa3fd8f409df7c755f925108c40d6924ed631.tar.gz
Update vimrc
-rw-r--r--vimrc10
1 files changed, 5 insertions, 5 deletions
diff --git a/vimrc b/vimrc
index d47e7ae..26d9d47 100644
--- a/vimrc
+++ b/vimrc
@@ -17,6 +17,11 @@ nnoremap <C-b> :buffers<cr>:buffer
17nnoremap <C-p> :Explore<cr> 17nnoremap <C-p> :Explore<cr>
18nnoremap <C-q> :copen<cr> 18nnoremap <C-q> :copen<cr>
19 19
20" Personal tabs/spaces settings.
21autocmd Filetype make,go,sh setlocal noexpandtab tabstop=4 shiftwidth=4
22autocmd Filetype c,cpp,lua setlocal expandtab tabstop=4 shiftwidth=4
23autocmd Filetype nix,html,javascript,css setlocal expandtab tabstop=2 shiftwidth=2
24
20" Commenting blocks of code. 25" Commenting blocks of code.
21" https://stackoverflow.com/a/1676672 26" https://stackoverflow.com/a/1676672
22augroup commenting_blocks_of_code 27augroup commenting_blocks_of_code
@@ -30,11 +35,6 @@ augroup END
30noremap <silent> cc :<C-B>silent <C-E>s/^/<C-R>=escape(b:comment_leader,'\/')<CR>/<CR>:nohlsearch<CR> 35noremap <silent> cc :<C-B>silent <C-E>s/^/<C-R>=escape(b:comment_leader,'\/')<CR>/<CR>:nohlsearch<CR>
31noremap <silent> cu :<C-B>silent <C-E>s/^\(\s*\)\V<C-R>=escape(b:comment_leader,'\/')<CR>//e<CR>:nohlsearch<CR> 36noremap <silent> cu :<C-B>silent <C-E>s/^\(\s*\)\V<C-R>=escape(b:comment_leader,'\/')<CR>//e<CR>:nohlsearch<CR>
32 37
33" Personal tabs/spaces settings.
34autocmd Filetype make,go,sh setlocal noexpandtab tabstop=4 shiftwidth=4
35autocmd Filetype c,cpp,lua setlocal expandtab tabstop=4 shiftwidth=4
36autocmd Filetype nix,html,javascript,css setlocal expandtab tabstop=2 shiftwidth=2
37
38" Function to auto format source code files. 38" Function to auto format source code files.
39function! Format() 39function! Format()
40 if &filetype == 'c' | write | call system('clang-format -i '.expand('%')) | edit! | endif 40 if &filetype == 'c' | write | call system('clang-format -i '.expand('%')) | edit! | endif