From: Samir Benmendil Date: Thu, 27 Aug 2015 00:45:56 +0000 (+0100) Subject: vim: toggle formatoptions=a X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/f6a37702c06a10ba38716758438e67e4a371cda2?ds=sidebyside vim: toggle formatoptions=a --- diff --git a/vim/vimrc b/vim/vimrc index 717cfe0..2cbf3b6 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -461,6 +461,11 @@ for idt in range(1,8) exe 'nnoremap co'.idt.' :set tabstop='.idt.' shiftwidth='.idt.' softtabstop='.idt.'' endfor +" toggle auto format of text +nnoremap coa :set =&formatoptions =~ "a" ? 'formatoptions-=a' : 'formatoptions+=a' +nnoremap [oa :set formatoptions+=a +nnoremap ]oa :set formatoptions-=a + " space will toggle current fold in normal mode nnoremap za " create folds around visual selection