vim-leader-guide icon indicating copy to clipboard operation
vim-leader-guide copied to clipboard

Handling for default keybinds

Open metakirby5 opened this issue 8 years ago • 1 comments

I have the following keybinds for the z prefix:

n  zs          * <Esc>:set foldmethod=syntax<CR>zR
n  zi          * <Esc>:set foldmethod=indent<CR>zR
n  zm          * <Esc>:set foldmethod=marker<CR>zR
n  z           * :<C-U>LeaderGuide 'z'<CR>

However, this seems to disable default keybindings like za. Is there a way to pass them through?

metakirby5 avatar Feb 04 '17 00:02 metakirby5

Sorry for the late reply. This turns out to be surprisingly tricky problem. The z* default bindings are handled different from mappings. For some reason the z mapping is always triggered when invoking a z* command like zz.

A possible workaround is to redefine all the default commands as mappings:

nnoremap zz zz
nnoremap z+ z+
nnoremap z- z-
nnoremap z. z.
nnoremap z= z=
etc.

This is admittedly not all that great. I will definitely look for a better solution.

hecal3 avatar Mar 18 '17 16:03 hecal3