When I open a fold in vim by zo, I am at starting of opening fold. Then I need to usually jump to end of fold by ]z. Is there any single command for it?
The zr command will open all first-level folds in Vim, and zR will open all of the folds in the file. The zm command will re-fold the first-level folds, and zM will close all open folds in a file.
The problem is that when you close Vim, your artfully folded code returns to its unfolded state. The solution is quite simple - when you are ready to save your folds run the :mkview command. This will save your folds in the current buffer to your viewdir ( :h viewdir ) depending on your environment.
Vim makes it easy to navigate previous locations: Ctrl + o navigate to the previous location in the jump list (think o as old) Ctrl + i navigate to the next location in the jump list ( i and o are usually next to each other) g; go to the previous change location.
No, but you can create a keymapping if you like.
nmap z] zo]z
nmap z[ zo[z
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With