aboutsummaryrefslogtreecommitdiff
path: root/vim/plugin
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-07 10:07:56 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-07 10:10:03 +1300
commit3b64f6c61d3e2a04cf3f5f6f24b84635947344d5 (patch)
tree774cd31e90cd493a7c8256412463ad9f185d3b42 /vim/plugin
parentGive copy_linebreak.vim enable/disable funcs, maps (diff)
downloaddotfiles-3b64f6c61d3e2a04cf3f5f6f24b84635947344d5.tar.gz
dotfiles-3b64f6c61d3e2a04cf3f5f6f24b84635947344d5.zip
Add commands to copy_linebreak.vim
Just to be thorough; if +user_commands are available, offer :CopyLinebreakEnable, :CopyLinebreakDisable, and :CopyLinebreakToggle commands.
Diffstat (limited to 'vim/plugin')
-rw-r--r--vim/plugin/copy_linebreak.vim15
1 files changed, 14 insertions, 1 deletions
diff --git a/vim/plugin/copy_linebreak.vim b/vim/plugin/copy_linebreak.vim
index cc0cc741..2b5f7243 100644
--- a/vim/plugin/copy_linebreak.vim
+++ b/vim/plugin/copy_linebreak.vim
@@ -1,6 +1,7 @@
"
" copy_linebreak.vim: Bind user-defined key sequences to toggle a group of
-" options that make text wrapped with 'wrap' copy-paste friendly.
+" options that make text wrapped with 'wrap' copy-paste friendly. Also creates
+" user commands if it can.
"
" Author: Tom Ryder <tom@sanctum.geek.nz>
" License: Same as Vim itself
@@ -50,4 +51,16 @@ noremap <silent> <unique>
noremap <silent> <unique>
\ <Plug>CopyLinebreakToggle
\ :<C-U>call <SID>CopyLinebreakToggle()<CR>
+
+" Provide user commands if we can
+if has('user_commands')
+ command -nargs=0
+ \ CopyLinebreakEnable
+ \ call <SID>CopyLinebreakEnable
+ command -nargs=0
+ \ CopyLinebreakDisable
+ \ call <SID>CopyLinebreakDisable
+ command -nargs=0
+ \ CopyLinebreakToggle
+ \ call <SID>CopyLinebreakToggle
endif