VIM

(talks.metaphoric.dev/vim)

๐Ÿ“… Timeline

ed - 1969

โ €

pdp-11.jpg

ex - 1976

vi - 1978

ADM-3A

โ €

โœฐ vim - 1991

qed โ†’ ed โ†’ em โ†’ ex โ†’ vi โ†’ vim

๐Ÿ’ฐ Invest
in your tools!

โ €

๐Ÿšซ๐Ÿ–ฑ

โ €

Modal Editing

Normal Mode

Language Syntax

verb + noun

๐Ÿ„ณ ๐Ÿ…†

  • ๐Ÿ„ณ delete (verb)
  • ๐Ÿ…† word (noun)

๐Ÿ„ฒ ๐Ÿ…†

  • ๐Ÿ„ฒ change (verb)
  • ๐Ÿ…† word (noun)

verbs

  • d: delete
  • c: change (delete & enter insert mode)
  • >: indent
  • y: yank (copy)
  • v: select (visually)

motions

  • w: word (forward)
  • b: back
  • d2w: delete 2 words
  • d3j: delete 3 lines down

text objects

  • iw ๐Ÿกข inner word
  • i" ๐Ÿกข inner quotes
  • it ๐Ÿกข inner tag (HTML tag)
  • i{ ๐Ÿกข inner brackets
  • ip ๐Ÿกข inner paragraph

surround

searching

  • f, F: "find" a character
  • t, T: "find" until
  • /: search

Basic Navigation

  • hjkl - left down up right
  • ^e, ^y - scroll the window down/up
  • ^d, ^u - scroll down/up half a page
  • ^f, ^b - scroll forward/back a full page
  • ^ - move to first non blank character in line
  • $ - move to end of line (EOL)
  • gg - go to top of file
  • G - go to bottom of file

Exiting Vim

trying-vim.webp

:q

:q!

quit without saving

:wq :x

save (write) and quit

ZZ ZQ

Macros

q<letter> - record a macro

@<letter> - run a macro

IDE?

โ €

Debugging

vimspector

~/.vimrc

$ vimtutor

:help

:help motion

โ €

neovim

neovim.io