TLDR
- Vim 8.1 introduced terminal mode,
:terminal
:terminal
allows you to open terminals inside Vim, hence the potential to be as productive as being in a Tmux session- You probably don't need it if you are already using Tmux
How is This Helpful?
In Vim, prior to this, we can only access the shell through either typing :!
, to and back from shell with hitting CTRL + Z
then using $ fg
, or Tmux.
Now, with the new ternimal mode, combining tabs, we can work wonders with just Vim! In cover photo, I have
- One tab with a file I am edting, a test watcher, and a terminal for working in Git
- The other tab with some other file in another area of the code base
Use Case
- Checking Git log
- Running a server or some services
- Watching files
- Pretty much anything you would otherwise do with
CTRL + Z
for :)
Getting Started
My Setup
Working with Terminal Mode
- With the setup, you can open a terminal with
<leader> + t
- Move among the panes with
CTRL + w + h/j/k/l
- Go to terminal Normal mode with
CTRL + w + N
to copy the text; - Hit
i
to go back to terminal mode - Use Vim's Ex command in terminal pane with
CTRL + w + :
- From there, type command
:term
to open another terminal pane below the current pane
References
-
:h terminal
-
Vim 8.1 Release Note on vim.org/