Vim Tips Wiki
(→‎Merge tip?: That would be desirable.)
Tag: sourceedit
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{review}}
 
 
{{TipImported
 
{{TipImported
 
|id=990
 
|id=990
 
|previous=989
 
|previous=989
 
|next=991
 
|next=991
|created=September 10, 2005
+
|created=2005
 
|complexity=basic
 
|complexity=basic
 
|author=klausenhausen
 
|author=klausenhausen
Line 12: Line 11:
 
|category2=
 
|category2=
 
}}
 
}}
The last command entered with ':' can be repeated with <tt>@:</tt> and further repeats can be done with <tt>@@</tt>
+
The last command entered with ':' can be repeated with <code>@:</code> and further repeats can be done with <code>@@</code>
   
This is useful for commands like <tt>:bnext</tt> or <tt>:cNext</tt>.
+
This is useful for commands like <code>:bnext</code> or <code>:cNext</code>.
   
 
==Comments==
 
==Comments==
Line 45: Line 44:
 
</pre>
 
</pre>
 
key since you don't have to move your fingers out of home rows in the keyboard.
 
key since you don't have to move your fingers out of home rows in the keyboard.
  +
  +
=== Merge tip? ===
  +
I think it would make sense to merge this tip with [[Repeating a substitute from current cursor position]] or [[Repeat last change]]. --[[User:Anthony Geoghegan|Anthony Geoghegan]] ([[User talk:Anthony Geoghegan|talk]]) 11:02, August 19, 2015 (UTC)
  +
:Yes, that looks desirable. Unless there is reason to do otherwise, we merge to the lowest tip number because it was the first. That's tip 44 [[Repeat last change]], and any useful content should be copied to there with an edit summary saying where it came from (preferably a link to the source tip). Then the other two pages can be made into redirects and I will fix any navigation issues...eventually. [[User:JohnBeckett|JohnBeckett]] ([[User talk:JohnBeckett|talk]]) 10:25, August 20, 2015 (UTC)

Revision as of 10:25, 20 August 2015

Tip 990 Printable Monobook Previous Next

created 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 scroll 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

Using

q:k<CR>

is somehow better than

:<Up><CR>

key since you don't have to move your fingers out of home rows in the keyboard.

Merge tip?

I think it would make sense to merge this tip with Repeating a substitute from current cursor position or Repeat last change. --Anthony Geoghegan (talk) 11:02, August 19, 2015 (UTC)

Yes, that looks desirable. Unless there is reason to do otherwise, we merge to the lowest tip number because it was the first. That's tip 44 Repeat last change, and any useful content should be copied to there with an edit summary saying where it came from (preferably a link to the source tip). Then the other two pages can be made into redirects and I will fix any navigation issues...eventually. JohnBeckett (talk) 10:25, August 20, 2015 (UTC)