aboutsummaryrefslogtreecommitdiff
path: root/vim/config/format.vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-04 17:35:09 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-04 17:35:09 +1300
commitad7cb8319053250e4f2a2eb559bd942e741ba9b5 (patch)
tree2209ce2a1cc3ae384fbca8b2a93cc106947b59f0 /vim/config/format.vim
parentDon't suggest mappings in Vim plugin comments (diff)
downloaddotfiles-ad7cb8319053250e4f2a2eb559bd942e741ba9b5.tar.gz
dotfiles-ad7cb8319053250e4f2a2eb559bd942e741ba9b5.zip
Rename and refactor option toggle plugin
Renamed to flag_toggle.vim and placed in autoload using the namespaced autoload function syntax. I'm not sure this is the right approach yet, but I seem to pretty rarely use a Vim earlier than 7.1 these days.
Diffstat (limited to 'vim/config/format.vim')
-rw-r--r--vim/config/format.vim16
1 files changed, 8 insertions, 8 deletions
diff --git a/vim/config/format.vim b/vim/config/format.vim
index ceff2be1..9c68d843 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 option_flags.vim plugin to bind quick toggle actions for some
+" Use flag_toggle.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')
- nnoremap <silent> <leader>a
- \ :<C-U>call option_flags#toggle_local('formatoptions', 'a')<CR>
- nnoremap <silent> <leader>c
- \ :<C-U>call option_flags#toggle_local('formatoptions', 'c')<CR>
- nnoremap <silent> <leader>t
- \ :<C-U>call option_flags#toggle_local('formatoptions', 't')<CR>
+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>
endif