Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. 1. I type <leader>
  2. 2. Plugin pops up a sidebar with "gc - fugitive commit, gd - fugitive diff" etc
  3. 3. I can continue typing my command
  4.  
  5. " <Leader>x List all mappings defined in normal / visual mode that
  6. " {Visual}<Leader>x start with <Leader>x (if any are defined and there is no
  7. " dedicated <Leader>x mapping itself).
  8. function! s:MakeMappingHelperMappings()
  9. for l:i in range(65,90) + range(97,122)
  10. let l:char = nr2char(l:i)
  11. let l:map = '<Leader>' . l:char
  12. for l:mode in ['n', 'x']
  13. if ! empty(mapcheck(l:map, l:mode)) && empty(maparg(l:map, l:mode))
  14. execute printf('%snoremap %s :<C-u>%smap %s<CR>', l:mode, l:map, l:mode, l:map)
  15. endif
  16. endfor
  17. endfor
  18. endfunction
  19. call s:MakeMappingHelperMappings()
  20. delfunction s:MakeMappingHelperMappings
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement