commit 18871106361cd10dce7a0cd414b1d7ec42401537 from: mischa date: Sat Apr 06 14:45:57 2019 UTC Initial commit commit - /dev/null commit + 18871106361cd10dce7a0cd414b1d7ec42401537 blob - /dev/null blob + 95d2fdbf5ff0696bdd7f897f5cfba2627512f6f5 (mode 644) --- /dev/null +++ _footer.html @@ -0,0 +1,6 @@ +
+ + + blob - /dev/null blob + 0afac77fef4660aaa2e46fcc9f2f7ebd6dafeec7 (mode 644) --- /dev/null +++ _header.html @@ -0,0 +1,256 @@ + + + + + + + + + + blob - /dev/null blob + 06787756a23c0deef59c3f0de65f6debd03f8d40 (mode 644) --- /dev/null +++ index.md @@ -0,0 +1,39 @@ +# Why vi Rocks + +A collection of commands, command sequences in [vi(1)](https://man.openbsd.org/vi.1)/[ex(1)](https://man.openbsd.org/ex.1) or with 3rd party unitilities.
+These all work with at least [nvi](https://en.wikipedia.org/wiki/Nvi) 1.79 and 2.1.3 (unicode). + +#### Yank / delete an arbitrary number of lines. + + 1) mark the first line: mk + 2) move to last line + 3a) yank: y'k + 3b) delete: d'k + 4) move to new line + 5) paste with P or p + +#### Join all lines in a file + + :%j + +#### When you need root permissions to write the file + + :w !doas tee % + +#### Diff the file on disk with the file in cache + + :w !diff -u % - + +#### Make a backup of the file on disk + + :! cp % %.bak + +#### Sort lines + + :%!sort + +#### Dedup lines + + :%!uniq + + blob - /dev/null blob + ff8d06f0d1a8711230f2917cc0b452174f7410e2 (mode 644) Binary files /dev/null and vi.jpg differ