aboutsummaryrefslogtreecommitdiff
path: root/vim/config/format.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-30 22:45:55 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-30 22:45:55 +1300
commit9d0d2dd091c570f32368a4cc29213aa29f0d6b50 (patch)
tree9d141191362cf042ca930ab8aa4646a1aea79539 /vim/config/format.vim
parentUse full `execute` command, not `exec` (diff)
downloaddotfiles-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.vim5
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>