diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-04 18:21:16 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-04 18:21:16 +1300 |
commit | 2c20a3c3427befd77029fc37cbda0476f650b681 (patch) | |
tree | 7fa7e1050de2a660e71da37d347786371a53b689 /vim/config/format.vim | |
parent | Add short documentation for new custom plugins (diff) | |
download | dotfiles-2c20a3c3427befd77029fc37cbda0476f650b681.tar.gz dotfiles-2c20a3c3427befd77029fc37cbda0476f650b681.zip |
Rename toggle plugin again, use commands not funcs
This method makes a bit more sense, and amounts to slightly less verbose
mapping commands. It does really on the +user_commands feature being
available, however.
Diffstat (limited to 'vim/config/format.vim')
-rw-r--r-- | vim/config/format.vim | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/vim/config/format.vim b/vim/config/format.vim index 9c68d843..572e9877 100644 --- a/vim/config/format.vim +++ b/vim/config/format.vim @@ -5,7 +5,7 @@ if v:version > 703 || v:version ==# 703 && has('patch541') endif " -" Use flag_toggle.vim plugin to bind quick toggle actions for some +" Use toggle_option_flag.vim plugin to bind quick toggle actions for some " 'formatoptions' flags: " " a - Automatically format paragraphs, reapplying the wrap on every text @@ -16,11 +16,11 @@ endif " to set for me) " t - Automatically wrap text at 'textwidth' (as above) " -if has('eval') && v:version >= 701 - silent! nnoremap <silent> <leader>a - \ :<C-U>call flag_toggle#ToggleLocal('formatoptions', 'a')<CR> - silent! nnoremap <silent> <leader>c - \ :<C-U>call flag_toggle#ToggleLocal('formatoptions', 'c')<CR> - silent! nnoremap <silent> <leader>t - \ :<C-U>call flag_toggle#ToggleLocal('formatoptions', 't')<CR> +if has('eval') && has('user_commands') + nnoremap <silent> <leader>a + \ :<C-U>ToggleOptionFlagLocal formatoptions a<CR> + nnoremap <silent> <leader>c + \ :<C-U>ToggleOptionFlagLocal formatoptions c<CR> + nnoremap <silent> <leader>t + \ :<C-U>ToggleOptionFlagLocal formatoptions t<CR> endif |