diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-07 09:34:21 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-07 09:37:24 +1300 |
commit | d2669e7190e3db3123589bfcd3ba15a2e4c5243b (patch) | |
tree | 7c6651f35660b5e5198fa64b4dad831361b42c0b /vim/plugin | |
parent | Add :StripTrailingWhitespace command (diff) | |
download | dotfiles-d2669e7190e3db3123589bfcd3ba15a2e4c5243b.tar.gz dotfiles-d2669e7190e3db3123589bfcd3ba15a2e4c5243b.zip |
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.
Diffstat (limited to 'vim/plugin')
-rw-r--r-- | vim/plugin/fixed_join.vim | 11 |
1 files changed, 9 insertions, 2 deletions
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 |