Navigator.nvim
Navigator.nvim copied to clipboard
:sparkles: Smoothly navigate between neovim and terminal multiplexer(s) :sparkles:
Navigator.nvim
✨ Smoothly navigate between splits and panes ✨
🚀 Installation
Neovim
- With packer.nvim
use {
'numToStr/Navigator.nvim',
config = function()
require('Navigator').setup()
end
}
- With vim-plug
Plug 'numToStr/Navigator.nvim'
" Somewhere after plug#end()
lua require('Navigator').setup()
Tmux
This plugin doesn't provides any configuration for tmux
. You can read here to how to setup your tmux.
Or, you can use tmux-tilish which is an excellent tmux plugin.
⚒️ Setup
-- Configuration
require('Navigator').setup()
-- Keybindings
vim.keymap.set('n', "<A-h>", '<CMD>NavigatorLeft<CR>')
vim.keymap.set('n', "<A-l>", '<CMD>NavigatorRight<CR>')
vim.keymap.set('n', "<A-k>", '<CMD>NavigatorUp<CR>')
vim.keymap.set('n', "<A-j>", '<CMD>NavigatorDown<CR>')
vim.keymap.set('n', "<A-p>", '<CMD>NavigatorPrevious<CR>')
Configuration (optional)
Following options can be given when calling setup({config})
. Below is the default configuration
{
-- When you want to save the modified buffers when moving to tmux
-- nil - Don't save (default)
-- 'current' - Only save the current modified buffer
-- 'all' - Save all the buffers
auto_save = nil,
-- Disable navigation when tmux is zoomed in
disable_on_zoom = false
}
🔥 Usage
Commands
-
NavigatorLeft
- Go to left split/pane -
NavigatorRight
- Go to right split/pane -
NavigatorUp
- Go to upper split/pane -
NavigatorDown
- Go to down split/pane -
NavigatorPrevious
- Go to previous split/pane
Lua API
require('Navigator').left()
require('Navigator').right()
require('Navigator').up()
require('Navigator').down()
require('Navigator').previous()
💐 Credits
- vim-tmux-navigator - Motivator and Vimscript cousin