From 3b64f6c61d3e2a04cf3f5f6f24b84635947344d5 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 7 Nov 2017 10:07:56 +1300 Subject: Add commands to copy_linebreak.vim Just to be thorough; if +user_commands are available, offer :CopyLinebreakEnable, :CopyLinebreakDisable, and :CopyLinebreakToggle commands. --- vim/doc/copy_linebreak.txt | 6 ++++++ vim/plugin/copy_linebreak.vim | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/vim/doc/copy_linebreak.txt b/vim/doc/copy_linebreak.txt index 285d92ea..15e4b1b0 100644 --- a/vim/doc/copy_linebreak.txt +++ b/vim/doc/copy_linebreak.txt @@ -14,6 +14,12 @@ Mappings: CopyLinebreakDisable CopyLinebreakToggle +Commands: + + :CopyLinebreakEnable + :CopyLinebreakDisable + :CopyLinebreakToggle + This plugin lives in Tom Ryder's "dotfiles" suite, and will eventually be spun off into a separate distribution as it solidifies and this documentation improves. 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 " License: Same as Vim itself @@ -50,4 +51,16 @@ noremap noremap \ CopyLinebreakToggle \ :call CopyLinebreakToggle() + +" Provide user commands if we can +if has('user_commands') + command -nargs=0 + \ CopyLinebreakEnable + \ call CopyLinebreakEnable + command -nargs=0 + \ CopyLinebreakDisable + \ call CopyLinebreakDisable + command -nargs=0 + \ CopyLinebreakToggle + \ call CopyLinebreakToggle endif -- cgit v1.2.3