commit c57b73233d33683a79506aba1368d3a91eaf8a7b from: mischa date: Sun May 10 11:26:58 2020 UTC added the register link to Bill Joy article commit - ee74a164076c0c0ed56a0a4800657d2b431823b5 commit + c57b73233d33683a79506aba1368d3a91eaf8a7b blob - 399bde60a1ebb7d65fe47aa7da7aa6ec489a2953 blob + fb3a8301d513cc77aa7adc401b28870c78d14710 --- index.md +++ index.md @@ -13,7 +13,9 @@ text editor in any Unix-like operating system._ Here is a collection of [vi(1)](https://man.openbsd.org/vi.1)/[ex(1)](https://man.openbsd.org/ex.1) commands and command sequences.
Tested with [nvi](https://en.wikipedia.org/wiki/Nvi) 1.79 and 2.1.3 (unicode). +[Bill Joy's greatest gift to man - the vi editor](https://www.theregister.co.uk/2003/09/11/bill_joys_greatest_gift/) + ## Yank/delete lines (1) mark the first line: `mk`
@@ -50,6 +52,11 @@ Tested with [nvi](https://en.wikipedia.org/wiki/Nvi) 1 +## Remove trailing whitespace from every line + + :%s/\s\+$// + + ## Remove trailing whitespace from a block :'k,'ls/\ *$// @@ -188,6 +195,16 @@ width = 40 +## Format whole document + + :%!fmt -s + +In your .nexrc + +
+map gF :%!fmt -s<CTRL-V><ENTER>
+
+ ## Reverse all lines, move `m` all lines to 0 :g/1*/m0