How do I exit the Vim editor?

后端 未结 10 2260
青春惊慌失措
青春惊慌失措 2020-11-22 02:26

I\'m stuck and cannot escape. It says:

\"type :quit to quit VIM\"

But when I type that it simply appears in the object body.

10条回答
  •  清酒与你
    2020-11-22 03:16

    The question has been asked here.

    The q command with a number closes the given split in that position.

    :q or :q will close the split in that position.

    Let's say your Vim window layout is as follows:

    -------------------------------------------------
    |               |               |               |
    -------------------------------------------------
    |               |               |               |
    |               |               |               |
    |    Split 1    |    Split 2    |     Split 3   |
    |               |               |               |
    -------------------------------------------------
    

    If you run the q1 command, it will close the first split. q2 will close the second split and vice versa.

    The order of split position in the quit command does not matter. :2q or :q2 will close the second split.

    If the split position you pass to the command is greater than the number of current splits, it will simply close the last split.

    For example, if you run the q100 on the above window setup where there are only three splits, it will close the last split (Split 3).

提交回复
热议问题