Skip to content

Use the same set of keybinds to switch between vim splits, tmux panes and bspwm windows.

Notifications You must be signed in to change notification settings

joaopedroaat/vim-bspwm-tmux-navigator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Vim / Bspwm / Tmux Navigator

This plugin provides a means of sharing keybinds between bspwm, vim and tmux, allowing Super + HJKL to navigate both between system windows and vim windows. The overall structure and the vim plugin are adapted from Chris Toomey's Vim Tmux Navigator and Rowan Tran Vim Bspwm Navigator.

Preview

untitled.mp4

Installation

Dependencies

vim and bspwm are obviously required. The plugin also works in neovim.

You will need xdotool installed. Check your distribution's repos for this; most distros should have it readily available.

Vim

Use your preferred package manager to install the Vim plugin.

using vim-plug:

Plug "joaopedroaat/vim-bspwm-tmux-navigator"

NOTE: Ensure that ctrl-h, ctrl-j, ctrl-k, and ctrl-l are not bound to any commands in vim.

using lazy:

return {
  "joaopedroaat/vim-bspwm-tmux-navigator",
  cmd = {
    "BspwmNavigateLeft",
    "BspwmNavigateDown",
    "BspwmNavigateUp",
    "BspwmNavigateRight",
    "BspwmNavigatePrevious",
  },
  keys = {
    { "<c-h>", "<cmd><C-U>BspwmNavigateLeft<cr>" },
    { "<c-j>", "<cmd><C-U>BspwmNavigateDown<cr>" },
    { "<c-k>", "<cmd><C-U>BspwmNavigateUp<cr>" },
    { "<c-l>", "<cmd><C-U>BspwmNavigateRight<cr>" },
  },
}

Tmux

using tpm

set -g @plugin 'joaopedroaat/vim-bspwm-tmux-navigator'

bspwm/sxhkd

Symlink scripts/handle-bspwm-navigation to somewhere in your $PATH, e.g.

using vim-plug:

ln -s ~/.config/nvim/plugged/vim-bspwm-tmux-navigator/scripts/handle-bspwm-navigation /usr/local/bin/handle-bspwm-navigation
chmod +x /usr/local/bin/handle-bspwm-navigation

using lazy

ln -s ~/.local/share/nvim/lazy/vim-bspwm-tmux-navigator/scripts/handle-bspwm-navigation /usr/local/bin/handle-bspwm-navigation
chmod +x /usr/local/bin/handle-bspwm-navigation

NOTE: You must change the above command depending on where your plugin is stored. If you have a different folder in $PATH to store shell scripts, symlink it to there instead of /usr/local/bin.

Use sxhkd to invoke handle-bspwm-navigation $DIRECTION, where $DIRECTION can be: west, south, north or east. ~/.config/sxhkd/sxhkdrc:

super + {h,j,k,l}
    handle-bspwm-navigation {west,south,north,east}

Ensure that you remove any conflicting keybinds.

About

Use the same set of keybinds to switch between vim splits, tmux panes and bspwm windows.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 51.8%
  • Shell 48.2%