Vim Tips Wiki
m (Repeat last moved to Repeat last colon command: Page moved by JohnBot to improve title)
(Change to TipImported template + severe manual clean)
Line 1: Line 1:
 
{{review}}
 
{{review}}
  +
{{TipImported
{{Tip
 
 
|id=990
 
|id=990
  +
|previous=989
|title=Repeat last
 
  +
|next=991
|created=September 10, 2005 5:12
+
|created=September 10, 2005
 
|complexity=basic
 
|complexity=basic
 
|author=klausenhausen
 
|author=klausenhausen
 
|version=5.7
 
|version=5.7
 
|rating=182/61
 
|rating=182/61
 
}}
|text=
 
The last command entered at the ':' can be repeated with @: and further repeats can be done with @@
+
The last command entered with ':' can be repeated with <tt>@:</tt> and further repeats can be done with <tt>@@</tt>
   
Useful for commands like e.g. :bnext or :cNext.
+
This is useful for commands like <tt>:bnext</tt> or <tt>:cNext</tt>.
   
 
==Comments==
 
I scrol through the previous commands with cursor up/down after pressing ':'.
   
 
You still can edit the command or just press Enter.
   
 
}}
 
 
== Comments ==
 
I'm scrolling through the last commands with cursor up/down after pressing ':'
 
You still can edit the command or just press ENTER.
 
 
'''Anonymous'''
 
, September 11, 2005 23:26
 
 
----
 
----
This Tip becomes super useful with something like the following
+
This Tip becomes super useful with something like the following:
   
  +
<pre>
:%s/\&lt;pig\&gt;/cow/gie|:update|:next
+
:%s/\&lt;pig\&gt;/cow/gie|:update|:next
  +
</pre>
   
This facilitates (as suggested by the OP) the modification of a series of files.
+
This facilitates the modification of a series of files.
   
Note you need the 'e' of the gie
+
Note you need the 'e' of the gie
g=do as many times as occurs in line
+
*g=do as many times as occurs in line
i=ignore case
+
*i=ignore case
e=don't break command if no search string found
+
*e=don't break command if no search string found
 
have added this excellent tip to [[VimTip305]]
 
 
 
zzapper
 
, September 12, 2005 6:05
 
----
 
Why not using :bufdo instead?
 
 
'''Anonymous'''
 
, September 18, 2005 12:02
 
----
 
This is especially useful when doing some semi-manual repetitive search/edit task in multiple files: it becomes a matter of hitting n n . n . n n n . --AT--: n . n n . ...etc, keeping your fingers in the middle of the keyboard without having to reach for : &lt;arrow-up&gt; each time you need to switch files.
 
   
rix0r--AT--rix0r.nl
 
, October 13, 2006 14:13
 
 
----
 
----
<!-- parsed by vimtips.py in 0.668946 seconds-->
 

Revision as of 10:11, 9 December 2007

Tip 990 Printable Monobook Previous Next

created September 10, 2005 · complexity basic · author klausenhausen · version 5.7


The last command entered with ':' can be repeated with @: and further repeats can be done with @@

This is useful for commands like :bnext or :cNext.

Comments

I scrol through the previous commands with cursor up/down after pressing ':'.

You still can edit the command or just press Enter.


This Tip becomes super useful with something like the following:

:%s/\<pig\>/cow/gie|:update|:next

This facilitates the modification of a series of files.

Note you need the 'e' of the gie

  • g=do as many times as occurs in line
  • i=ignore case
  • e=don't break command if no search string found