Konfekt / FastFold

Speed up Vim by updating folds only when called-for.
709 stars 24 forks source link

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

Open Konfekt opened 9 years ago

Konfekt commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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.