Newbie: What determines the command repeated by the . command?

2009-08-05 Thread samppi

I'm trying out vim for the first time, and I'm wondering about the
apparently very useful "." command. It repeats the "last command",
which actually may be a string of commands like "dd" or "A
{}".

But what determines how far back these compound commands reach? Is it
determined by the amount of time between each keystroke? (If so, is
that pause customizable?) Can certain keystrokes start a new chain? Is
there even a rule?

--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



RE: Newbie: What determines the command repeated by the . command?

2009-08-06 Thread John Beckett

samppi wrote:
> I'm trying out vim for the first time, and I'm wondering
> about the apparently very useful "." command. It repeats the
> "last command", which actually may be a string of commands
> like "dd" or "A {}".
>
> But what determines how far back these compound commands
> reach?

Pressing . repeats the last normal-mode command entered (a
single command). You need some experience to work out what that
actually means. Some examples (each time, from normal mode, that
is, you have pressed Escape):

Press i then type some text (a little or a lot) then press Esc.
Now move cursor elsewhere and press . to repeat the insert
(pressing i and typing is a single command).

Type daw to delete a word. If wanted, move cursor. Press . to
delete a word.

Type gqip to format (wrap lines) a paragraph. Move cursor and
press . to format another paragraph.

Type 5dd to delete 5 lines. Press . to delete another 5 lines.

John


--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Newbie: What determines the command repeated by the . command?

2009-08-06 Thread Efraim Yawitz
This reminds me of something I've sometimes wanted.  Could it be possible to
have a history of normal mode commands and have the possibility of executing
any one of the recent ones?

On Thu, Aug 6, 2009 at 1:59 PM, John Beckett wrote:

>
>
> Pressing . repeats the last normal-mode command entered (a
> single command). You need some experience to work out what that
> actually means. Some examples (each time, from normal mode, that
> is, you have pressed Escape):
>

--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Newbie: What determines the command repeated by the . command?

2009-08-06 Thread David

Hi,

is q: what you are looking for?

David


Efraim Yawitz wrote:
> This reminds me of something I've sometimes wanted.  Could it be
> possible to have a history of normal mode commands and have the
> possibility of executing any one of the recent ones?
> 
> On Thu, Aug 6, 2009 at 1:59 PM, John Beckett  > wrote:
> 
> 
> 
> Pressing . repeats the last normal-mode command entered (a
> single command). You need some experience to work out what that
> actually means. Some examples (each time, from normal mode, that
> is, you have pressed Escape):
> 
> 
> 
> > 


--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Newbie: What determines the command repeated by the . command?

2009-08-06 Thread Efraim Yawitz
No, that's only for ex commands.  I'm thinking of something similar for
normal mode.

On Thu, Aug 6, 2009 at 3:35 PM, David  wrote:

>
> Hi,
>
> is q: what you are looking for?
>
> David
>
>
> Efraim Yawitz wrote:
> > This reminds me of something I've sometimes wanted.  Could it be
> > possible to have a history of normal mode commands and have the
> > possibility of executing any one of the recent ones?
> >
>

--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Newbie: What determines the command repeated by the . command?

2009-08-06 Thread Alessandro Antonello

Hi, samppi.

2009/8/6 samppi :
>
> I'm trying out vim for the first time, and I'm wondering about the
> apparently very useful "." command. It repeats the "last command",
> which actually may be a string of commands like "dd" or "A
> {}".
>
> But what determines how far back these compound commands reach? Is it
> determined by the amount of time between each keystroke? (If so, is
> that pause customizable?) Can certain keystrokes start a new chain? Is
> there even a rule?
>

I think you should see the ':changes' command (:help changes). It output a
list of last changes in the current buffer. The last one will be repeated when
you press '.' in normal mode. But the '.' command also repeat a yank command
that is not a change in the buffer. See ':help .' for an explanation.

Regards,
Alessandro

--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Newbie: What determines the command repeated by the . command?

2009-08-06 Thread Charles Campbell

Efraim Yawitz wrote:
> No, that's only for ex commands.  I'm thinking of something similar 
> for normal mode.
>
> On Thu, Aug 6, 2009 at 3:35 PM, David  > wrote:
>
>
> Hi,
>
> is q: what you are looking for?
>
> David
>
>
> Efraim Yawitz wrote:
> > This reminds me of something I've sometimes wanted.  Could it be
> > possible to have a history of normal mode commands and have the
> > possibility of executing any one of the recent ones?
> >
>
Would you all puh-leeze bottom post?  It happens to be the Vim 
Mailing-List's Standard.

Thanks!
Chip Campbell


--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Newbie: What determines the command repeated by the . command?

2009-08-06 Thread samppi

Thanks for the tips; :changes is especially useful. But I'm still
trying to figure out the rule that determines how changes are
separated. Does vim measure the amount of time between keystrokes
(e.g. two seconds after the last keystroke, before which a new
keystroke is added to the latest change, and after which the new
keystroke starts a new change)? Thanks for the replies in advance.

On Aug 6, 5:46 am, Alessandro Antonello 
wrote:
> Hi, samppi.
>
> 2009/8/6 samppi :
>
>
>
> > I'm trying out vim for the first time, and I'm wondering about the
> > apparently very useful "." command. It repeats the "last command",
> > which actually may be a string of commands like "dd" or "A
> > {}".
>
> > But what determines how far back these compound commands reach? Is it
> > determined by the amount of time between each keystroke? (If so, is
> > that pause customizable?) Can certain keystrokes start a new chain? Is
> > there even a rule?
>
> I think you should see the ':changes' command (:help changes). It output a
> list of last changes in the current buffer. The last one will be repeated when
> you press '.' in normal mode. But the '.' command also repeat a yank command
> that is not a change in the buffer. See ':help .' for an explanation.
>
> Regards,
> Alessandro
--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



RE: Newbie: What determines the command repeated by the . command?

2009-08-07 Thread John Beckett

Please bottom post on this list. Quote a small (relevant) part
of the message you are replying to, and put your text underneath.

See the list guidelines:
http://groups.google.com/group/vim_use/web/vim-information


--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---



Re: Newbie: What determines the command repeated by the . command?

2009-08-07 Thread Ben Fritz



On Aug 7, 12:17 am, samppi  wrote:
> Thanks for the tips; :changes is especially useful. But I'm still
> trying to figure out the rule that determines how changes are
> separated. Does vim measure the amount of time between keystrokes
> (e.g. two seconds after the last keystroke, before which a new
> keystroke is added to the latest change, and after which the new
> keystroke starts a new change)? Thanks for the replies in advance.
>

As multiple people have said, '.' repeats the LAST NORMAL MODE
COMMAND. Period. End of sentence.

i, a, I, A, o, O, etc. are all considered normal mode commands, thus
any typing you do between entering insert mode and leaving with 
will be repeated with '.'.

Also as several people have said, BOTTOM POST to this mailing list, as
I am doing now, BENEATH a short quote of your email.
--~--~-~--~~~---~--~~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~--~~~~--~~--~--~---