diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 22:45:55 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-10-30 22:45:55 +1300 |
commit | 9d0d2dd091c570f32368a4cc29213aa29f0d6b50 (patch) | |
tree | 9d141191362cf042ca930ab8aa4646a1aea79539 /vim/config/format.vim | |
parent | Use full `execute` command, not `exec` (diff) | |
download | dotfiles-9d0d2dd091c570f32368a4cc29213aa29f0d6b50.tar.gz dotfiles-9d0d2dd091c570f32368a4cc29213aa29f0d6b50.zip |
Move execution out of 'formatoptions' conditional
Just to do one thing at a time.
Diffstat (limited to 'vim/config/format.vim')
-rw-r--r-- | vim/config/format.vim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vim/config/format.vim b/vim/config/format.vim index 75d8802a..fe13d25b 100644 --- a/vim/config/format.vim +++ b/vim/config/format.vim @@ -22,10 +22,11 @@ endif if has('eval') function! s:ToggleFormatFlag(flag) if &l:formatoptions =~# a:flag - silent! execute 'setlocal formatoptions-=' . a:flag + let l:command = 'setlocal formatoptions-=' . a:flag else - silent! execute 'setlocal formatoptions+=' . a:flag + let l:command = 'setlocal formatoptions+=' . a:flag endif + silent! execute l:command setlocal formatoptions? endfunction nnoremap <silent> <leader>a :<C-U>call <SID>ToggleFormatFlag('a')<CR> |