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
xbe disabled as a fold deletion key?
You can disable
xon folds only with the following simple<expr>mapping:Unlike @Eelvex function, it keeps all
xfunctionality and will also remapxbeing run on folds tozx.