Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let remappings zx,za... conserve prior maps #14

Open
Konfekt opened this issue Feb 28, 2015 · 2 comments
Open

let remappings zx,za... conserve prior maps #14

Konfekt opened this issue Feb 28, 2015 · 2 comments

Comments

@Konfekt
Copy link
Owner

Konfekt commented Feb 28, 2015

This could be achieved by something in the vein of

let nzx = maparg('zx','n',0,1)
if exists('nzx.rhs') | execute 'nnoremap ' . (nzx.expr ? '<expr>' : '') . ' <SID>zx '.nzx.rhs | else | nnoremap  <SID>zx zx | endif
nmap <expr> zx <SID>zx<plug>(FastFoldUpdate)
@kopischke
Copy link

Having done a bit of that in my personal configuration, and having taken a look at some plug-in code that tries to do that, I can tell you it is far from being this straightforward. You are in for a world of hurtful edge and corner cases :).

@Konfekt
Copy link
Owner Author

Konfekt commented Mar 8, 2015

Yep, It'll only work for most common mappings. There are for example parameters such as <nowait> missing. There is the savemap plugin, but implementing missing features of Vim in Vimscript is an exercise in futility. It'll probably have to stay as is, either users have not overwritten the fold mappings or have to implement FastFoldUpdate themselves.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants