From e132c864e873e8f8f040f4048e992d20468e4255 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 30 May 2018 23:27:02 +1200 Subject: Spin off fixed_join Vim plugin --- vim/plugin/fixed_join.vim | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 vim/plugin/fixed_join.vim (limited to 'vim/plugin') diff --git a/vim/plugin/fixed_join.vim b/vim/plugin/fixed_join.vim deleted file mode 100644 index 2e7f2abd..00000000 --- a/vim/plugin/fixed_join.vim +++ /dev/null @@ -1,45 +0,0 @@ -" -" 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 -" -if exists('g:loaded_fixed_join') || &compatible - finish -endif -let g:loaded_fixed_join = 1 - -" Declare function -function! s:FixedJoin() - - " Save current cursor position - let l:lc = line('.') - let l:cc = col('.') - - " Build and execute join command - let l:command = '.,+' . v:count1 . 'join' - execute l:command - - " Restore cursor position - call cursor(l:lc, l:cc) - -endfunction - -" Create mapping proxy to the function just defined -noremap - \ FixedJoin - \ :call FixedJoin() - -" If there's no mapping to it already, try to bind normal-mode J to it, to -" simply replace the old functionality -nmap - \ J - \ 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