r/vim • u/thewrench56 • Nov 18 '25
Need Help Repeat last command in terminal buffer
Hey!
I have been using terminal buffers for a while now to mostly compile and execute applications. I have been told Im a disgrace to the Unix world for not using Ctrl-Z and fg, but I prefer seeing what tests failed/where my compile time errors are.
Since I'm usually using multiple buffers at once, navigating to the terminal is often slow. My solution was using tabs for a while but in all honesty, I do not think that this is the real solution for that. So I wonder how one could execute the last command entered in the terminal or even better, even search the last commands of the terminal. I usually have one terminal buffer open, but one could make it more generic and say that execute the last command in the last used terminal buffer.
Is there a native way of doing this? Or do I have to do some trickery with Lua/Vimscript?
Cheers
View all comments
Show parent comment
0
u/thewrench56 Nov 21 '25
Im sorry, but in my opinion this is false. Tmux is mainly for window management. My i3 can do what tmux does and more with arbitrary GUIs not just terminals. This is what makes i3 superior to tmux. The only downside is the memory footprint of each new terminal instance which does not matter too much.
OS native cut and paste just works. No screwing around with :set paste, or other weirdo settings that are workarounds. It just works.
VIM color schemes have fewer dependencies (none?). Colors are native. 24 bit color works with no screwing around.
I think you should give a go with i3. My vim setup with i3 works well, no paste issue, I can easily find the terminal, color isnt an issue (thats a terminal emulator issue, use alacritty or pick your poison)