6 ms·
> Let’s say you’re using vim to edit code on a remote computer using ssh, and you want to open a new terminal tab to start a development server. vim 8 has a bu
by majewsky 9y ago
> Let’s say you’re using vim to edit code on a remote computer using ssh, and you want to open a new terminal tab to start a development server.
vim 8 has a built-in terminal.
:terminal ./start-development-server.sh --port 8080
will open a new buffer in a split window that executes the given command line. And it even supports all the regular vim keybindings.
:help terminal.txt
for details.
- oblio 9y agoSomewhat off topic: the wonders of competition, at work! :)
- closed 9y agoThanks for sharing this! Vim is the kind of tool I use all the time, but never check for new features. Will definitely use :terminal all the time now :). (For anyone interested, it looks like only more recent releases of vim 8 have :terminal.)
- majewsky 9y agoYes, it was added only recently after Neovim showed the idea of terminal buffers to be feasible. So it may not be available on $random_rhel6_server, but since the article described the scenario of a development server, I figured that package versions on there should be fairly recent.
- llimllib 9y agoI've stopped using tmux locally because vim terminals are so darned convenient
- bch 9y agonvi (default vi on (I believe) Net (and therefore Minix), Free, and OpenBSD) supports what sounds similar via “:script”. You have to split your window (or fg/bg the buffer) manually, though.