aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vim/doc/fixed_join.txt5
-rw-r--r--vim/plugin/fixed_join.vim11
2 files changed, 13 insertions, 3 deletions
diff --git a/vim/doc/fixed_join.txt b/vim/doc/fixed_join.txt
index 0ee957d0..df0df251 100644
--- a/vim/doc/fixed_join.txt
+++ b/vim/doc/fixed_join.txt
@@ -1,4 +1,4 @@
-*fixed_join.txt* Mapping to join lines in normal mode without moving cursor
+*fixed_join.txt* Join lines in normal mode without moving cursor
Author: Tom Ryder <tom@sanctum.geek.nz>
License: Same terms as Vim itself (see |license|)
@@ -6,6 +6,9 @@ License: Same terms as Vim itself (see |license|)
This plugin provides a mapping target <Plug>FixedJoin to create a binding for a
user to join lines in normal mode without the cursor jumping around.
+If also provides a :FixedJoin command if you have +user_commands, but this is
+not required.
+
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/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 <tom@sanctum.geek.nz>
" License: Same as Vim itself
@@ -31,3 +31,10 @@ endfunction
noremap <silent> <unique>
\ <Plug>FixedJoin
\ :<C-U>call <SID>FixedJoin()<CR>
+
+" Create a command as well in case it's useful
+if has('user_commands')
+ command -nargs=0
+ \ FixedJoin
+ \ call <SID>FixedJoin()
+endif