Questions tagged [repeated-commands]
Questions about replaying the same command. This includes the dot command (.), @ macros, @: and similar methods.
12
questions with no upvoted or accepted answers
4
votes
0
answers
54
views
Vim: is there a way to persist the last edit?
When you make a change, like ifooESC to insert the text foo, this can, of course, be repeated using ..
However, if you quit Vim, in spite of Vim saving all sorts of state, including the contents of ...
3
votes
0
answers
436
views
How to repeat last mapping/action?
I know that I can repeat last change with ., last command with @: and last motion with repmo plugin. What about other actions such as switching to the previous/next tab (gT/gt)? Is there a command for ...
2
votes
0
answers
265
views
What happens when error occurs during cdo?
:h :cdo says:
When an error is detected execution stops.
The last buffer (or where an error occurred) becomes
the current buffer.
Let's see what really happens:
...
2
votes
0
answers
44
views
make u (undo) also reset . (repeat last command)?
Sometimes I make a change, then in my scramble to move to somewhere else that I want to repeat the change, I accidentally make some edit (e.g. ill).
I would normally undo the accidental edit with u, ...
1
vote
0
answers
36
views
How to do a motion without leaving history (in .)?
Often, you do a complicated motion, which you want to repeat soon by pressing . but carry out a simpler motion overwrites that one. Can I keep that complicated motion in . itself ?
Concrete example:
...
1
vote
0
answers
31
views
How can I repeat a custom function mapped using `vnoremap` using something similar to the dot (`.`) operator?
I have this custom function in my ~/.vimrc mapped to Visual mode using vnoremap.
After having executed the function using <leader><space>, how execute it again using something similar to ...
1
vote
0
answers
45
views
Save & recall favourite vim :commands
I often find myself using the up arrow at the vim command prompt :
Is there a way to 'favourite' some? Or at least an easy way to search through previous commands?
For example, I couldn't remember ...
1
vote
0
answers
135
views
Repeat <Leader> mapping without having to press/release full combination
Similar to this question, I want to be able to resize my splits in a repeatable manner, but without having to use a plugin. I currently use the mapping:
nnoremap <Leader>q <C-w>10<
...
1
vote
0
answers
126
views
Repeat Emmet commands in vim with dot operator
Is there a way i can repeat an emmet command in vim. Below is the sample text file
<h1>Hello World</h1>
<h1>Hello World</h1>
So i use emmet to wrap the the first line inside ...
1
vote
0
answers
96
views
Macros behaving unexpectedly (not executing commands)
I have the following macro
let @f='ivoid function (void param^[o {^M^M^[3kwi'
where ^[ represents ESC and ^M new line.
for some reason it does not execute anything after the 3k, I tried replacing ...
0
votes
0
answers
83
views
Is there a modification to make the dot command work intuitively in visual mode?
This is a repeat of a question that I asked on the Vim subreddit but didn't receive a helpful answer for. I think that this should be do-able, but I'm not good enough at Vimscript or Lua yet to ...
0
votes
0
answers
99
views
Find out last used text object
I'm trying to figure out a way to make a repeatable operator insert. To do so I'm trying to make use of tpope/repeat. My idea is to set a repeatable call that repeats the last operation, repeating the ...