Posts filed under ‘Vim’

Vim Insertion: Paste While Typing in Insert Mode

You probably know the Vim control-r key combination, `ctrl+r`, for “undo”. But did you know that, while typing in Insert Mode, you can use `ctrl+r` to paste from any of your vim registers? It’s so cool!

Continue Reading 2024-03-10 at 10:03

Vim Navigation: gd

You are typing in vim, polishing your letter to the editor of your local newspaper, and you realize that you forgot to define DEI (parenthetically) the first time you used it. In normal mode, you can put your cursor on DEI and type:

gd

to jump to the first time you used that word. The mnemomic is “goto declaration” (because the first time you, for example, have a variable in your code is where you’re “declaring” it). The help file says “This was made to work for C code, in other languages it may not work well.” But I have found it helpful in ordinary prose.

The help file is worth looking at, for understanding variations like gD, 1gd, and 1gD; particularly if you’re looking for variable declarations in function blocks vs globally.

Info at vimhelp.org: https://vimhelp.org/pattern.txt.html#gd

-mmlvx, 2024-03-08

2024-03-09 at 01:28

Vim Navigation: gi

You were typing your novel in vim, then you used ctrl+o to check the exact phrasing you used in a different section; and you scrolled around a bit with ctrl+d and }. Now that you know what you want to say, how do you quickly return to the place where you want to say it?

gi

In Normal Mode, gi will go to the place where you most recently were in Insert Mode (and put you in Insert Mode, ready to type). The mnemonic is pretty simple, “go to insertion” or something like that. I’ve been using this a lot since I learned of it a week or two ago.

Info at vimhelp.org: https://vimhelp.org/insert.txt.html#gi

-mmlvx, 2024-03-01

2024-03-01 at 17:29

Adventuring with Vim

Princess from Vim Adventures gameI’ve started streaming on Twitch myself (I’m mike_tac at twitch.tv), which is surprisingly fun. I’m not yet playing Baduk there, because I’m a bit chicken; but I’ve been playing a tutorial game called Vim Adventures, and streaming that.

Continue Reading 2017-07-22 at 09:59


May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories