I usually work in vim with two panes split vertically with NERDTree being on left. I run external commands with :!
and ESC
out when the command is completed. Sometimes I want to run the same command again so I have to do :<up arrow>enter
To avoid this, I want to know if there is a way to have a horizontal pane at the bottom of the page that shows the last 5 external commands. In addition, it would be awesome if I can, for example, run the last 4th
command by simply doing :!4
or something similar.
I'm sure you know about:
@:
- repeat last command
q:
- list of commands from history, you can edit and run them.
To run Nth last command from history use this:
command! -nargs=1 H call histdel("cmd", -1) | execute histget("cmd", 0-<args>)
:H 4
- last 4th command
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.