eftychia: Me in kilt and poofy shirt, facing away, playing acoustic guitar behind head (Default)
Add MemoryShare This Entry
posted by [personal profile] eftychia at 04:13pm on 2005-03-07

In the editor I use most often, vi, the '~' key will toggle the character under the cursor from uppercase to lowercase or vice versa. I just caught myself trying to use it to change a doublequote (") to a singlequote/apostrophe ('). Huh.

(Yes, I know there's a difference between singlequote, apostrophe, and tick; what I meant was "apostrophe-where-I-really-wanted-singlequote-but-I'm-typing-ASCII".)

There are 2 comments on this entry. (Reply.)
 
posted by [identity profile] puzzledance.livejournal.com at 10:31pm on 2005-03-07
Yay, I learned something new about vi!
 
posted by [identity profile] dglenn.livejournal.com at 11:40am on 2005-03-10
Happy to be helpful. I don't remember when I first learned about '~' in vi, but I've used it an awful lot since then. Then again, when I started feeling comfortable in vi, it felt like I only understood about 1/20 to 1/10 of what it could do but that small portion was enough to make it a pretty powerful tool; since then I've learned a lot more of it, but I've also switched to using vim on my home machines ('cause that's what comes up when you tell Linux to run vi), and I know vim has a bunch of new features that I haven't gotten around to exploring (along with a couple that I've gotten used to and have to remind myself vanilla vi doesn't have when I'm on a SunOS machine).

The only problem with vi (well, for me anyhow -- the modal aspect really bothers some other folks) is the temptation to do large search-and-replace operations with a wickedly long command with complex regular expressions in it that is (because it's so long) too likely to wind up with a typo in it. If I could have command-history -- tell it to show me the last command I tried and let me fix the typo or thinko in it -- then that wouldn't be such a problem. (But when the long commands work, there's a certain smugness that results from completely restructuring a file with a single command.)

Links

January

SunMonTueWedThuFriSat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24
 
25
 
26
 
27
 
28
 
29
 
30
 
31