Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well the formatting got messed up and it's too late to edit it:

* html you can change inside of a text object. If you are say anywhere inside of a link <a href="som|e link"> you can ci< and you have deleted the whole thing and are left with <|> (where the cursor is denoted by |) If instead you typed ci" you would be left with <a href="|"> this is a very powerful pattern

* you can script little macros that do text editing on a macro scale very efficiently. This is more useful than a simple find and replace. you want to make a list that starts with a number, has that number in it and is incremented by one(or two or...) every time.

Type the first sentence 1, xv001, "", more stuff.

exit out of insert mode: jj or esc

start recording the macro into register r: qr

yank the line and paste it: yyp

go to the beginning of the line: 0 or ^

increment by one and move one word right and increment the next number: ctrl-a w ctrl-a

move down one line: j

exit recording: q

run macro r 100 times: 100@r



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: