0

Recently I had to compile a latex file a few times, :!pdflatex filename.tex did the trick. But is there a way in normal mode to repeat commands like these which are in the recent history,but used repeatedly for a short time.

Setting keybinding to for :command is not what I am looking for, since the command is used only for a short time.

2
  • 3
    See :help @:. Is that what you mean?
    – Ralf
    Mar 13, 2019 at 20:23
  • Yes, thats what I was looking for. I did'nt know that these special registers existed for recording also.
    – GGJON
    Mar 14, 2019 at 7:25

1 Answer 1

2

As Ralf mentions in the comments, the : register always contains the last colon command.

So, @: will replay the last command, and @@ should work after that.

In addition, you can :<Up> for command line history, or use q: for the command line window.

1
  • 1
    Also: If you enter :!p<Up> it will only fetch commands from the history, that begin with !p.
    – Ralf
    Mar 14, 2019 at 8:18

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.