In Vim, I often find myself wanting to do a quick zk or zj to jump to the previous or next fold in a file. The problem is, I frequently want to skip all the open folds, and just jump to the nearest closed fold.
Is there a way to do this? I see no built-in keymap in the help.
Let me propose the following implementation of the described behavior.
If it is desirable for the mappings to accept a count for the number
of repetitions of the corresponding movement, one can implement
a simple function for repeating any given command:
and then redefine the above mappings as follows: