Friday, January 28, 2011

Re: Typing numbers

On 01/28/2011 09:53 PM, Chris Jones wrote:
> On Fri, Jan 28, 2011 at 05:35:02PM EST, Tim Chase wrote:
>> This breaks when using t/T with ";" to repeat the motion as it just finds
>> the same one you just found. I have to break down and count for those :)
>
> Another reason why I don't use t/T (and don't care much for f/F either).

Eh, for the most part, the t/T/f/F work much like my brain on the
matter: "go forward to character X".. The only gotcha is
repeated attempt to use t/T with ";". With f/F it works fine.

> There's only so much can fit under my skull.

I can sympathize -- there are corners I rarely touch and see crop
occasionally to think "that would be really useful if I could
remember it at the times I need it" (the recent attempt was
learning the bash "!" expansions...poof, gone)

> 'i''s.. What would I really gain by counting 1, 2, 3.. it's the 3rd 'i'

Yeah, I'll often fall back do using f/F and then moving back one
character or reinserting whatever character I removed by
overshooting.

>> 80I-<esc>
>
> I vaguely remembered that there was a better way
[snip]
> One nice touch about the above sequence and makes it really elegant is
> the upper case 'I' because you can type it regardless of where the
> cursor is located on the current line: after you hit<Esc>, the cursor
> sits on the last of your inserted dashes, which means that you just need
> to type 'a' to switch to insert mode with the cursor on the first
> character following the last dash and 'Enter' to separate your line of
> dashes and the previous contents of the line and move down any ensuing
> text.

it works with i, I, gI, a, and A...on a blank line, it doesn't
make a difference as they all behave the same, inserting [count]
characters[*] at the defined location and leaving the cursor at
the end. With pre-existing content and leading whitespace, there
are subtle differences. However they all make sense depending on
what you want to do.

-tim

[*] you can add more than one character, so if you wanted, you
could get fancy with something like

40i-=<esc>

to get a nice row of 80 characters like "-=-=-=-...=-=-=-=" but
again you then have to do the math and divide down. Not
grievous, but I can count the real-world times I've done that on
one hand.


--
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:

Post a Comment