]> git.rmz.io Git - dotfiles.git/commitdiff
vim: coe for expand tab and co[1-8] for shiftwidth
authorSamir Benmendil <samir.benmendil@gmail.com>
Thu, 4 Jun 2015 18:35:01 +0000 (19:35 +0100)
committerSamir Benmendil <samir.benmendil@gmail.com>
Thu, 4 Jun 2015 18:35:01 +0000 (19:35 +0100)
vim/vimrc

index bffc315c8ac71ba588b9694ee66a980a2c2d5b45..11a8823ea54b32829e10a160e3ff6be4ccdac936 100644 (file)
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -381,10 +381,13 @@ map Q gq
 " break undo sequence before removing word
 inoremap <C-W> <C-G>u<C-W>
 
-nmap <Leader>b :set expandtab tabstop=4 shiftwidth=4 softtabstop=4<CR>
-nmap <Leader>B :set expandtab tabstop=8 shiftwidth=8 softtabstop=4<CR>
-nmap <Leader>M :set noexpandtab tabstop=8 softtabstop=4 shiftwidth=4<CR>
-nmap <Leader>m :set expandtab tabstop=2 shiftwidth=2 softtabstop=2<CR>
+nnoremap coe :set <C-R>=&expandtab ? 'noexpandtab' : 'expandtab'<CR><CR>
+nnoremap [oe :set expandtab<CR>
+nnoremap ]oe :set noexpandtab<CR>
+
+for idt in range(1,8)
+  exe 'nnoremap co'.idt.' :set tabstop='.idt.' shiftwidth='.idt.' softtabstop='.idt.'<CR>'
+endfor
 
 " space will toggle current fold in normal mode
 nnoremap <leader><Space> za