Hacker News new | ask | show | jobs
by patricius 1902 days ago
Vim's :term command has become my go-to way to open up a terminal nowadays. It gives you nice terminal emulation, but also lets you stay in Vim and use all the Vim keyboard mappings. When a terminal window has focus, you can go into Normal mode with `Ctrl+W N`, which will let you search and yank stuff like you're used to.
1 comments

TIL `:term`. I've been using vim/tmux (and before that, vim/screen) for nearly 30 years. I never knew about `:term` before that, thanks for posting.

PS: And when the terminal session exits, the history is still a vim buffer - that's awesome!

Even more awesome: vim-repl (https://github.com/sillybun/vim-repl) uses the :term feature to provide convenient communication with any REPL, with extra support for some languages such as Python.

(In fact there are a host of these; for example, vim-slime now can communicate with Vim’s built-in terminal.)

it hasn't been in Vim very long, added in 8.1 ~3 years

https://www.vim.org/vim-8.1-released.php