Home

Awesome

Primary Terminal

Simple terminal management for Neovim.

Why another terminal manager?

I wanted something very minimal, that only took control of a single :terminal instance at a time; this served my use case well.

I prefer the flyweight simplicity of that approach, since 90% of the time I only want to interact with the same terminal instance.

If I do need another one, it's easy enough to create another un-managed :terminal, or a process-specific :e term://my-command.

Installation

If you're using a plugin manager, follow the instructions in their documentation.

For example, if you're using Packer, you would add the following to your configuration:

use 'bronzehedwick/vim-primary-terminal'

Otherwise, use native package support by cloning vim-primary-terminal to packpath.

git clone https://github.com/bronzehedwick/vim-primary-terminal \
    ${XDG_DATA_HOME:-$HOME/.local/share}/nvim/site/pack/plugins/start/vim-primary-terminal

Commands

vim-primary-terminal provides the following commands:

Key mappings

vim-primary-terminal provides the following <Plug> mappings:

Using <Plug> allows you to customize if and what key sequences to map to.

However, if you don't have a preference, add the following mappings to your init.vim:

nmap <unique> <silent> <leader>t <Plug>(PrimaryTerminalOpen)
nmap <unique> <silent> <leader>r <Plug>(PrimaryTerminalOpenSplit)
nmap <unique> <silent> <leader>y <Plug>(PrimaryTerminalOpenVsplit)
nmap <unique> <silent> <leader>d <Plug>(PrimaryTerminalOpenDynamic)

See :help primary-terminal for more.

Similar projects

License

Copyright © 2019–2022 Chris DeLuca

Licensed under the same terms as Vim itself.