VIM

WHY DO WE NEED TO KNOW SOMETHING ABOUT VIM?

  • Most UNIX systems have it by default
  • Way more powerful than nano
  • Easy to install and setup

WHAT IS DIFFERENT WITH VIM WHEN COMPARED TO THE EDITORS I AM USED TO?

  • Decision trees VS Key Combinations
  • No mouse required at all

BASIC MOVEMENT COMMANDS

  • w: Move to the start of next word
  • e: Move to the end of the next word
  • $: Move to the end of the line
  • ^: Move to the beginning of the line
  • gg: Go to the start of the file
  • G: Go to the end of the file
  • #gg or #G: Go to line number "#"

BASIC DELETION COMMANDS

  • dd: Delete current line
  • D: Delete text from cursor to the end of the line
  • #dd: Delete "#" lines starting with the current one
  • x: Delete current character

BASIC INSERT COMMANDS

  • i: Enter insert mode before current character
  • a: Enter insert mode after current character
  • I: Enter insert mode at the start of the ext on the current line
  • A: Enter insert mode at the end of the line
  • o: Enter insert mode after the current line
  • O: Enter insert mode before the current line

POWER OF VIM LIES IN COMBINING COMMANDS

  • dw: Delete until the end of the word
  • d$: Delete until the end of the line (same as D)

MARKS

  • mk: Creates a mark named k. k can be replaced by any lowercase letter.
  • 'k: Go to k.
  • d'k: Delete from current position to k.
Made with Slides.com