I really like the zx
key combination in Vim (it folds everything but the active area of text).
However, it seems like quite a dangerous key combination.
Pressing x
on a fold deletes the fold.
Thus, if z
is omitted, or gets captured by some other preceding key combination, it
becomes quite easy to accidentally delete the text in a fold by pressing x
on its own.
Given that dd
can also be used to delete the text in a fold, it would be good if I could
disable x
as a fold deletion tool.
- How can
x
be disabled as a fold deletion key?
You can disable
x
on folds only with the following simple<expr>
mapping:Unlike @Eelvex function, it keeps all
x
functionality and will also remapx
being run on folds tozx
.