890

I keep seeing the recording message at the bottom of my gVim 7.2 window.

What is it and how do I turn it off?

3
  • 70
    To turn off vim recording for good, add map q <Nop> to your .vimrc file.
    – Joey Adams
    Aug 17, 2010 at 16:26
  • 8
    I can't believe you want to turn recording off! I would show a really annoying popup 'Are you sure?' if one asks to turn it off (or probably would like to give options like the Windows 10 update gives).
    – 0xc0de
    Aug 12, 2016 at 9:04
  • 2
    Related: How do I exit the Vim editor? May 18, 2020 at 1:40

6 Answers 6

1260

You start recording by q<letter> and you can end it by typing q again.

Recording is a really useful feature of Vim.

It records everything you type. You can then replay it simply by typing @<letter>. Record search, movement, replacement...

One of the best feature of Vim IMHO.

13
  • 125
    As seen other places, it's q followed by a register. A really cool (and possibly non-intuitive) part of this is that these are the same registers used by things like delete, yank, and put. This means that you can yank text from the editor into a register, then execute it as a command.
    – Cascabel
    Oct 6, 2009 at 20:13
  • 79
    One more thing to note is you can hit any number before the @ to replay the recording that many times like (100@<letter>) will play your actions 100 times
    – Tolga E
    Aug 17, 2013 at 3:07
  • 7
    You could add it afterward, by editing the register with put/yank. But I don't know why you'd want to turn recording on or off as part of a macro. ('q' doesn't affect anything when typed in insert mode.)
    – anisoptera
    Dec 4, 2014 at 9:43
  • 28
    and how to turn off was also the question
    – n611x007
    Oct 4, 2015 at 7:11
  • 13
    Cool but wrong key, i can't recall how many billion time i want to :q to quit and it go to recording. It happen because i type q too fast and then try to redo :q and it go to recording.
    – 林果皞
    Apr 12, 2016 at 7:25
112

Type :h recording to learn more.

                           *q* *recording*
q{0-9a-zA-Z"}           Record typed characters into register {0-9a-zA-Z"}
                        (uppercase to append).  The 'q' command is disabled
                        while executing a register, and it doesn't work inside
                        a mapping.  {Vi: no recording}

q                       Stops recording.  (Implementation note: The 'q' that
                        stops recording is not stored in the register, unless
                        it was the result of a mapping)  {Vi: no recording}


                                                        *@*
@{0-9a-z".=*}           Execute the contents of register {0-9a-z".=*} [count]
                        times.  Note that register '%' (name of the current
                        file) and '#' (name of the alternate file) cannot be
                        used.  For "@=" you are prompted to enter an
                        expression.  The result of the expression is then
                        executed.  See also |@:|.  {Vi: only named registers}
0
59

Typing q starts macro recording, and the recording stops when the user hits q again.

As Joey Adams mentioned, to disable recording, add the following line to .vimrc in your home directory:

map q <Nop>
1
  • 17
    only answer about "how to turn off" part of the question. Well, it makes recording inaccessible, effectively turning it off - at least noone expects vi to have a separate thread for this code, I guess, including me.
    – n611x007
    Oct 4, 2015 at 7:16
43

It sounds like you have macro recording turned on. To shut it off, press q.

Refer to ":help recording" for further information.

Related links:

28

As others have said, it's macro recording, and you turn it off with q. Here's a nice article about how-to and why it's useful.

27

It means you're in "record macro" mode. This mode is entered by typing q followed by a register name, and can be exited by typing q again.

2
  • It's actually entered by typing q followed by any register name, which is 0-9, a-z, A-Z, and ".
    – ephemient
    Oct 6, 2009 at 20:08
  • 4
    Actually, it's q{0-9a-zA-Z"} - you can record a macro into any register (named by digit, letter, "). In case you actually want to use it... you execute the contents of a register with @<register>. See :help q and :help @ if you're interested in using it.
    – Cascabel
    Oct 6, 2009 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.