Skip to content

ericr3r/easy-neovim-wm-nav

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

easy-neovim-wm-nav

Quickly navigate window manager windows and Neovim splits with the same keybindings. Supports AeroSpace, Sway, and Hyprland.

This utility was heavily inspired by

Installation

cargo install --git https://github.com/erauer/easy-neovim-wm-nav.git

Usage

Neovim configuration

Add this to your init.lua:

local servername = vim.api.nvim_get_vvar("servername")
vim.opt.title = true
vim.opt.titlestring = string.format("nvim %s -- [%s] ", vim.fn.getcwd(),

Note: easy-neovim-wm-nav uses the window's titlestring in order to extract the server name used for communicating with Neovim. The default regex assumes that the servername is contained in square brackets at the very end of your titlestring.

Hyprland key bindings

# Arrow Keys
bind = $mainMod, left, exec, easy-neovim-wm-nav left
bind = $mainMod, right, exec, easy-neovim-wm-nav right
bind = $mainMod, up, exec, easy-neovim-wm-nav up
bind = $mainMod, down, exec, easy-neovim-wm-nav down

# HJKL
bind = $mainMod, H, exec, easy-neovim-wm-nav left
bind = $mainMod, L, exec, easy-neovim-wm-nav right
bind = $mainMod, K, exec, easy-neovim-wm-nav up
bind = $mainMod, J, exec, easy-neovim-wm-nav down

Sway key bindings

bindsym Mod4+h exec easy-neovim-wm-nav left
bindsym Mod4+j exec easy-neovim-wm-nav down
bindsym Mod4+k exec easy-neovim-wm-nav up
bindsym Mod4+l exec easy-neovim-wm-nav right

Skhd key binding for use with Aerospace

shift + alt - h : easy-neovim-wm-nav --backend aerospace left
shift + alt - j : easy-neovim-wm-nav --backend aerospace down
shift + alt - k : easy-neovim-wm-nav --backend aerospace up
shift + alt - l : easy-neovim-wm-nav --backend aerospace right

Status

Let's be honest, at this point it seems to work on my machine. I'm new to rust and by no means is the code production ready or of good quality. That being said, I'm open to issues and PRs and will continue to maintain this code as long as it is of use to me.

About

Easy Neovim split and Aerospace window navigation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published