banner
破影岚歌

破影岚歌的博客

bilibili
twitter
github

5. vi editor

vi Editor#

Three Modes of vi Editor#

  1. Command mode (default mode)
  2. Insert mode [press a in command mode (insert text after the cursor)] or [press i in command mode (insert text before the cursor)]
  3. Last line mode (prepare to exit vi editor) [input :(colon in English)]

Commands in Last Line Mode#

  1. :wq save and exit (note that w is for save, q is for exit, in that order, do not reverse wq)
  2. :q! force exit document (i.e., do not save and exit)

Appreciating the Advantages of vi Editor#

Commands in vi Editor Command Mode#

  1. yy copy current line nyy copy current n lines
  2. dd delete current line ndd delete current n lines
  3. p paste
  4. Support for search function: /function you want to search for
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.