Karl Castillo

@koralarts

@koralarts

@koralarts

How Do I Exit Vim? An

Introduction To Vim

Vi Improved

The mostly terminal-based text editor found in most machines.


Originally released for the Amiga in 1991, many versions of it for different operating systems have been released since then.


https://en.wikipedia.org/wiki/Vim_(text_editor)

The 4 Modes of Vim

  1. Normal
  2. Command
  3. Visual
  4. Insert

Normal Mode Commands

  • i - Go into Insert Mode
  • v - Go into Visual Mode
  • u - Undo most recent edit to the file
  • w - Go forward to the start of a word
  • b - Go backward to the start of a word
  • 0 - Go to the beginning of the line
  • $ - Go to the end of the line
  • dd - Delete current line

Command Mode Commands

  • q - Quit
  • q! - Quit while discarding any edits to the file
  • w - Save
  • wq - Save and Quit
  • x - Save and Quit

Visual Mode Commands

  • > - Shift text right
  • < - Shift text left
  • y - Copy text (yank)
  • d - Delete text
  • ~ - Toggle case

Searching

  • /pattern  - Search forwards
  • ?pattern  - Search backwards
  • n  - Next search result
  • N  - Previous search result
  • %s/search_pattern/replace_with  - Search and replace
  • %s/search_pattern/replace_with/c  - Search and replace with confirmation

Resources

When? Why?

Made with Slides.com