Monday, January 16, 2012

Re: What did I do?

On Jan 16, 2012, at 10:05 AM, Tim Chase wrote:

> On 01/16/12 08:54, Eric Weir wrote:
>>> This morning, working in a large text document, I realized
>> that all of a sudden all the upper case characters had been
>> converted to lowercase. It seems I accidentally issued a
>> command that has that effect. I believe at the time I had
>> caps-lock on, had forgotten that, and issued a commonly-used
>> command, probably a motion command, with it in effect.
>> Fortunately I had saved recently and was able to recover most
>> of the file from backup.
>
> Sounds like you used gu<motion>. Alternatively, if you were in visual mode, you may have hit u to force the case change.
>
> :h gu
> :h gU
> :h v_u
> :h v_U
> :h v_~

Thanks, Tim--and to everyone else who responded. My guess is it was hitting u while in visual mode. I have not advanced to the stage of using commands beginning with a g or a v. I'll check out the ones you suggest.

> And of course, if you hadn't reloaded the file and you had a sane setting for 'undolevels' (though sometimes this gets backed off for huge files), you could have just issued an undo. If you'd done other work since the incident, you might have been able to copy the entire document into a new one, undo back to before the case-change, diff the two windows, and then re-apply the changes from the pasted results.

I didn't think about undo, though I use it pretty often. "diff" is one of those things I hear about here that I haven't gotten around to checking out, yet. Likewise with "grep". I've assumed they're more relevant to programmers, which I definitely am not. But as you suggest with "diff," I'm pretty certain that even programmers' tools can be put to good use in plain old writing--if you've gone to the trouble of finding out about them.

Again, thanks to all. Perhaps the beginning of another stage in my vim education.

Sincerely,
------------------------------------------------------------------------------------------
Eric Weir
Decatur, GA USA
eeweir@bellsouth.net

"Hatred destroys. Love heals."

- Eknath Easwaran

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: