diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-06-20 02:46:05 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2024-06-20 02:46:05 +0200 |
| commit | f15fa3fd8f409df7c755f925108c40d6924ed631 (patch) | |
| tree | be0c3909a5862c5b26e00ed2c9c7f0adb15d86ce /vimrc | |
| parent | 382295fe653fa9937c4cd66350f718ee072bb93d (diff) | |
| download | dotfiles-f15fa3fd8f409df7c755f925108c40d6924ed631.tar.gz | |
Update vimrc
Diffstat (limited to 'vimrc')
| -rw-r--r-- | vimrc | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -17,6 +17,11 @@ nnoremap <C-b> :buffers<cr>:buffer | |||
| 17 | nnoremap <C-p> :Explore<cr> | 17 | nnoremap <C-p> :Explore<cr> |
| 18 | nnoremap <C-q> :copen<cr> | 18 | nnoremap <C-q> :copen<cr> |
| 19 | 19 | ||
| 20 | " Personal tabs/spaces settings. | ||
| 21 | autocmd Filetype make,go,sh setlocal noexpandtab tabstop=4 shiftwidth=4 | ||
| 22 | autocmd Filetype c,cpp,lua setlocal expandtab tabstop=4 shiftwidth=4 | ||
| 23 | autocmd 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 |
| 22 | augroup commenting_blocks_of_code | 27 | augroup commenting_blocks_of_code |
| @@ -30,11 +35,6 @@ augroup END | |||
| 30 | noremap <silent> cc :<C-B>silent <C-E>s/^/<C-R>=escape(b:comment_leader,'\/')<CR>/<CR>:nohlsearch<CR> | 35 | noremap <silent> cc :<C-B>silent <C-E>s/^/<C-R>=escape(b:comment_leader,'\/')<CR>/<CR>:nohlsearch<CR> |
| 31 | noremap <silent> cu :<C-B>silent <C-E>s/^\(\s*\)\V<C-R>=escape(b:comment_leader,'\/')<CR>//e<CR>:nohlsearch<CR> | 36 | noremap <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. | ||
| 34 | autocmd Filetype make,go,sh setlocal noexpandtab tabstop=4 shiftwidth=4 | ||
| 35 | autocmd Filetype c,cpp,lua setlocal expandtab tabstop=4 shiftwidth=4 | ||
| 36 | autocmd 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. |
| 39 | function! Format() | 39 | function! 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 |
