From d2669e7190e3db3123589bfcd3ba15a2e4c5243b Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 7 Nov 2017 09:34:21 +1300 Subject: Add :FixedJoin command This is optiona; if the user's Vim doesn't have the 'user_commands' feature, the command will just quietly not be created. --- vim/plugin/fixed_join.vim | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'vim/plugin') diff --git a/vim/plugin/fixed_join.vim b/vim/plugin/fixed_join.vim index 4c7c7ed4..2c9e1d92 100644 --- a/vim/plugin/fixed_join.vim +++ b/vim/plugin/fixed_join.vim @@ -1,6 +1,6 @@ " -" fixed_join.vim: User-defined key mapping to keep cursor in place when -" joining lines in normal mode. +" fixed_join.vim: User-defined key mapping and optional command to keep cursor +" in place when joining lines in normal mode. " " Author: Tom Ryder " License: Same as Vim itself @@ -31,3 +31,10 @@ endfunction noremap \ FixedJoin \ :call FixedJoin() + +" Create a command as well in case it's useful +if has('user_commands') + command -nargs=0 + \ FixedJoin + \ call FixedJoin() +endif -- cgit v1.2.3