0

zo can open folded lines in normal mode. What if I'm in insert mode?

For example:

line1
line2

Fold it with :1,2fold in ex mode; now, the cursor is in the beginning of line1. Then press o to switch to insert mode, move the cursor to the beginning of line1, press z, and the content will turn into this:

line1
zline2

How to unfold lines in insert mode instead of adding the character z?

1
  • You said: "press o to switch to insert mode, move the cursor to the beginning of line1, ..." This seems to be the source of the issue. Normally you'd want to go back to Normal mode to move back to line 1. When you do so, it should be easy to unfold (or fold) lines as you need to access the ones you want.
    – filbranden
    Nov 24 '20 at 3:27
2

With Ctrl-o you can switch from Insert to Normal mode for the duration of one command.

So if in Insert mode, Ctrl-o zo opens the fold and brings you back into Insert mode again.

-1

In insert mode,move the cursor on to the folded line ,press leftwards or rightwards arrow or enter key to unfold it.

1
  • I am sorry for that , forget it ,closed now.
    – showkey
    Nov 24 '20 at 14:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.