Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. :nnoremap J gJ
  2.  
  3. Hello
  4. world
  5.  
  6. Hello world
  7.  
  8. " Like gJ, but always remove spaces
  9. fun! JoinSpaceless()
  10. execute 'normal gJ'
  11.  
  12. " Character under cursor is whitespace?
  13. if matchstr(getline('.'), '%' . col('.') . 'c.') =~ 's'
  14. " When remove it!
  15. execute 'normal dw'
  16. endif
  17. endfun
  18.  
  19. " Map it to a key
  20. nnoremap <Leader>J :call JoinSpaceless()<CR>
  21.  
  22. xxxx=
  23. 123
  24.  
  25. xxxx123
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement