Posts

Showing posts with the label vi

vi Cheat Sheet

Navigating File asdf w forward one word b back to start of word 0 start of line $ end of line nG go to line n G go to last line Inserting Text (§) ESC to finish i insert before cursor (§) A append at the end of line (§) o open new line below (§) C change to end of line (§) O open new line above (§) D delete to end of line Editing: 1 char 1 word n words 1 line n lines delete x dw ndw dd ndd change r cw(§) ncw(§) cc(§) ncc(§) copy (yank) into buffer yw nyw yy nyy p paste buffer after/below cursor P paste buffer before/above cursor delete -> move cursor -> paste = cut & paste copy -> move cursor -> paste = duplicate Searching for Text: /pattern search for pattern n repeat last search :n,ms/old/new/ between lines n and m substitute old with new Miscellaneous . repeat last edit command u undo last edit command >> indent line U undo all changes to current line J join lines ^L redraw screen Writing the file/Quitting vi :r file read cont...