Support For Hide-able NeoVim :terminal
Buffers
Status: experimental
- Start a new shell terminal
:Term
- Switch back to some other buffer, maybe closing the terminal window first, for example:
<C-\><C-n>
to return to normal mode<C-w>c
to close the terminal window- NOTE this does not kill the running terminal, it continues in the background, and can be seen in the buffer list
- Return to the running shell terminal with
:Term
- NOTE if there is a window already showing the terminal, than it is focused in insert mode instead of switching the current window
May use the :TermSplit
or :TermVSplit
commands to work in a split, instead
of changing the current window. Similarly :TermHUD
creates a fixed-height
bottom window. Like :Term
these commands focus any existing window if
possible, rather than creating a new split window.
You may also specify a different shell to run as in:
:Term zsh
:Term powershell.exe
:Term python
NOTE any interactive terminal REPL should work
You may specify a different default shell in $MYVIMRC
by setting g:termhide_default_shell
:
let g:termhide_default_shell = 'powershell.exe'
Otherwise the default shell
is used (see :help 'shell'
). Be careful when
changing this, as it may break other plugins that make assumptions about the
default shell
on Windows or Unix.
Easy HUD toggle:
nnoremap <leader>` :TermHUD<cr>
tnoremap <leader>` <C-\><C-n><C-w>c
Easily switch to a terminal:
nnoremap <leader>$ :Term<cr>
And easier exits from a terminal:
" Back to wherever we were before this terminal
tnoremap <C-\><C-o> <C-\><C-n><C-o>
" Close terminal window, e.g. when it was in a new split
tnoremap <C-\><C-c> <C-\><C-n><C-w>c
A :Ghud
command is also provided to easily open fugitive's :Gstatus
buffer
in a fixed hud window at the bottom.
neovim-termhide follows the standard runtime path structure. Install with something like vim-plug:
Plug 'jcorbin/neovim-termhide'
- improve the HUD mode
- change default modality of the
:Term
command? or instead provide a a higher level<plug>(term)
entry point - floating window mode?