commit - ee74a164076c0c0ed56a0a4800657d2b431823b5
commit + c57b73233d33683a79506aba1368d3a91eaf8a7b
blob - 399bde60a1ebb7d65fe47aa7da7aa6ec489a2953
blob + fb3a8301d513cc77aa7adc401b28870c78d14710
--- index.md
+++ index.md
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.<br>
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`<br>
</pre>
+## Remove trailing whitespace from every line
+
+ :%s/\s\+$//
+
+
## Remove trailing whitespace from a block
:'k,'ls/\ *$//
</pre>
+## Format whole document
+
+ :%!fmt -s
+
+In your .nexrc
+
+<pre>
+map gF :%!fmt -s<u><CTRL-V><ENTER></u>
+</pre>
+
## Reverse all lines, move `m` all lines to 0
:g/1*/m0