Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :nnoremap J gJ
- Hello
- world
- Hello world
- " Like gJ, but always remove spaces
- fun! JoinSpaceless()
- execute 'normal gJ'
- " Character under cursor is whitespace?
- if matchstr(getline('.'), '%' . col('.') . 'c.') =~ 's'
- " When remove it!
- execute 'normal dw'
- endif
- endfun
- " Map it to a key
- nnoremap <Leader>J :call JoinSpaceless()<CR>
- xxxx=
- 123
- xxxx123
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement