A Neovim implementation of nav in Lua.
- Neovim 0.7+ since we depend on the
nvim_create_user_command
API.
Install using your favorite package manager.
require("packer").startup(function(use)
-- other plugins ...
use "kaybinwang/nav.nvim"
)
You can use the Nav
command to create shortcuts to directories that you visit often.
:Nav add pp ~/personal/projects " create a new shortcut
:Nav to pp " navigate to the shortcut
Note that special characters expand as you would expect.
:Nav add pp . " create a new shortcut to the current directory
:Nav to pp " navigate to the shortcut
You can also manage your shortcuts using :Nav update
and :Nav remove
.
:Nav update pp ~/new/personal/projects " update the shortcut
:Nav remove pp " delete the shortcut
Finally, you can see what shortcuts you have defined by using nav list.
:Nav list
Please refer to :help nav
for more documentation on the commands.
By default, Nav
stores your shortcuts in ~/.config/nav
. However, you can set your own custom directory by setting the NAV_PATH
environment variable. For example,
export NAV_PATH=/path/to/shortcuts
source /path/to/nav.sh
TODO add configuration that can modify
- subcommand names
- nav_path