numToStr/Navigator.nvim

github github
tmux
star 182
stars
alert-circle 2
open issues
users 3
subscribers
git-branch 6
forks
CREATED

2021-04-03

UPDATED

5 months ago


Navigator

🚀 Installation

Neovim

use {
    'numToStr/Navigator.nvim',
    config = function()
        require('Navigator').setup()
    end
}
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