Home
millie O&M David C. Simpson

I have several vim tips in the pipe, so I think I'll start with one. If you're editing commands in the ex-like Command Line Mode of vim (the one that's displayed after you press ":" in Normal Mode), you can use the Ctrl+R family of keybindings to insert registers and other text there. So for example, if you wish to search for a word, you can do yaw in the buffer, and then type :grep -r <CTRL+R>" ..

Since this pattern is so common, the vim developers already thought of it, and you can simply position the cursor on the word and type :grep -r <CTRL+R><CTRL+W> .. Ctrl+R;Ctrl+A searches for WORDS.

Note that Ctrl+R by default executes the pasted expression as a mini vim program. If you want to insert the literal string, use Ctrl+R;Ctrl+R. Better safe than sorry.

Grey Cat, Puzzles and some Vim Tips

  • Dec. 13th, 2006 at 8:56 PM
EvilPHish evil fish shlomi fish

When I went out today on a walk, I saw a pure grey (not striped) street cat walking on the sidewalk. I don't believe I've seen him before. He was very majestic and reminded me of a majestic grey cat who used to hang around the ground floor of my previous building. The fur of the cat I saw today was somewhat darker, though.

That put aside, I dedicated some time to work on my home site's puzzles section. I traced the solution of the Ravensborg's Guild puzzle, and as I discovered it had some missing information required to solve it. The corrected riddle along with the solution is on that page now. I also traced the solution of "Between the Screws. This time there wasn't any missing information but there were a few hints that I did not need.

Next on my agenda in the puzzle arena is to trace the solution (and the final outcome) for another puzzle, and to integrate the grammatical corrections an IRC correspondant reported on "Between the Screws".

And now for some Vim tips. One can use the vim black hole register (or null register) "_ (:help "_) to delete text using the "d" or "c" commands without affecting the other registers. So one can press "_d{movement}p to safely paste text. The second tip (which I discovered when looking for the reference for this one) is that pressing " followed by the uppercase letter of a register, will append text to this register.

I hope you enjoyed this entry. Until next time, stay cool!

Latest Month

August 2008
S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930
31      

Tags