diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-05 00:41:40 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-05 00:41:40 +1300 |
commit | 2044d97b03c31083cc0bb47a3f65d729d98f558b (patch) | |
tree | f41874a69203faf1f1e5780925b06e84310a9eeb /vim/plugin/fixed_join.vim | |
parent | Merge branch 'release/v0.7.0' (diff) | |
parent | Bump version number to 0.8.0 (diff) | |
download | dotfiles-fdbeadf21f5b934454f33cbf97e05d9d2afe25ea.tar.gz (sig) dotfiles-fdbeadf21f5b934454f33cbf97e05d9d2afe25ea.zip |
Merge branch 'release/v0.8.0'v0.8.0
* release/v0.8.0:
Bump version number to 0.8.0
Use BufReadPost hook for big_file_options.vim
Limit search highlighting hooks to Vim >= 7.1
Add explanatory note for choosing imperfect remap
Set 'guioptions' flag by flag
Use variable setting approach for 'guifont'
Add short-circuit boilerplate to plugins
Simplify shell linting code with single vars
Use spaces around concat dots in VimL consistently
Remove vim/bundle/html5 submodule
Remove vim/bundle/targets submodule
Adjust plugin code layout a lot
Diffstat (limited to 'vim/plugin/fixed_join.vim')
-rw-r--r-- | vim/plugin/fixed_join.vim | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/vim/plugin/fixed_join.vim b/vim/plugin/fixed_join.vim index c002f667..18f563f3 100644 --- a/vim/plugin/fixed_join.vim +++ b/vim/plugin/fixed_join.vim @@ -5,25 +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 <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> |