From: Samir Benmendil Date: Thu, 4 Jun 2015 18:35:01 +0000 (+0100) Subject: vim: coe for expand tab and co[1-8] for shiftwidth X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/c42c76ce2b85f537cd741a4a87da9e460f03d551?ds=sidebyside vim: coe for expand tab and co[1-8] for shiftwidth --- diff --git a/vim/vimrc b/vim/vimrc index bffc315..11a8823 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -381,10 +381,13 @@ map Q gq " break undo sequence before removing word inoremap u -nmap b :set expandtab tabstop=4 shiftwidth=4 softtabstop=4 -nmap B :set expandtab tabstop=8 shiftwidth=8 softtabstop=4 -nmap M :set noexpandtab tabstop=8 softtabstop=4 shiftwidth=4 -nmap m :set expandtab tabstop=2 shiftwidth=2 softtabstop=2 +nnoremap coe :set =&expandtab ? 'noexpandtab' : 'expandtab' +nnoremap [oe :set expandtab +nnoremap ]oe :set noexpandtab + +for idt in range(1,8) + exe 'nnoremap co'.idt.' :set tabstop='.idt.' shiftwidth='.idt.' softtabstop='.idt.'' +endfor " space will toggle current fold in normal mode nnoremap za