/nvimux-navigator

A Nvim plugin to seamlessly navigate between Nvim and tmux

Primary LanguagePythonMIT LicenseMIT

Nvimux-Navigator

This plugin enables you to navigate navigate seamlessly between nvim and tmux. It is greatly inspired by Chris Tommey's vim-tmux-navigator.

Installation

Requirements

Nvimux requires that you have Neovim with Python3 support and libtmux:

pip install pynvim
pip install libtmux

Installation

You can then install it like your others Nvim plugins and run :UpdateRemotePlugins. You should restart Nvim after that.

Tmux

Please check Chris Tommey's vim-tmux-navigator and add his tmux snippet in your .tmux.conf

Usage

Functions

You can map the NvimuxNavigate(arg) function to your preferred keys, it works with or without tmux. The arg can be h, j, k, or l respectively for left, down, up and right.

Commands

Use these commands to manipulate your tmux panes directly from Nvim

Command Action
NvimuxLinkPane (pane_id) pane_id: Specify the pane you'd like to link Nvim with. Must be under the format: %n.
NvimuxOpenPane
[-a|-t target]
[-v|-d dir]
  • -a: attach to the new opened pane
  • -t target: specify the target from which to create the new pane
  • -v: open the new pane vertically
  • -d dir: open the pane in the dir directory
NvimuxOpenAndLink
[-a|-t target]
[-v|-d dir]
The arguments are the same as for NvimuxOpenPane, only it links the newly opened pane to Nvim.
NvimuxSendCommand (cmd) Send the cmd command to the linked pane. If no pane is linked an error is returned.
NvimuxSendKeys [-e|-l] (keys) Send the keys to the tmux linked pane as they are written. If no pane is linked an error is returned.
  • -e: The enter key will not be pressed after the keys
  • -l: The keys will not be send literally

Contributing

Please feel free to open an issue if you think of an improvement or find a bug. Any help is appreciated.