vim :: recording
many times i accidently q and got the annoying “recording” message at the bottom. Some times even made crazy to quit out of vim.
So what is this recording thing in vim…
It actually records your keystrokes, and you can execute them later.
How to use it ?
In normal mode ( normal = !insert && !visual ), press q and an identifier for your recording (another key). This would start recording your keystrokes and the message “recording” will appear at the bottom of the screen. And to end the recording press q (in normal mode).
Summary -
qx -> start recording (in buffer x) . (in normal mode)
do any work
q -> stop recording, (in normal mode)
Example -
to add <html><body> at top and </body></html> at bottom of a page you can record keystrokes like this
qm1<Shift+g><Home><Insert><html><body><Esc>
<Shift+g><End><Insert><Right></body></head><Esc>q
Example Explained -
qm -> start recording ( to register m)
1<Shift-g><Home> -> go to start of the page
<Insert><html><body><Esc> -> enter insert mode and write <html><body>
<Shift-g><End> -> go to end of the page
<Insert></body></html><Esc> -> enter insert mode and write <html><body>
q -> stop recording
How to use the recorded keystrokes ?
@ and the keyword corresponding to your recording (in normal mode)
for example to use the above macro, we will type @m (see qm => record into register m)
Sometimes another annoying window open, when we accidently type q: (instead of :q, maybe)
It is commandline window. to quit out of it simply press enter or type :q (it wont quit the orignial buffer)
NB:
These recordings are not intelligent. They are just keystrokes recorded, and will be executed as such. You have to make your keystrokes intelligent.
My doubt : Reference -
:help q
:help q:
vim.org/Tip #144: recording keystrokes by “q” for repested jobs
is there any difference between this recording and macros ( in general and in vim) ?
References -
:help q
:help q:
vim.org/Tip #144: recording keystrokes by “q” for repested jobs
* Advanced Vim Tutorial - other strong features of vim.






June 4th, 2005 at 8:16 pm
Thanks from a new Vim user
Thanks, I am a new Vim user and I turned on the annoying recording mode accidentally. Not only did you help me to turn it off, I also learned that Vim has another feature I’ve been looking for in a text editor: the ability to record “macros” for frequently repeated actions.
Can these recorded actions be repeated in a seperate files and on seperate occasions, or do they die when Vim is killed?
December 27th, 2006 at 7:35 am
Thanks
Thanks
You have explained the recording feature in very lucid terms.
February 12th, 2007 at 12:57 pm
Nice tip
It feels good to know what that annoying recording message really meant. Amen!!
March 8th, 2007 at 9:48 am
Good tip. I found it useful.
February 13th, 2008 at 12:20 am
Thanks for the great info, many times I have quit vim not knowing what to do.
March 17th, 2008 at 6:45 pm
Thank you for the help. Some how went in to recording and then I didn’t know what to do. This helped.
March 27th, 2008 at 5:54 pm
Thanks!!
This has been annoying me for quite a while, sometimes I’m way too quick when typing and accidentally end up in the evil “recording” state.
June 5th, 2008 at 11:09 pm
Thanks a bunch. Jeez, I’ve been bothered by this for so long. Now that I know what it is, it actually seems like something I’ll use. Thanks
November 15th, 2008 at 1:04 am
very nice ^–^ THX a loooot
January 20th, 2009 at 6:26 am
Thank you. That notice was becoming bothersome.
February 10th, 2009 at 2:52 pm
Just found myself in the same annoying situation of having to deal with the haunting “recording” message out of no where.
Thanks a lot!