Hacker News new | ask | show | jobs
by leephillips 1857 days ago
Vim (recent versions) + the `term` command. All shells and REPLs as Vim buffers, also run any command asynchronously. Paired with the `sendtowindow` plugin, can have two-way communication between any REPL and any other buffer.
1 comments

If you have good resources on this, please share.
There’s not much to say about it, as it does basically one thing, but that thing is powerful. It was added to Vim in v.8. Just type `:term bash` to get a buffer with a bash shell running in it. Or type `:term <command>` to run a command async and see the output in another buffer. Once you have bash, or another interactive prompt with a command like `:term julia`, then, if you have the sendtowindow plugin installed, you can select any text in visual mode and send it to the REPL with the shortcut that you define. You can send in any direction, so you can arrange your buffers as you like. You can switch to the REPL and send output back into your editing buffer. There are many other plugins with similar functionality, but I like sendtowindow because of its simplicity and generality.