Seamless navigation and resizing between tmux panes and Neovim splits using the same keybindings. A plugin designed to enhance the tmux + Neovim workflow.
- Navigate between Neovim splits and tmux panes with
<C-h>,<C-j>,<C-k>,<C-l> - Resize Neovim windows and tmux panes with
<M-h>,<M-j>,<M-k>,<M-l>(optional) - Works in all modes (normal, insert, visual, select)
- Intelligent edge detection - automatically switches to tmux pane when at window edge
- Fully configurable keybindings and modes
Using lazy.nvim:
{
"Huijiro/tmux-nav.nvim",
config = function()
require("tmux-nav").setup()
end
}Default configuration:
require("tmux-nav").setup({
switch_window = {
enabled = true,
modes = { "n", "i", "v", "x", "s" },
keybinds = {
{ "<c-h>", "h" },
{ "<c-j>", "j" },
{ "<c-k>", "k" },
{ "<c-l>", "l" },
},
},
resize = {
enabled = false, -- Set to true to enable resizing
modes = { "n" },
amount = 2,
keybinds = {
{ "<m-h>", "h" },
{ "<m-j>", "j" },
{ "<m-k>", "k" },
{ "<m-l>", "l" },
},
},
})require("tmux-nav").setup({
switch_window = {
keybinds = {
{ "<leader>h", "h" },
{ "<leader>j", "j" },
{ "<leader>k", "k" },
{ "<leader>l", "l" },
},
},
resize = {
enabled = true,
amount = 5,
},
})require("tmux-nav").setup({
switch_window = {
enabled = false,
},
})- Neovim >= 0.7
- tmux