Using Homebrew
brew install navi
Using Gentoo
Be sure to enable the GURU overlay.
emerge -a app-misc/navi
Using pacman
pacman -S navi
Using nix
nix-env -iA nixpkgs.navi
Using cargo
cargo install --locked navi
Using choco
For Windows user, using powershell
-
Install package via choco
choco install navi
-
Create
$env:USERPROFILE\AppData\Roaming\navi\config.yaml
and overrideshell.command
as per config_file_example.yamlstyle: tag: color: cyan comment: color: grey snippet: color: white shell: command: powershell
Remark: Above example also adds custom colors for better readability in case you use standard blue for your Powershell
bash <(curl -sL https://raw.githubusercontent.com/denisidoro/navi/master/scripts/install)
# (optional) to set directories:
# BIN_DIR=/usr/local/bin bash <(curl -sL https://raw.githubusercontent.com/denisidoro/navi/master/scripts/install)
- download the correct binary here
- extract the content to your
$PATH
git clone https://github.com/denisidoro/navi ~/.navi
cd ~/.navi
make install
# (optional) to set the install directory:
# make BIN_DIR=/usr/local/bin install
navi supports environment variables at compile time that modify the behavior of the binary at runtime:
NAVI_PATH
(directory path value): If thecheats
directory in the user's directory does not exist, navi uses this path (if it exists), as a fallback location to look for cheat files. Use case: system-wide installed, shared used cheatsheets folder.NAVI_CONFIG
(file path value): If theconfig.yaml
file in the user's directory does not exist, navi uses this path (if it exists), as a fallback location to look for a configuration file. Use case: system-wide installed, shared used configuration file.
You can find navi for more package managers by clicking on the image below:
Feel free to be the maintainer of navi for any package manager you'd like!
If you want to install it, add this line to your .bashrc
-like file:
# bash
eval "$(navi widget bash)"
# zsh
eval "$(navi widget zsh)"
# fish
navi widget fish | source
# elvish
eval (navi widget elvish | slurp)
# xonsh
# xpip install xontrib-navi # ← run in your xonsh session to install xontrib
xontrib load navi # ← add to your xonsh run control file
Due to Nushell's unique design, it is not possible to eval
a piece of code dynamically like in other shells therefore the integration process is a bit more involved. Here is an example:
- run
^navi widget nushell | save ($nu.default-config-dir | path join "navi-integration.nu")
- add the following lines to
config.nu
:source ($nu.default-config-dir | path join "navi-integration.nu")
By default, Ctrl+G
is assigned to launching navi (in xonsh can be customized with $X_NAVI_KEY
, see xontrib-navi for details).
There's currently no way to customize the widget behavior out-of-the-box. If you want to change the keybinding or the navi flags used by the widget, please:
- run, e.g.,
navi widget bash
in your terminal - copy the output
- paste the output in your
.bashrc
-like file - edit the contents accordingly