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. Ex mode (prepare to exit vi editor) [Enter : in command mode]

Ex Mode Commands#

  1. :wq Save and exit (note that w is for save, q is for exit, in that order, wq cannot be reversed)
  2. :q! Force exit document (i.e., do not save and exit)

Appreciating the Advantages of vi Editor#

vi Editor Command Mode Commands#

  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: /text_to_search
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.