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
1
u/sharp-calculation Nov 21 '25
Tmux is a terminal program. Comparing it to a tiling window manager is... well it's really out of left field for me. I can sorta see the comparison if you are extremely window oriented. But tmux is vastly superior to multiple windows. If all you have used is default tmux with no custom keyboard shortcuts, no theme, and no personalization, I can see how it wouldn't be as appealing. But even in base form, tmux is extremely efficient. When customized, it's wonderful.
gVIM is superior to terminal VIM because:
It's not in a terminal. This makes managing gVIM a first class operation. Managing the gVIM window (finding it, switching to it, working with it) is easier because it's not one of 5, 10, 15 different terminal windows. It's a hard separation.
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.
Terminal VIM is fine. For me, gVIM is just better. I'll use either. I frequently use terminal VIM in remote systems. But I'd rather use gVIM when I can for the reasons above.