Created
February 26, 2015 18:37
-
-
Save mattboehm/da63a48eedf6f14375aa to your computer and use it in GitHub Desktop.
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! SplitRegex() | |
tabnew | |
setlocal buftype=nofile bufhidden=hide noswapfile | |
let numlines=len(@") | |
execute "normal! V".numlines."pggjl" | |
let tmp=@z | |
let @z="hv0r wlv$r j" | |
execute "normal! ".(numlines-2)."@z" | |
let @z=tmp | |
execute "normal! gglv$r\<space>" | |
xnoremap <buffer> <SPACE> <Esc>:let tmp=@/<CR>gvJ:s;\S\zs\s\+\ze\S;;g \| let @/=tmp \| unlet tmp<CR> | |
nmap <SPACE> Vj<SPACE> | |
endfunction | |
xnoremap ,r y:call SplitRegex()<CR> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment