diff options
Diffstat (limited to 'vim/plugin/fixed_join.vim')
-rw-r--r-- | vim/plugin/fixed_join.vim | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/vim/plugin/fixed_join.vim b/vim/plugin/fixed_join.vim index 5e3a5c2b..18f563f3 100644 --- a/vim/plugin/fixed_join.vim +++ b/vim/plugin/fixed_join.vim @@ -5,26 +5,29 @@ " Author: Tom Ryder <tom@sanctum.geek.nz> " License: Same as Vim itself " -if has('eval') +if exists('g:loaded_fixed_join') + \ || &compatible + finish +endif +let g:loaded_fixed_join = 1 - " Declare function - function! s:FixedJoin() +" Declare function +function! s:FixedJoin() - " Save current cursor position - let l:lc = line('.') - let l:cc = col('.') + " 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 + " Build and execute join command + let l:command = '.,+' . v:count1 . 'join' + execute l:command - " Restore cursor position - call cursor(l:lc, l:cc) + " Restore cursor position + call cursor(l:lc, l:cc) - endfunction +endfunction - " Create mapping proxy to the function just defined - noremap <silent> <unique> - \ <Plug>FixedJoin - \ :<C-U>call <SID>FixedJoin()<CR> -endif +" Create mapping proxy to the function just defined +noremap <silent> <unique> + \ <Plug>FixedJoin + \ :<C-U>call <SID>FixedJoin()<CR> |