= vim :buffers :bN switch to buffer N where N in some int +6 to return to latest buffer # hidden buffers are buffers that do not need to be stored # when I want to exit them set path+=** set wildmenu hidden set wildignore+=**/node_modules/* :find *pattern make whitespace visible: :set list :set listchars=eol:$,tab:>-,trail:~,extends:>,precedes:< listchars+=space:␣ general pattern: example: 1pu.u.u. delete (d), move (m), copy (co)(t) + show information G jump to line number jump to previous edit/search position '' jump to beginning of the line vi +46 open file and jump to line 46 vi + open file and jump to last line vi +/a open file and jump to first match of string "a" vi -r load backup of a file vi -r show all backups of files :pre create backup "dyy copy current line to buffer $d "dp paste content of buffer $d after cursor position (if you use a capital letter as buffer name, buffer content will be *appended*) "zd) delete cursor until EOL, load into buffer $z 2) move 2 sentences forward "y) append next sentence to buffer z markers (only stored within one session!): m add marker to this position ma add marker "a" to this position 'x go to beginning of the line of marker x x go to marker x :1p print first line :1,3p print lines one, two, and three :6 go to line 6 vi: "Q" switches to ex-mode. ex: ":vi" switches to vi-mode. k ↑ h l ↑ j ↓ … move up/down one line ←←←→→ … move left/right on one line ^F 1 screen forward ^D 1/2 screen down ^B 1 screen backwards ^U 1/2 screen up ^E 1 line backwards ^Y 1 line forward z move screen upwards without moving the cursor z move current line to vertical top of current screen without moving the cursor z. move current line to vertical middle of current screen without moving the cursor z- move current line to vertical bottom of current screen without moving the cursor 200z go to 200th line l redraw screen H move cursor to first line of screen M move cursor to middle line of screen L move cursor to last line of screen nH move cursor to n-th line from above nL move cursor to n-th line from below move to first character of next line + move to first character of next line - move to first character of previous line ^ move to first character of current line (but ignore spaces and tabs) 0 move to first character of current line (but ignore whitespace) e move cursor to end of word E move cursor to end of word including punctuation ( move cursor to beginning of sentence ) move cursor to beginning of next sentence { move cursor to beginning of paragraph } move cursor to beginning of next paragraph [[ move cursor to beginning of section ]] move cursor to beginning of next section end of sentence: ? . ! + 2 spaces (american standard) paragraph: text until spaces which starts with .NH .SH .LP .QP / search for pattern from cursor downwards ? search for pattern from cursor upwards n go to next match N go to previous match :set nowrapscan always start search at cursor position and do not start at the beginning of the file again d? remove everything before f cursor to next in current line F cursor to previous in current line t cursor to character before next in current line T cursor to character after next in current line ; repeat search command downwards , repeat search command upwards vi -R read-only mode zz exit and save (equals “:wq”) ls read path :e! re-read source file from filesystem :w store file under :! run at command-line :sh calls shell ( d … for exiting) (temporarily with z as well as “fg”) :pre preserve buffer 4l move 4 characters to the right :set wm=10 enable automatic line break wrapmargin (abbr. wm) distance from right screen edge 0 jump to beginning of line $ jump to end of line :set nu show line number w move forward word by word W move forward word by word without respecting symbols/punctuation b move backward word by word B move backward word by word without respecting symbols/punctuation … those commands can be combined with numbers a append to line after current cursor position i insert to line before current cursor position c change example: cw change until end of word c2b change two words backwards c$ change until end of line c0 change until beginning of line d delete p put y yank to clipboard example: dw cut word …move cursor… p paste word cc change entire current line C equals “c$” r replaces a single character at the cursor position example: text “Bit” with command “rM” could result in “Mit” s delete character at current cursor position and switches to insertion mode S replace entire line R overwrite mode ~ switch uppercase/lowercase of current characters dw delete a word (cursor until end of word) de delete a word without deleting spaces after word dE delete a word without deleting spaces after word but inclusive punctuation dd delete current line dd delete lines D equals “d$” x delete character at cursor position x delete characters at cursor position X delete character before cursor position P insert before current cursor position 3p undo 3rd-last change xp transpose (example: “Wrot” becomes “Wort”) Y equals “yy” (copy entire line) . re-run command @ re-run command but no deletion commands U undo all changes in current line (as long as you don't leave the line) insertion: A append text to end of line I insert text at beginning of line o open new empty line after current one O open new empty line before current one s substitute one character S equals “cc” (substitute one line) R replace current character example: 5i 5a*- *****----- 2r& &&