4 ms·
I use a lit this ed (http://man.openbsd.org/4.4BSD-Lite2/ed.1 http://man.openbsd.org/4.4BSD-Lite2/ed.1) commands from vi (not just vim). For instance: Delele
by eb0la 8y ago
I use a lit this ed (http://man.openbsd.org/4.4BSD-Lite2/ed.1 http://man.openbsd.org/4.4BSD-Lite2/ed.1) commands from vi (not just vim).
For instance:
Delele first 20 lines:
<ESC>:0,20d
Delete lines from current location to end of file:
<ESC>:,$d
Search and replace from regrex:
<ESC>:0,$s/regex/replacement/g
- amaterasu 8y agoany reason for not using :%s/a/b/g for the last one?
- professorTuring 8y agoEasier way to delete (or cut): (from cursor next 20 lines) <ESC> d20d When deleted is on your copy buffer, just prest p tu paste it from cursor.
- megous 8y agoOr if you don't like counting lines: d15gg Delete from the current line to a line with a particular line number you already see on the left if you have line numbering enabled.
- pritambaral 8y agoLine number display can be relative or absolute.
- megous 8y agoHa! Good to know.
- level3 8y agoDelete lines from current location to end of file: dG is a lot faster.
- scruple 8y agoAlong the same line, the move command. Copy lines 0 through 20 to the current line: <ESC>:0,20t. I end up using variants of this and the above multiple times every work day.