Vim tips

If you want to search for something you select in visual mode: 1) yank 2) / 3) CTRL-R” 4) That is: y/^R” (note: ” is the default yank buffer. You could use a named buffer as well if you want.)

~ — switch case of character under cursor

i_CTRL-A — In insert mode, insert the previously inserted text.

{visual}g? — Rot13 encode highlighted text g?? — Rot13 encode the current line

CTRL-A — Add [count] to the number at or after the cursor CTRL-X — Subtract [count] from the number at or after the cursor

J - join the current line with the line below it.

. — repeat the last change

If you want to change a quotation: “This is a quotation” And want to change it to: “blablabla” Start on the first letter of the quotation and press ct” (Change Till “)

ga - with your cursor over a character, it will show you the decimal, hex, and octal codes of the character. Great for non printable characters.

To insert special characters, you’ll be interested in digraphs. :digraphs will show you a complete table of special characters, plus their two character code, plus their ascii number. You can insert digraphs using ctrl-k plus the two character code. For example ctrl-k SX results in ^B being inserted

Leave a Comment

You must be logged in to post a comment.