Post

Boring VIM Editor

Vim Editor

Hits

Vi has 3 operation modes_

  1. Command Mode.- default when opening file.
  2. Insert Mode. - by pressing (i) can go to insert mode. (Edit/Add/Remove Text)
  3. Last Line. - Press Esc to go back to Command Mode and then Press (:) to go to the Last Line Mode. (Save/Discard/Exit)

Vim Modes

vi-mode

Commands

Command Mode

vi /filePath

  • Move Around_

    • ^ - up (K)

    • v - down (J)

    • < - left - (H)

    • > - right - (L)

  • Copy Line_
    • yy
  • Paste Line_
    • p
  • Delete a letter_
    • x
  • Delete a line_
    • dd
  • Delete 3 lines_
    • d3d
  • Undo Changes
    • u
  • Redo Changes
    • Ctrl+r
  • Find
    • /wordToSearch
  • Find Next
    • n
  • Find Previous
    • N

Insert Mode

From Command Mode press i/o/a

To go back to Command Mode Esc

Last Line Mode

  • Save
    • :w
  • Quit
    • :q
  • Save & Quit
    • :wq
  • Quit without Saving
    • :q!
This post is licensed under CC BY 4.0 by the author.