Created
October 24, 2012 22:12
-
-
Save tpope/3949272 to your computer and use it in GitHub Desktop.
Aggressively in-your-face splitjoin.vim mappings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function! s:join(cmd) | |
| if exists(':SplitjoinJoin') && !v:count | |
| let tick = b:changedtick | |
| SplitjoinJoin | |
| if tick == b:changedtick | |
| execute 'normal! '.a:cmd | |
| endif | |
| else | |
| execute 'normal! '.v:count.a:cmd | |
| endif | |
| endfunction | |
| nnoremap <silent> gJ :<C-U>call <SID>join('gJ')<CR> | |
| nnoremap <silent> J :<C-U>call <SID>join('J')<CR> | |
| nnoremap <silent> gS :SplitjoinSplit<CR> | |
| nnoremap <silent> S :SplitjoinSplit<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment