Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. I type <leader>
- 2. Plugin pops up a sidebar with "gc - fugitive commit, gd - fugitive diff" etc
- 3. I can continue typing my command
- " <Leader>x List all mappings defined in normal / visual mode that
- " {Visual}<Leader>x start with <Leader>x (if any are defined and there is no
- " dedicated <Leader>x mapping itself).
- function! s:MakeMappingHelperMappings()
- for l:i in range(65,90) + range(97,122)
- let l:char = nr2char(l:i)
- let l:map = '<Leader>' . l:char
- for l:mode in ['n', 'x']
- if ! empty(mapcheck(l:map, l:mode)) && empty(maparg(l:map, l:mode))
- execute printf('%snoremap %s :<C-u>%smap %s<CR>', l:mode, l:map, l:mode, l:map)
- endif
- endfor
- endfor
- endfunction
- call s:MakeMappingHelperMappings()
- delfunction s:MakeMappingHelperMappings
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement