NVIM LUAU

Awesome plugins for Neovim

GitHubAdd Plugin

    Tabline

  • akinsho/bufferline.nvim
    944

    A snazzy bufferline for Neovim

  • crispgm/nvim-tabline
    19

    nvim port of tabline.vim with Lua

  • koenverburg/minimal-tabline.nvim
    2

    A minimal tabline, that's it

  • nanozuki/tabby.nvim
    381

    A declarative, highly configurable, and neovim style tabline plugin. Use your nvim tabs as a workspace multiplexer!

  • noib3/nvim-cokeline
    169

    :nose: A Neovim bufferline for people with addictive personalities

  • romgrk/barbar.nvim
    899

    The neovim tabline plugin.

  • Status Line

  • alvarosevilla95/luatab.nvim
    109

    Tabline lua plugin for neovim

  • b0o/incline.nvim
    105

    ๐ŸŽˆ Floating statuslines for Neovim

  • datwaft/bubbly.nvim
    167

    Bubbly statusline for neovim

  • feline-nvim/feline.nvim
    564

    A minimal, stylish and customizable statusline for Neovim written in Lua

  • konapun/vacuumline.nvim
    17

    A prebuilt configuration for galaxyline inspired by airline

  • NTBBloodbath/galaxyline.nvim
    118

    neovim statusline plugin written in lua

  • nvim-lualine/lualine.nvim
    1434

    A blazing fast and easy to configure neovim statusline plugin written in pure lua.

  • rebelot/heirline.nvim
    208

    Heirline.nvim is a no-nonsense Neovim Statusline plugin designed around recursive inheritance to be exceptionally fast and versatile.

  • tamton-aquib/staline.nvim
    138

    A modern lightweight statusline and bufferline for neovim in lua. Mainly uses unicode symbols for showing info.

  • windwp/windline.nvim
    280

    Animation statusline, floating window statusline. Use lua + luv make some wind

  • Keybinding

  • b0o/mapx.nvim
    141

    ๐Ÿ—บ A better way to create key mappings in Neovim.

  • folke/which-key.nvim
    1189

    ๐Ÿ’ฅ Create key bindings that stick. WhichKey is a lua plugin for Neovim 0.5 that displays a popup with possible keybindings of the command you started typing.

  • mrjones2014/legendary.nvim
    210

    ๐Ÿ—บ๏ธ A legend for your keymaps, commands, and autocmds, with which-key.nvim integration (requires Neovim nightly)

  • simrat39/rust-tools.nvim
    684

    Tools for better development in rust using neovim's builtin lsp

  • LSP

  • b0o/SchemaStore.nvim
    159

    ๐Ÿ› JSON schemas for Neovim

  • folke/trouble.nvim
    1388

    ๐Ÿšฆ A pretty diagnostics, references, telescope results, quickfix and location list to help you solve all the trouble your code is causing.

  • jose-elias-alvarez/nvim-lsp-ts-utils
    373

    Utilities to improve the TypeScript development experience for Neovim's built-in LSP client.

  • neovim/nvim-lspconfig
    3936

    Quickstart configurations for the Nvim LSP client

  • nvim-lua/lsp_extensions.nvim
    193

    Repo to hold a bunch of info & extension callbacks for built-in LSP. Use at your own risk :wink:

  • nvim-lua/lsp-status.nvim
    426

    Utility functions for getting diagnostic status and progress messages from LSP servers, for use in the Neovim statusline

  • ray-x/navigator.lua
    572

    Navigate codes like a breeze๐ŸŽ. Exploring LSP and ๐ŸŒฒTreesitter symbols a piece of ๐Ÿฐ. Take control like a boss ๐Ÿฆ.

  • williamboman/nvim-lsp-installer
    1157

    Neovim plugin that allows you to seamlessly manage LSP servers with :LspInstall. With full Windows support!

  • Guides

  • bennypowers/nvim-regexplainer
    183

    Describe the regexp under the cursor

  • nvim-lua/kickstart.nvim
    2356

    A launch point for your personal nvim configuration

  • Colorschemes

  • catppuccin/nvim
    546

    ๐Ÿจ Soothing pastel theme for NeoVim

  • dharmx/nvim-colo
    26

    Theming utlilities for neovim. This is very experimental at the moment.

  • ful1e5/onedark.nvim
    174

    Atom's iconic One Dark theme for Neovim, written in Lua

  • HUAHUAI23/nvim-quietlight
    0

    A theme for Neovim with support for LSP, Treesitter, and more.

  • kvrohit/substrata.nvim
    56

    A cold, dark color scheme for Neovim

  • lalitmee/cobalt2.nvim
    7

    cobalt2 theme for neovim in Lua using colorbuddy

  • luisiacc/gruvbox-baby
    42

    Gruvbox theme for neovim with full ๐ŸŽ„TreeSitter support.

  • mhartington/oceanic-next
    986

    Oceanic Next theme for neovim

  • Mofiqul/adwaita.nvim
    38

    Neovim colorscheme using Gnome Adwaita syntax

  • Mofiqul/dracula.nvim
    123

    Dracula colorscheme for neovim written in Lua

  • mrjones2014/lighthaus.nvim
    40

    A Lua implementation of lighthaus-theme/vim-lighthaus

  • navarasu/onedark.nvim
    270

    One dark and light colorscheme for neovim >= 0.5.0 written in lua based on Atom's One Dark and Light theme. Additionally, it comes with 5 color variant styles

  • NTBBloodbath/doom-one.nvim
    74

    doom-emacs' doom-one Lua port for Neovim

  • rebelot/kanagawa.nvim
    738

    NeoVim dark colorscheme inspired by the colors of the famous painting by Katsushika Hokusai.

  • rose-pine/neovim
    310

    Soho vibes for Neovim

  • RRethy/nvim-base16
    301

    Neovim plugin for building a sync base16 colorscheme. Includes support for Treesitter and LSP highlight groups.

  • sunjon/Shade.nvim
    374

    An Nvim lua plugin that dims your inactive windows

  • themercorp/themer.lua
    130

    A simple, minimal highlighter plugin for neovim

  • zanglg/nova.nvim
    82

    Another color scheme for neovim written in lua, WIP

  • Comment

  • danymat/neogen
    373

    A better annotation generator. Supports multiple languages and annotation conventions.

  • Utility

  • echasnovski/mini.nvim
    405

    Neovim plugin with collection of minimal, independent, and fast Lua modules dedicated to improve Neovim (version 0.5 and higher) experience

  • hood/popui.nvim
    42

    NeoVim UI sweetness powered by popfix.

  • meznaric/conmenu
    21

  • mrjones2014/dash.nvim
    132

    ๐Ÿƒ๐Ÿ’จ Search Dash.app from your Neovim fuzzy finder. Built with Rust ๐Ÿฆ€ and Lua

  • Cursor Line

  • edluffy/specs.nvim
    233

    ๐Ÿ‘“ A fast and lightweight Neovim lua plugin to keep an eye on where your cursor has jumped.

  • mg979/vim-visual-multi
    2046

    Multiple cursors plugin for vim/neovim

  • Code Runner

  • FeiyouG/command_center.nvim
    57

    Create and manage keybindings and commands in a more organized manner, and search them quickly through Telescope

  • Extras

  • folke/zen-mode.nvim
    377

    ๐Ÿง˜ Distraction-free coding for Neovim

  • goolord/alpha-nvim
    322

    a lua powered greeter like vim-startify / dashboard-nvim

  • Start Up

  • henriquehbr/nvim-startup.lua
    45

    Displays neovim startup time

  • lewis6991/impatient.nvim
    563

    Improve startup time for Neovim

  • Session

  • HUAHUAI23/telescope-session.nvim
    12

    manage your vim session with telescope ๐Ÿ”ญ

  • Fuzzy Finder

  • ibhagwan/fzf-lua
    418

    Improved fzf.vim written in lua

  • nvim-telescope/telescope.nvim
    5023

    Find, Filter, Preview, Pick. All lua, all the time.

  • vijaymarupudi/nvim-fzf
    223

    A Lua API for using fzf in neovim.

  • Misc

  • iggredible/Learn-Vim
    9061

    Learning Vim and Vimscript doesn't have to be hard. This is the guide that you're looking for ๐Ÿ“–

  • m-demare/attempt.nvim
    53

    Manage temporary buffers

  • SmiteshP/nvim-gps
    348

    Simple statusline component that shows what scope you are working inside

  • windwp/nvim-autopairs
    1479

    autopairs for neovim written by lua

  • zegervdv/nrpattern.nvim
    43

    Neovim plugin to expand incrementing/decrementing to more formats.

  • Note Taking

  • jakewvincent/mkdnflow.nvim
    97

    Tools for markdown notebook navigation and management

  • nvim-neorg/neorg
    2078

    Modernity meets insane extensibility. The future of organizing your life in Neovim.

  • Motion

  • jinh0/eyeliner.nvim
    170

    ๐Ÿ‘€ Move faster with unique f/F indicators.

  • Terminal Integration

  • jlesquembre/nterm.nvim
    35

    neovim plugin to interact with the terminal

  • Scrolling

  • karb94/neoscroll.nvim
    765

    Smooth scrolling neovim plugin written in lua

  • Git

  • kdheepak/lazygit.nvim
    313

    Plugin for calling lazygit from within neovim.

  • zegervdv/settle.nvim
    0

    Settle your merge conflicts from Neovim

  • File Explorer

  • kevinhwang91/rnvimr
    451

    Make Ranger running in a floating window to communicate with Neovim via RPC

  • kyazdani42/nvim-tree.lua
    2040

    A file explorer tree for neovim written in lua

  • Snippets

  • L3MON4D3/LuaSnip
    692

    Snippet Engine for Neovim written in Lua.

  • Browser Integration

  • lalitmee/browse.nvim
    0

    browse for anything using your choice of method

  • Indent

  • lukas-reineke/indent-blankline.nvim
    1272

    Indent guides for Neovim

  • Formatting

  • lukas-reineke/lsp-format.nvim
    248

    A wrapper around Neovims native LSP formatting.

  • Syntax

  • m-demare/hlargs.nvim/
    30

    Highlight arguments' definitions and usages, using Treesitter

  • Splits and Window

  • mrjones2014/smart-splits.nvim
    83

    ๐Ÿง  Smart, directional Neovim split resizing and navigation. Think about resizing splits in terms of "move the divider to the left/right/up/down".

  • Completion

  • noib3/nvim-compleet
    413

    :zap: An async autocompletion framework for Neovim

  • zbirenbaum/copilot-cmp
    69

    Lua plugin to turn github copilot into a cmp source

  • zbirenbaum/copilot.lua
    100

    Lua plugin for starting and interacting with github copilot

  • Package Managers

  • NTBBloodbath/cheovim
    145

    Neovim configuration switcher written in Lua. Inspired by chemacs.

  • savq/paq-nvim
    408

    ๐ŸŒš Neovim package manager

  • wbthomason/packer.nvim
    2321

    A use-package inspired plugin manager for Neovim. Uses native packages, supports Luarocks dependencies, written in Lua, allows for expressive config

  • Game

  • ThePrimeagen/vim-be-good
    619

    vim-be-good is a nvim plugin designed to make you better at Vim Movements.

https://github.com/mrjones2014/smart-splits.nvim

๐Ÿง  smart-splits.nvim

๐Ÿง  Smarter and more intuitive split pane management that uses a mental model of left/right/up/down instead of wider/narrower/taller/shorter for resizing. Supports seamless navigation between Neovim and terminal multiplexer split panes. See Multiplexer Integrations.

demo

Table of Contents

  • Install
  • Configuration
    • Hooks
      • Examples:
  • Usage
    • Multiplexer Integrations
      • Tmux
      • Wezterm
      • Kitty
        • Credits
      • Multiplexer Lua API

Install

smart-splits.nvim now supports semantic versioning via git tags. See Releases for a full list of versions and their changelogs, starting from 1.0.0.

With Packer.nvim:

use('mrjones2014/smart-splits.nvim')
-- or use a specific version
use({ 'mrjones2014/smart-splits.nvim', tag = 'v1.0.0' })
-- to use Kitty multiplexer support, run the post install hook
use({ 'mrjones2014/smart-splits.nvim', run = './kitty/install-kittens.bash' })

With Lazy.nvim:

{ 'mrjones2014/smart-splits.nvim' }
-- or use a specific version, or a range of versions using lazy.nvim's version API
{ 'mrjones2014/smart-splits.nvim', version = '>=1.0.0' }
-- to use Kitty multiplexer support, run the post install hook
{ 'mrjones2014/smart-splits.nvim', build = './kitty/install-kittens.bash' }

Configuration

You can set ignored buftypes or filetypes which will be ignored when figuring out if your cursor is currently at an edge split for resizing. This is useful in order to ignore "sidebar" type buffers while resizing, such as nvim-tree.lua which tries to maintain its own width unless manually resized. Note that nothing is ignored when moving between splits, only when resizing.

Note smart-splits.nvim does not map any keys on it's own. See Usage.

Defaults are shown below:

require('smart-splits').setup({
  -- Ignored filetypes (only while resizing)
  ignored_filetypes = {
    'nofile',
    'quickfix',
    'prompt',
  },
  -- Ignored buffer types (only while resizing)
  ignored_buftypes = { 'NvimTree' },
  -- the default number of lines/columns to resize by at a time
  default_amount = 3,
  -- Desired behavior when your cursor is at an edge and you
  -- are moving towards that same edge:
  -- 'wrap' => Wrap to opposite side
  -- 'split' => Create a new split in the desired direction
  -- 'stop' => Do nothing
  -- function => You handle the behavior yourself
  -- NOTE: If using a function, the function will be called with
  -- a context object with the following fields:
  -- {
  --    mux = {
  --      type:'tmux'|'wezterm'|'kitty'
  --      current_pane_id():number,
  --      is_in_session(): boolean
  --      current_pane_is_zoomed():boolean,
  --      -- following methods return a boolean to indicate success or failure
  --      current_pane_at_edge(direction:'left'|'right'|'up'|'down'):boolean
  --      next_pane(direction:'left'|'right'|'up'|'down'):boolean
  --      resize_pane(direction:'left'|'right'|'up'|'down'):boolean
  --      split_pane(direction:'left'|'right'|'up'|'down',size:number|nil):boolean
  --    },
  --    direction = 'left'|'right'|'up'|'down',
  --    split(), -- utility function to split current Neovim pane in the current direction
  --    wrap(), -- utility function to wrap to opposite Neovim pane
  -- }
  -- NOTE: `at_edge = 'wrap'` is not supported on Kitty terminal
  -- multiplexer, as there is no way to determine layout via the CLI
  at_edge = 'wrap',
  -- when moving cursor between splits left or right,
  -- place the cursor on the same row of the *screen*
  -- regardless of line numbers. False by default.
  -- Can be overridden via function parameter, see Usage.
  move_cursor_same_row = false,
  -- whether the cursor should follow the buffer when swapping
  -- buffers by default; it can also be controlled by passing
  -- `{ move_cursor = true }` or `{ move_cursor = false }`
  -- when calling the Lua function.
  cursor_follows_swapped_bufs = false,
  -- resize mode options
  resize_mode = {
    -- key to exit persistent resize mode
    quit_key = '<ESC>',
    -- keys to use for moving in resize mode
    -- in order of left, down, up' right
    resize_keys = { 'h', 'j', 'k', 'l' },
    -- set to true to silence the notifications
    -- when entering/exiting persistent resize mode
    silent = false,
    -- must be functions, they will be executed when
    -- entering or exiting the resize mode
    hooks = {
      on_enter = nil,
      on_leave = nil,
    },
  },
  -- ignore these autocmd events (via :h eventignore) while processing
  -- smart-splits.nvim computations, which involve visiting different
  -- buffers and windows. These events will be ignored during processing,
  -- and un-ignored on completed. This only applies to resize events,
  -- not cursor movement events.
  ignored_events = {
    'BufEnter',
    'WinEnter',
  },
  -- enable or disable a multiplexer integration;
  -- automatically determined, unless explicitly disabled or set,
  -- by checking the $TERM_PROGRAM environment variable,
  -- and the $KITTY_LISTEN_ON environment variable for Kitty
  multiplexer_integration = nil,
  -- disable multiplexer navigation if current multiplexer pane is zoomed
  -- this functionality is only supported on tmux and Wezterm due to kitty
  -- not having a way to check if a pane is zoomed
  disable_multiplexer_nav_when_zoomed = true,
  -- Supply a Kitty remote control password if needed,
  -- or you can also set vim.g.smart_splits_kitty_password
  -- see https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.remote_control_password
  kitty_password = nil,
  -- default logging level, one of: 'trace'|'debug'|'info'|'warn'|'error'|'fatal'
  log_level = 'info',
})

Hooks

The hook table allows you to define callbacks for the on_enter and on_leave events of the resize mode.

Examples

Integration with bufresize.nvim:

require('smart-splits').setup({
  resize_mode = {
    hooks = {
      on_leave = require('bufresize').register,
    },
  },
})

Custom messages when using resize mode:

require('smart-splits').setup({
  resize_mode = {
    silent = true,
    hooks = {
      on_enter = function()
        vim.notify('Entering resize mode')
      end,
      on_leave = function()
        vim.notify('Exiting resize mode, bye')
      end,
    },
  },
})

Usage

Key Mappings

If you are a legendary.nvim (>= v2.10.0) user, you can quickly easily and easily create with the legendary.nvim extension for smart-splits.nvim. See more option in the extension documentation in legendary.nvim.

require('legendary').setup({
  extensions = {
    -- to use default settings:
    smart_splits = {},
    -- default settings shown below:
    smart_splits = {
      directions = { 'h', 'j', 'k', 'l' },
      mods = {
        -- for moving cursor between windows
        move = '<C>',
        -- for resizing windows
        resize = '<M>',
        -- for swapping window buffers
        swap = false, -- false disables creating a binding
      },
    },
    -- or, customize the mappings
    smart_splits = {
      mods = {
        -- any of the mods can also be a table of the following form
        swap = {
          -- this will create the mapping like
          -- <leader><C-h>
          -- <leader><C-j>
          -- <leader><C-k>
          -- <leader><C-l>
          mod = '<C>',
          prefix = '<leader>',
        },
      },
    },
  },
})

Otherwise, here are some recommended mappings.

-- recommended mappings
-- resizing splits
-- these keymaps will also accept a range,
-- for example `10<A-h>` will `resize_left` by `(10 * config.default_amount)`
vim.keymap.set('n', '<A-h>', require('smart-splits').resize_left)
vim.keymap.set('n', '<A-j>', require('smart-splits').resize_down)
vim.keymap.set('n', '<A-k>', require('smart-splits').resize_up)
vim.keymap.set('n', '<A-l>', require('smart-splits').resize_right)
-- moving between splits
vim.keymap.set('n', '<C-h>', require('smart-splits').move_cursor_left)
vim.keymap.set('n', '<C-j>', require('smart-splits').move_cursor_down)
vim.keymap.set('n', '<C-k>', require('smart-splits').move_cursor_up)
vim.keymap.set('n', '<C-l>', require('smart-splits').move_cursor_right)
-- swapping buffers between windows
vim.keymap.set('n', '<leader><leader>h', require('smart-splits').swap_buf_left)
vim.keymap.set('n', '<leader><leader>j', require('smart-splits').swap_buf_down)
vim.keymap.set('n', '<leader><leader>k', require('smart-splits').swap_buf_up)
vim.keymap.set('n', '<leader><leader>l', require('smart-splits').swap_buf_right)

Lua API

-- resizing splits
-- amount defaults to 3 if not specified
-- use absolute values, no + or -
-- the functions also check for a range,
-- so for example if you bind `<A-h>` to `resize_left`,
-- then `10<A-h>` will `resize_left` by `(10 * config.default_amount)`
require('smart-splits').resize_up(amount)
require('smart-splits').resize_down(amount)
require('smart-splits').resize_left(amount)
require('smart-splits').resize_right(amount)
-- moving between splits
-- You can override config.at_edge and
-- config.move_cursor_same_row via opts
-- See Configuration.
require('smart-splits').move_cursor_up({ same_row = boolean, at_edge = 'wrap' | 'split' | 'stop' })
require('smart-splits').move_cursor_down()
require('smart-splits').move_cursor_left()
require('smart-splits').move_cursor_right()
-- Swapping buffers directionally with the window to the specified direction
require('smart-splits').swap_buf_up()
require('smart-splits').swap_buf_down()
require('smart-splits').swap_buf_left()
require('smart-splits').swap_buf_right()
-- the buffer swap functions can also take an `opts` table to override the
-- default behavior of whether or not the cursor follows the buffer
require('smart-splits').swap_buf_right({ move_cursor = true })
-- persistent resize mode
-- temporarily remap your configured resize keys to
-- smart resize left, down, up, and right, respectively,
-- press <ESC> to stop resize mode (unless you've set a different key in config)
-- resize keys also accept a range, e.e. pressing `5j` will resize down 5 times the default_amount
require('smart-splits').start_resize_mode()

Multiplexer Integrations

smart-splits.nvim can also enable seamless navigation between Neovim splits and tmux, wezterm, or kitty panes. You will need to set up keymaps in your tmux, wezterm, or kitty configs to match the Neovim keymaps.

Tmux

Add the following snippet to your ~/.tmux.conf/~/.config/tmux/tmux.conf file (customizing the keys and resize amount if desired):

# Smart pane switching with awareness of Vim splits.
# See: https://github.com/christoomey/vim-tmux-navigator
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
    | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" 'send-keys C-h'  'select-pane -L'
bind-key -n C-j if-shell "$is_vim" 'send-keys C-j'  'select-pane -D'
bind-key -n C-k if-shell "$is_vim" 'send-keys C-k'  'select-pane -U'
bind-key -n C-l if-shell "$is_vim" 'send-keys C-l'  'select-pane -R'

bind-key -n M-h if-shell "$is_vim" 'send-keys M-h' 'resize-pane -L 3'
bind-key -n M-j if-shell "$is_vim" 'send-keys M-j' 'resize-pane -D 3'
bind-key -n M-k if-shell "$is_vim" 'send-keys M-k' 'resize-pane -U 3'
bind-key -n M-l if-shell "$is_vim" 'send-keys M-l' 'resize-pane -R 3'

tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
    "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\'  'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
    "bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\'  'select-pane -l'"

bind-key -T copy-mode-vi 'C-h' select-pane -L
bind-key -T copy-mode-vi 'C-j' select-pane -D
bind-key -T copy-mode-vi 'C-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R
bind-key -T copy-mode-vi 'C-\' select-pane -l

Wezterm

Note It is recommended not to lazy load smart-splits.nvim if using the Wezterm integration. If you need to lazy load, you need to use a different is_vim() implementation below. The plugin is small, and smart about not loading modules unnecessarily, so it should have minimal impact on your startup time. It adds about 0.07ms on my setup.

Note Pane resizing currently requires a nightly build of Wezterm. Check the output of wezterm cli adjust-pane-size --help to see if your build supports it; if not, you can check how to obtain a nightly build by following the instructions here.

Add the following snippet to your ~/.config/wezterm/wezterm.lua:

local w = require('wezterm')

-- if you are *NOT* lazy-loading smart-splits.nvim (recommended)
local function is_vim(pane)
  -- this is set by the plugin, and unset on ExitPre in Neovim
  return pane:get_user_vars().IS_NVIM == 'true'
end

-- if you *ARE* lazy-loading smart-splits.nvim (not recommended)
-- you have to use this instead, but note that this will not work
-- in all cases (e.g. over an SSH connection). Also note that
-- `pane:get_foreground_process_name()` can have high and highly variable
-- latency, so the other implementation of `is_vim()` will be more
-- performant as well.
local function is_vim(pane)
  -- This gsub is equivalent to POSIX basename(3)
  -- Given "/foo/bar" returns "bar"
  -- Given "c:\\foo\\bar" returns "bar"
  local process_name = string.gsub(pane:get_foreground_process_name(), '(.*[/\\])(.*)', '%2')
  return process_name == 'nvim' or process_name == 'vim'
end

local direction_keys = {
  Left = 'h',
  Down = 'j',
  Up = 'k',
  Right = 'l',
  -- reverse lookup
  h = 'Left',
  j = 'Down',
  k = 'Up',
  l = 'Right',
}

local function split_nav(resize_or_move, key)
  return {
    key = key,
    mods = resize_or_move == 'resize' and 'META' or 'CTRL',
    action = w.action_callback(function(win, pane)
      if is_vim(pane) then
        -- pass the keys through to vim/nvim
        win:perform_action({
          SendKey = { key = key, mods = resize_or_move == 'resize' and 'META' or 'CTRL' },
        }, pane)
      else
        if resize_or_move == 'resize' then
          win:perform_action({ AdjustPaneSize = { direction_keys[key], 3 } }, pane)
        else
          win:perform_action({ ActivatePaneDirection = direction_keys[key] }, pane)
        end
      end
    end),
  }
end

return {
  keys = {
    -- move between split panes
    split_nav('move', 'h'),
    split_nav('move', 'j'),
    split_nav('move', 'k'),
    split_nav('move', 'l'),
    -- resize panes
    split_nav('resize', 'h'),
    split_nav('resize', 'j'),
    split_nav('resize', 'k'),
    split_nav('resize', 'l'),
  },
}

Kitty

Note config.at_edge = 'wrap' is not supoprted in Kitty terminal multiplexer due to inability to determine pane layout from CLI.

Note This won't work if the pane is connected over SSH, as the pane will not properly report the foreground process name.

Add the following snippet to ~/.config/kitty/kitty.conf, adjusting the keymaps and resize amount as desired.

map ctrl+j kitten pass_keys.py neighboring_window bottom ctrl+j
map ctrl+k kitten pass_keys.py neighboring_window top    ctrl+k
map ctrl+h kitten pass_keys.py neighboring_window left   ctrl+h
map ctrl+l kitten pass_keys.py neighboring_window right  ctrl+l

# the 3 here is the resize amount, adjust as needed
map alt+j kitten pass_keys.py relative_resize down  3 alt+j
map alt+k kitten pass_keys.py relative_resize up    3 alt+k
map alt+h kitten pass_keys.py relative_resize left  3 alt+h
map alt+l kitten pass_keys.py relative_resize right 3 alt+l

By default, it matches against the name of the current foreground process to detect if vim/nvim is running. If that doesn't work for you, or you want to include other CLI/TUI programs in the exclusion, you can provide an additional regex argument:

map ctrl+j kitten pass_keys.py neighboring_window bottom ctrl+j "^.* - nvim$"
map ctrl+k kitten pass_keys.py neighboring_window top    ctrl+k "^.* - nvim$"
map ctrl+h kitten pass_keys.py neighboring_window left   ctrl+h "^.* - nvim$"
map ctrl+l kitten pass_keys.py neighboring_window right  ctrl+l "^.* - nvim$"

# the 3 here is the resize amount, adjust as needed
map alt+j kitten pass_keys.py relative_resize down  3 alt+j "^.* - nvim$"
map alt+k kitten pass_keys.py relative_resize up    3 alt+k "^.* - nvim$"
map alt+h kitten pass_keys.py relative_resize left  3 alt+h "^.* - nvim$"
map alt+l kitten pass_keys.py relative_resize right 3 alt+l "^.* - nvim$"

Then, you must allow Kitty to listen for remote commands on a socket. You can do this either by running Kitty with the following command:

# For linux only:
kitty -o allow_remote_control=yes --single-instance --listen-on unix:@mykitty

# Other unix systems:
kitty -o allow_remote_control=yes --single-instance --listen-on unix:/tmp/mykitty

Or, by adding the following to ~/.config/kitty/kitty.conf:

# For linux only:
allow_remote_control yes
listen_on unix:@mykitty

# Other unix systems:
allow_remote_control yes
listen_on unix:/tmp/mykitty
Credits

Thanks @knubie for inspiration for the Kitty implementation from vim-kitty-navigator.

Thanks to @chancez for the relative resize Python kitten.

Multiplexer Lua API

You can directly access the multiplexer API for scripting purposes as well. To get a handle to the current multiplexer backend, you can do:

local mux = require('smart-splits.mux').get()

This returns the currently enabled multiplexer backend, or nil if none is currently in use. The API offers the following methods:

local mux = require('smart-splits.mux').get()
-- mux matches the following type annotations
---@class SmartSplitsMultiplexer
---@field current_pane_id fun():number|nil
---@field current_pane_at_edge fun(direction:'left'|'right'|'up'|'down'):boolean
---@field is_in_session fun():boolean
---@field current_pane_is_zoomed fun():boolean
---@field next_pane fun(direction:'left'|'right'|'up'|'down'):boolean
---@field resize_pane fun(direction:'left'|'right'|'up'|'down', amount:number):boolean
---@field split_pane fun(direction:'left'|'right'|'up'|'down',size:number|nil):boolean
---@field type 'tmux'|'wezterm'|'kitty'