From 18871106361cd10dce7a0cd414b1d7ec42401537 Mon Sep 17 00:00:00 2001 From: mischa Date: Sat, 6 Apr 2019 16:45:57 +0200 Subject: [PATCH] Initial commit --- _footer.html | 6 ++ _header.html | 256 +++++++++++++++++++++++++++++++++++++++++++++++++++ index.md | 39 ++++++++ vi.jpg | Bin 0 -> 809 bytes 4 files changed, 301 insertions(+) create mode 100644 _footer.html create mode 100644 _header.html create mode 100644 index.md create mode 100644 vi.jpg diff --git a/_footer.html b/_footer.html new file mode 100644 index 0000000..95d2fdb --- /dev/null +++ b/_footer.html @@ -0,0 +1,6 @@ +
+ + + diff --git a/_header.html b/_header.html new file mode 100644 index 0000000..0afac77 --- /dev/null +++ b/_header.html @@ -0,0 +1,256 @@ + + + + + + + + + + diff --git a/index.md b/index.md new file mode 100644 index 0000000..0678775 --- /dev/null +++ b/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 + + diff --git a/vi.jpg b/vi.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ff8d06f0d1a8711230f2917cc0b452174f7410e2 GIT binary patch literal 809 zcmV+^1J?YBP)004R>004l5008;`004mK004C`008P>0026e000+ooVrmw00002 zVoOIv0RM-N%)bBt01#tgPIdqQ2Y>(o1ULWy0BisN0Z~&Xpril*0*XmQK~!ko?V7(Y zLs1xpZ-pRY6B8SYjwXvR7@9~}Y!U;BNRviGcZ-EeMM5Gmh}C4kA|WyO2h?N}vDhq) zNNdoRwzu#5ednC$kDPb8N#E~WPtU!#o-~aVf+kBxvjKS`Pt;08L$fWsM-l&d#8dc9 z@s()3W1&u@>tyHiSIraE&0<>odUNm5bMGsh4ei&K@gHD4BpQhwz}c|={cHoSVLiEz zQpX=~IHW(E8iPw%PlzU>Cvdp7&mC^U6|ASv+UEWjoUZ9lho|8J)>ERno^v=|-RCoS z3s}#II+AHTUDaRY7T`SVIZ?3matp_+`t*7y9A~|Ns5g!`sj`2_uE1&5ONfH_-4mRz z=yzB9;V|n(L<38EaQ<)qe4T)^tPjtB`cdTP5X}~kj}0d>yK0`OVMJ|XY~`nxnA^_i zXAr#fUBe-@sUad}ZprRU5Ts%;G@~~)c-4rxbscTL-Cym)^Xg3v5;1d|oKGdThR}q8 zso^`DnOpiYkN-g!m>MQx<~BG!12x0M)G!eb;lv z&J%ikZ{SIdOpWXjH8&J9Q!B;$ktb>)qP8=(@>5LAEi}faCLv`ZaYC0ljZZ1qsNrcVKiK!`xu(>%gH7yY`H#eqMPC=gH3i0pT n*n0mvHc#Y