### Get Example Configuration File Source: https://context7.com/denisidoro/navi/llms.txt Query navi for an example configuration file. ```sh # Get example configuration file navi info config-example ``` -------------------------------- ### Get Example Configuration File Source: https://github.com/denisidoro/navi/blob/master/docs/usage/commands/info/README.md Retrieve an example of a Navi configuration file. This is helpful for understanding the structure and available options for your own configuration. ```sh navi info config-example ``` -------------------------------- ### Install navi using the installation script Source: https://github.com/denisidoro/navi/blob/master/docs/installation/README.md Execute the provided bash script to install navi. The script downloads and sets up the tool. ```bash bash <(curl -sL https://raw.githubusercontent.com/denisidoro/navi/master/scripts/install) ``` -------------------------------- ### Install navi from source using make Source: https://github.com/denisidoro/navi/blob/master/docs/installation/README.md After cloning the repository, use 'make install' to build and install navi from source. ```bash make install ``` -------------------------------- ### Get Example Cheatsheet Source: https://context7.com/denisidoro/navi/llms.txt Query navi for an example cheatsheet. ```sh # Get example cheatsheet navi info cheats-example ``` -------------------------------- ### Create Config File from Example Source: https://context7.com/denisidoro/navi/llms.txt Create the navi configuration file from an example. ```sh # Create config file from example navi info config-example > "$(navi info config-path)" ``` -------------------------------- ### Create Initial Cheatsheet from Example Source: https://context7.com/denisidoro/navi/llms.txt Create an initial cheatsheet file from an example if it does not exist. ```sh # Create initial cheatsheet from example f="$(navi info cheats-path)/main.cheat" [ -f "$f" ] || navi info cheats-example > "$f" ``` -------------------------------- ### Install navi from source with custom binary directory using make Source: https://github.com/denisidoro/navi/blob/master/docs/installation/README.md Specify a custom binary directory when installing navi from source using 'make install'. ```bash make BIN_DIR=/usr/local/bin install ``` -------------------------------- ### Install navi using the installation script with custom binary directory Source: https://github.com/denisidoro/navi/blob/master/docs/installation/README.md Use this command to install navi via the script, specifying a custom directory for the binary. ```bash BIN_DIR=/usr/local/bin bash <(curl -sL https://raw.githubusercontent.com/denisidoro/navi/master/scripts/install) ``` -------------------------------- ### Install Navi Shell Widgets Source: https://context7.com/denisidoro/navi/llms.txt Integrate Navi as a shell widget for quick access via keyboard shortcuts. Examples for Bash, Zsh, Fish, Elvish, and Nushell are provided. ```sh # Bash - add to ~/.bashrc eval "$(navi widget bash)" # Zsh - add to ~/.zshrc eval "$(navi widget zsh)" # Fish - add to ~/.config/fish/config.fish navi widget fish | source # Elvish eval (navi widget elvish | slurp) # Nushell - run once to create integration file ^navi widget nushell | save ($nu.default-config-dir | path join "navi-integration.nu") # Then add to config.nu: # source ($nu.default-config-dir | path join "navi-integration.nu") ``` -------------------------------- ### Install navi with Nix Source: https://github.com/denisidoro/navi/blob/master/docs/installation/README.md Install navi using the Nix package manager with the specified attribute. ```shell nix-env -iA nixpkgs.navi ``` -------------------------------- ### Navi Configuration File Example Source: https://context7.com/denisidoro/navi/llms.txt Example of a navi configuration file (`~/.config/navi/config.yaml`) showing settings for style, finder, and shell. ```yaml # ~/.config/navi/config.yaml style: tag: color: cyan width_percentage: 26 min_width: 20 comment: color: blue width_percentage: 42 min_width: 45 snippet: color: white finder: command: fzf overrides: --height 2 overrides_var: --no-select-1 delimiter_var: \s\s+ cheats: paths: - /path/to/custom/cheats - /another/cheats/dir shell: command: bash finder_command: bash # search: # tags: git,!checkout # filter tags (! for negation) ``` -------------------------------- ### Install navi with Gentoo Source: https://github.com/denisidoro/navi/blob/master/docs/installation/README.md Install navi on Gentoo systems by enabling the GURU overlay and using emerge. ```shell emerge -a app-misc/navi ``` -------------------------------- ### Install navi with Homebrew Source: https://github.com/denisidoro/navi/blob/master/docs/installation/README.md Use this command to install navi if you are using Homebrew as your package manager. ```shell brew install navi ``` -------------------------------- ### Install navi with Cargo Source: https://github.com/denisidoro/navi/blob/master/docs/installation/README.md Build and install navi from source using Cargo, ensuring a locked dependency resolution. ```bash cargo install --locked navi ``` -------------------------------- ### Navi Cheatsheet Syntax Example Source: https://github.com/denisidoro/navi/blob/master/README.md This example demonstrates the basic syntax for a Navi cheatsheet file. It includes tags, a command, and a dynamic argument suggestion. ```sh % git, code # Change branch git checkout $ branch: git branch | awk '{print $NF}' ``` -------------------------------- ### Browse Cheatsheet Repositories with Navi Source: https://github.com/denisidoro/navi/blob/master/docs/usage/commands/repo/README.md Use this command to browse featured cheatsheet repositories registered with navi. No specific setup is required beyond having navi installed. ```shell navi repo browse ``` -------------------------------- ### Install Navi via Package Managers Source: https://context7.com/denisidoro/navi/llms.txt Install Navi using various Linux package managers or Chocolatey for Windows. ```sh # Arch Linux pacman -S navi # Gentoo (requires GURU overlay) emerge -a app-misc/navi # Nix nix-env -iA nixpkgs.navi # Chocolatey (Windows) choco install navi ``` -------------------------------- ### Install Navi Widget for Xonsh Source: https://github.com/denisidoro/navi/blob/master/docs/widgets/README.md First, install the xontrib-navi package within your xonsh session. Then, load the 'navi' xontrib in your xonsh run control file. ```sh # xpip install xontrib-navi # ← run in your xonsh session to install xontrib xontrib load navi # ← add to your xonsh run control file ``` -------------------------------- ### Install navi with Pacman Source: https://github.com/denisidoro/navi/blob/master/docs/installation/README.md Use this command to install navi on Arch Linux or other systems using Pacman. ```shell pacman -S navi ``` -------------------------------- ### Install navi with Chocolatey Source: https://github.com/denisidoro/navi/blob/master/docs/installation/README.md Install navi using Chocolatey. Note the caution regarding the configuration file for shell command. ```bash choco install navi ``` -------------------------------- ### Example Cheatsheet for Vim and PostgreSQL Source: https://github.com/denisidoro/navi/blob/master/docs/widgets/howto/TMUX.md This example cheatsheet demonstrates commands for Vim (quitting without saving, deleting paragraphs, generating number sequences) and PostgreSQL (describing table columns). ```sh % vim # Quit without save qa! # Delete a paragraph normal dap # Generate sequence of numbers put =range(, ) % postgresql # Describe table columns in `psql` or `pgcli` select table_name, column_name, data_type from information_schema.columns where table_name = ''; ``` -------------------------------- ### Install Navi Widget for Fish Source: https://github.com/denisidoro/navi/blob/master/docs/widgets/README.md Pipe the output of 'navi widget fish' to 'source' in your Fish shell configuration to enable the Navi widget. ```fish navi widget fish | source ``` -------------------------------- ### Install Navi Widget for Bash Source: https://github.com/denisidoro/navi/blob/master/docs/widgets/README.md Add this line to your .bashrc file to enable the Navi widget for Bash. This allows launching Navi with a shortcut. ```sh eval "$(navi widget bash)" ``` -------------------------------- ### Get Default Configuration File Path Source: https://context7.com/denisidoro/navi/llms.txt Query navi for the default configuration file path. ```sh # Get default configuration file path navi info config-path navi info default-config-path # v2.25.0+ ``` -------------------------------- ### Use Skim Instead of fzf Source: https://context7.com/denisidoro/navi/llms.txt Customize the finder command used by navi. This example sets it to 'skim'. ```sh # Use skim instead of fzf navi --finder 'skim' ``` -------------------------------- ### Install Navi Widget for Elvish Source: https://github.com/denisidoro/navi/blob/master/docs/widgets/README.md Use 'eval' with 'slurp' to capture the output of 'navi widget elvish' and execute it, enabling the Navi widget for Elvish. ```sh eval (navi widget elvish | slurp) ``` -------------------------------- ### Install Navi Widget for Zsh Source: https://github.com/denisidoro/navi/blob/master/docs/widgets/README.md Add this line to your .zshrc file to enable the Navi widget for Zsh. This allows launching Navi with a shortcut. ```sh eval "$(navi widget zsh)" ``` -------------------------------- ### Multiline Commands with Backslash Continuation Source: https://context7.com/denisidoro/navi/llms.txt Write multiline commands using backslash continuation. This example outputs 'foo' then 'yes'. ```sh % bash, multiline # Output "foo" then "yes" echo foo true \ && echo yes \ || echo no ``` -------------------------------- ### Configure navi for Chocolatey installation Source: https://github.com/denisidoro/navi/blob/master/docs/installation/README.md This YAML configuration is required when installing navi via Chocolatey to specify the shell command. ```yaml shell: command: powershell ``` -------------------------------- ### Create Aliases with Navi Source: https://context7.com/denisidoro/navi/llms.txt Use naming conventions in cheatsheets combined with shell aliases for quick command access. This example creates aliases 'el' and 'ef'. ```sh % aliases # This is one command :: el echo lorem ipsum # This is another command :: ef echo foo bar ``` ```bash # Add to .bashrc navialias() { navi --query ":: $1" --best-match } alias el="navialias el" alias ef="navialias ef" ``` -------------------------------- ### Nushell Navi Integration - Source Config Source: https://github.com/denisidoro/navi/blob/master/docs/widgets/README.md Add this line to your Nushell 'config.nu' file to source the Navi integration script, completing the setup. ```nushell source ($nu.default-config-dir | path join "navi-integration.nu") ``` -------------------------------- ### Set fzf Defaults for All Cases via Environment Variable Source: https://context7.com/denisidoro/navi/llms.txt Configure navi behavior using environment variables. This example sets default fzf options for all cases. ```sh # Set fzf defaults for all cases export FZF_DEFAULT_OPTS="--height 40% --layout=reverse" ``` -------------------------------- ### Multiline Commands with Markdown Code Blocks Source: https://context7.com/denisidoro/navi/llms.txt Write multiline commands using markdown code blocks. This example shows how to change a git branch. ```sh % git, code # Change branch (markdown block syntax) ```sh git checkout ``` $ branch: git branch | awk '{print $NF}' ``` -------------------------------- ### Get Default Configuration Path Source: https://github.com/denisidoro/navi/blob/master/docs/usage/commands/info/README.md Use this command to display the default path where Navi looks for its configuration file. This is useful for locating or creating your configuration. ```sh navi info config-path ``` -------------------------------- ### Filter by Tags Source: https://context7.com/denisidoro/navi/llms.txt Filter cheatsheets by tags using command-line flags. This example shows only 'git' tags and excludes 'checkout'. ```sh # Filter by tags (show only git, exclude checkout) navi --tag-rules='git,!checkout' ``` -------------------------------- ### Set Custom Config File Path via Environment Variable Source: https://context7.com/denisidoro/navi/llms.txt Configure navi behavior using environment variables. This example sets a custom path for the configuration file. ```sh # Set custom config file path export NAVI_CONFIG='/path/to/config.yaml' ``` -------------------------------- ### Navi Variables with Dynamic Suggestions Source: https://context7.com/denisidoro/navi/llms.txt Define variables that fetch suggestions dynamically from command output. This example shows extracting image IDs from `docker images`. ```sh % docker, containers # Remove a Docker image docker rmi # Variable with column extraction, header lines, and custom delimiter $ image_id: docker images --- --column 3 --header-lines 1 --delimiter '\s\s+' ``` -------------------------------- ### Use Looser fzf Search Algorithm Source: https://context7.com/denisidoro/navi/llms.txt Customize fzf behavior for snippet selection using command-line flags. This example uses a looser search algorithm. ```sh # Use looser search algorithm navi --fzf-overrides '--no-exact' ``` -------------------------------- ### Set Custom Cheatsheets Path via Environment Variable Source: https://context7.com/denisidoro/navi/llms.txt Configure navi behavior using environment variables. This example sets a custom path for cheatsheets. ```sh # Set custom cheatsheets path (colon-separated) export NAVI_PATH='/path/to/cheats:/other/cheats' ``` -------------------------------- ### Add Cron Job for Daily Repository Updates Source: https://context7.com/denisidoro/navi/llms.txt Add a cron job for daily updates of cloned cheatsheet repositories. This example sets updates for 11 am. ```sh # Add cron job for daily updates at 11am crontab -e # Add this line: # 0 11 * * * bash -c 'cd "$(/usr/local/bin/navi info cheats-path)/denisidoro__cheats" && /usr/local/bin/git pull -q origin master' ``` -------------------------------- ### Get Default Cheatsheets Path Source: https://github.com/denisidoro/navi/blob/master/docs/usage/commands/info/README.md Use this command to display the default directory where Navi stores its cheatsheet files. This helps in managing and locating your cheatsheets. ```sh navi info cheats-path ``` -------------------------------- ### Map Command Output Values Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/syntax/README.md Modify the output values of a command using a bash map function. This example transforms 'false/true' into '0/1'. ```sh # Even though "false/true" is displayed, this will print "0/1" echo $ mapped: echo 'false true' | tr ' ' '\n' --- --map "grep -q t && echo 1 || echo 0" ``` -------------------------------- ### Map Boolean Values Source: https://context7.com/denisidoro/navi/llms.txt Transform selected values using map functions before insertion. This example maps 'false' and 'true' to '0' and '1' respectively. ```sh % boolean, mapping # Print boolean as 0 or 1 echo # Map "false/true" display values to "0/1" output $ mapped: echo 'false true' | tr ' ' '\n' --- --map "grep -q t && echo 1 || echo 0" ``` -------------------------------- ### Share Variables Across Cheatsheets Source: https://context7.com/denisidoro/navi/llms.txt Share variables across multiple cheat sections using the `@` extend syntax. This example shares a 'pictures_folder' variable. ```sh % dirs, common $ pictures_folder: echo "/my/pictures" % wallpapers @ dirs, common # Print wallpapers path echo "/wallpapers" % screenshots @ dirs, common # Print screenshots path echo "/screenshots" ``` -------------------------------- ### Set Up Auto-Updating for Cheatsheet Repositories with Crontab Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/repositories/README.md Configure a cron job to automatically pull updates for a cloned cheatsheet repository. Ensure the paths to 'navi' and 'git' are correct for your system. The example pulls from the 'master' branch daily at 11 am. ```shell crontab -e */0 11 * * * bash -c 'cd "$(/usr/local/bin/navi info cheats-path)/__" && /usr/local/bin/git pull -q origin master' ``` -------------------------------- ### Override fzf Options for Snippet Selection via Environment Variable Source: https://context7.com/denisidoro/navi/llms.txt Configure navi behavior using environment variables. This example overrides fzf options for snippet selection. ```sh # Override fzf options for snippet selection export NAVI_FZF_OVERRIDES='--height 50%' ``` -------------------------------- ### Override fzf Options for Variable Selection via Environment Variable Source: https://context7.com/denisidoro/navi/llms.txt Configure navi behavior using environment variables. This example overrides fzf options for variable selection. ```sh # Override fzf options for variable selection export NAVI_FZF_OVERRIDES_VAR='--no-select-1' ``` -------------------------------- ### Customize Navi Column Colors Source: https://github.com/denisidoro/navi/blob/master/docs/configuration/README.md Configure the text color for different columns in Navi's output. This example sets colors for tags, comments, and snippets to mimic the French flag. ```yaml style: tag: color: blue comment: color: white snippet: color: red ``` -------------------------------- ### Override fzf Options for Snippet Selection Source: https://context7.com/denisidoro/navi/llms.txt Customize fzf behavior for snippet selection using command-line flags. This example shows only comment and tag columns. ```sh # Show only comment and tag columns navi --fzf-overrides '--with-nth 1,2' ``` -------------------------------- ### Override fzf Options for Variable Selection Source: https://context7.com/denisidoro/navi/llms.txt Customize fzf behavior for variable selection using command-line flags. This example prevents auto-selection when there is only one result. ```sh # Same overrides for variable selection navi --fzf-overrides-var '--no-select-1' ``` -------------------------------- ### Set Logging Level with RUST_LOG Source: https://github.com/denisidoro/navi/blob/master/docs/usage/README.md Control the log level for Navi by setting the `RUST_LOG` environment variable. For example, set it to `debug` for detailed logging. The log file is created in the same directory as the configuration file. ```bash RUST_LOG=debug navi ``` -------------------------------- ### Create Default Configuration File Source: https://github.com/denisidoro/navi/blob/master/docs/usage/commands/info/README.md This command demonstrates how to create the default configuration file by redirecting the output of `navi info config-example` to the path obtained from `navi info config-path`. Ensure the target directory exists. ```sh navi info config-example > "$(navi info config-path)" ``` -------------------------------- ### Select with preview window using docker logs Source: https://context7.com/denisidoro/navi/llms.txt This snippet demonstrates how to use navi to select a container name and then display its logs with a preview window. It uses `docker ps` to list containers and `docker inspect` for preview. ```bash docker logs $ container: docker ps --format '{{.Names}}\t{{.Image}}\t{{.Status}}' --- --column 1 --header-lines 0 --delimiter '\t' --preview 'docker inspect {1}' --preview-window right:50% ``` -------------------------------- ### Display All Navi Options Source: https://github.com/denisidoro/navi/blob/master/README.md Run this command to view all available options and flags for the Navi tool. This is useful for understanding its full capabilities and configuration. ```sh navi --help ``` -------------------------------- ### Multi-select files with custom query Source: https://context7.com/denisidoro/navi/llms.txt This snippet shows how to use navi for multi-selecting files based on a custom query. It uses `ls -la` to list files and filters them using a query for `.txt` files. ```bash rm $ files: ls -la --- --multi --query '.txt' ``` -------------------------------- ### Windows Configuration with PowerShell Source: https://context7.com/denisidoro/navi/llms.txt This YAML configuration sets up Navi to use PowerShell as the shell on Windows. ```yaml # config.yaml for Windows with PowerShell shell: command: powershell ``` -------------------------------- ### Set Default fzf Options for All Cases Source: https://github.com/denisidoro/navi/blob/master/docs/configuration/README.md Configure the FZF_DEFAULT_OPTS environment variable to apply fzf settings universally. ```bash export FZF_DEFAULT_OPTS="--height 3" ``` -------------------------------- ### Run Navi Interactively Source: https://context7.com/denisidoro/navi/llms.txt Launch Navi to browse cheatsheets and execute commands. Options include pre-filtering results and specifying custom paths. ```sh # Launch interactive cheatsheet browser navi # Show cheatsheets for navi itself navi fn welcome # Print command instead of executing navi --print # Pre-filter results with a query navi --query git # Use custom cheatsheet paths navi --path '/path/to/cheats:/another/path' ``` -------------------------------- ### Browse Featured Repositories Source: https://context7.com/denisidoro/navi/llms.txt Browse featured cheatsheet repositories. ```sh # Browse featured repositories navi repo browse ``` -------------------------------- ### Import Cheatsheet Repositories via SSH Source: https://context7.com/denisidoro/navi/llms.txt Add cheatsheet repositories from GitHub using SSH. ```sh # Import via SSH navi repo add git@github.com:denisidoro/cheats ``` -------------------------------- ### Use TLDR Cheatsheets with Navi Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/README.md Query TLDR pages directly through Navi by prefixing your query with --tldr. ```sh navi --tldr ``` -------------------------------- ### Use Bash on Windows with Quoted Paths Source: https://github.com/denisidoro/navi/blob/master/docs/configuration/README.md Configure Navi to use a specific bash executable on Windows, handling paths with spaces by quoting and setting `forward_slash_path` to true. ```yaml shell: command: "C:/Program Files/Git/bin/bash.exe" finder_command: "C:/Program Files/Git/bin/bash.exe" forward_slash_path: true ``` -------------------------------- ### Import Cheatsheet Repositories via HTTPS Source: https://context7.com/denisidoro/navi/llms.txt Add cheatsheet repositories from GitHub using HTTPS. ```sh # Import via HTTPS navi repo add https://github.com/denisidoro/cheats ``` -------------------------------- ### Windows Configuration with Git Bash Source: https://context7.com/denisidoro/navi/llms.txt This YAML configuration sets up Navi to use Git Bash as the shell on Windows. It specifies the command to execute bash and sets the forward slash path option. ```yaml # config.yaml for Windows with Git Bash shell: command: "\"C:/Program Files/Git/bin/bash.exe\"" finder_command: "C:/Program Files/Git/bin/bash.exe" forward_slash_path: true ``` -------------------------------- ### Clone navi repository Source: https://github.com/denisidoro/navi/blob/master/docs/installation/README.md Clone the navi repository from GitHub to build from source or contribute. ```bash git clone https://github.com/denisidoro/navi && cd navi ``` -------------------------------- ### Construct Path with Implicit Variable Dependency Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/syntax/README.md Demonstrates implicit variable dependency where one variable references another using the standard syntax to construct a path. ```sh # Should print /my/pictures/wallpapers echo "" $ pictures_folder: echo "/my/pictures" $ wallpaper_folder: echo "/wallpapers" ``` -------------------------------- ### Bind Navi to Tmux Keybinding Source: https://github.com/denisidoro/navi/blob/master/docs/widgets/howto/TMUX.md Add this to your Tmux configuration file to open Navi with a specific key combination. It splits the window and loads Navi commands. ```sh bind-key -N "Open Navi (cheat sheets)" -T prefix C-g split-window \ "$SHELL --login -i -c 'navi --print | tmux load-buffer -b tmp - ; tmux paste-buffer -p -t {last} -b tmp -d'" ``` -------------------------------- ### Select 3rd Column with Header and Delimiter Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/syntax/README.md Use this to pick a specific column from command output, treating the first line as a header and specifying a delimiter. ```sh # This will pick the 3rd column and use the first line as header docker rmi $ image_id: docker images --- --column 3 --header-lines 1 --delimiter '\s\s+' ``` -------------------------------- ### Create Aliases with Navi Convention Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/syntax/README.md Simulate aliases by appending a convention like ':: ' to commands, intended for use when Navi is employed as a shell scripting tool. ```bash % aliases # This is one command :: el echo lorem ipsum ``` -------------------------------- ### Clone Repository for Auto-Updating Source: https://context7.com/denisidoro/navi/llms.txt Clone a repository to navi's cheats path for automatic updates. This sets up the repository for cron job updates. ```sh # Clone repository to navi's cheats path user="denisidoro" repo="cheats" git clone "https://github.com/${user}/${repo}" "$(navi info cheats-path)/${user}__${repo}" ``` -------------------------------- ### Navi Multiple Selection with Expand Source: https://context7.com/denisidoro/navi/llms.txt Allow users to select multiple values for a variable, which then expand into separate arguments for the command. This is useful for commands that accept multiple file paths. ```sh % files, json # Concatenate multiple JSON files cat # Multi-select with expand to pass each file as separate argument $ jsons: find . -iname '*.json' -type f -print --- --multi --expand ``` -------------------------------- ### Import Cheatsheet Repository via HTTPS Source: https://github.com/denisidoro/navi/blob/master/docs/usage/commands/repo/README.md Import a cheatsheet repository using its HTTPS URL. Ensure the repository is a valid git clone format. Note that $NAVI_PATH is not used for direct imports via navi commands. ```shell navi repo add https://github.com/denisidoro/cheats ``` -------------------------------- ### Use Third-Party Cheatsheets with Navi Source: https://context7.com/denisidoro/navi/llms.txt Search and utilize cheatsheets from external sources like tldr-pages or cheat.sh. ```sh # Search using tldr-pages navi --tldr docker # Search using cheat.sh navi --cheatsh docker # Search tldr for specific command navi --tldr "git commit" ``` -------------------------------- ### Use Cheat.sh Cheatsheets with Navi Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/README.md Query cheat.sh pages directly through Navi by prefixing your query with --cheatsh. ```sh navi --cheatsh ``` -------------------------------- ### Import Cheatsheet Repository via SSH Source: https://github.com/denisidoro/navi/blob/master/docs/usage/commands/repo/README.md Import a cheatsheet repository using its SSH URI. This method is an alternative to HTTPS for importing git-clone formatted repositories. Be aware that $NAVI_PATH is not utilized in this direct import process. ```shell navi repo add git@github.com:denisidoro/cheats ``` -------------------------------- ### Configure Column Widths in Navi Source: https://github.com/denisidoro/navi/blob/master/docs/configuration/README.md Set column widths relative to the terminal or as a minimum character count in the configuration file. ```yaml style: tag: width_percentage: min_width: comment: width_percentage: min_width: snippet: width_percentage: min_width: ``` -------------------------------- ### Navi Best Match Mode Source: https://context7.com/denisidoro/navi/llms.txt Execute the best matching command directly without interactive selection, useful for scripting. You can also set variable values and filter suggestions. ```sh # Auto-select best matching snippet navi --query 'create database' --best-match # Set variable values while calling branch="master" navi --query "change branch" --best-match # Filter variable suggestions branch__query="master" navi --query "change branch" --best-match # Select best match for variable branch__best="feature" navi --query "change branch" --best-match ``` -------------------------------- ### Configure Default Shell for Navi Commands Source: https://github.com/denisidoro/navi/blob/master/docs/configuration/README.md Set the default shell for executing commands that generate variable values and for use within fzf. ```yaml shell: command: bash finder_command: bash ``` -------------------------------- ### Vim Syntax Highlighting Rules for Navi Source: https://github.com/denisidoro/navi/blob/master/docs/widgets/howto/VIM.md Add these Vim syntax rules to your Vim runtime syntax files to enable syntax highlighting for Navi. These rules are based on the Cheatsheet syntax. ```vim syntax match Comment "\v^;.*$" syntax match Statement "\v^%.*$" syntax match Operator "\v^#.*$" syntax match String "\v\<.{,-}"\>" syntax match String "\v^$.*$" ``` -------------------------------- ### Export NAVI_PATH Environment Variable Source: https://github.com/denisidoro/navi/blob/master/docs/configuration/README.md Define the cheatsheets path using the $NAVI_PATH environment variable. This variable accepts a colon-separated list of directories. ```sh export NAVI_PATH='/path/to/a/dir:/path/to/another/dir:/yet/another/dir' ``` -------------------------------- ### Define Cheatsheets Paths in Configuration File Source: https://github.com/denisidoro/navi/blob/master/docs/configuration/README.md Specify the cheatsheets path within the Navi configuration file. Supports multiple paths for Unix-like systems and Windows. ```yaml cheats: paths: - /path/to/some/dir # on unix-like os - F:\\path\\to\\dir # on Windows ``` -------------------------------- ### Define Cheatsheet Path at Runtime Source: https://github.com/denisidoro/navi/blob/master/docs/usage/README.md Use the `--path` parameter to specify a colon-separated list of directories to search for cheatsheets. This is useful for organizing cheatsheets across multiple locations. ```sh navi --path '/some/dir:/other/dir' ``` -------------------------------- ### Nushell Navi Integration - Save Widget Output Source: https://github.com/denisidoro/navi/blob/master/docs/widgets/README.md Save the output of 'navi widget nushell' to a file in Nushell's default config directory. This is the first step for integrating Navi with Nushell. ```nushell ^navi widget nushell | save ($nu.default-config-dir | path join "navi-integration.nu") ``` -------------------------------- ### Advanced Variable Options with fzf Source: https://context7.com/denisidoro/navi/llms.txt Use fzf-compatible options in variable definitions for enhanced selection behavior. This snippet is a placeholder for advanced variable configurations. ```sh % advanced, variables ``` -------------------------------- ### Provide Multiple Choices with Explicit Variable Dependency Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/syntax/README.md Shows explicit variable dependency using '$' to prepend variable names, enabling multiple choices for variables based on previous selections. ```sh # If you select "hello" for , the possible values of will be "hello foo" and "hello bar" echo # If you want to ignore the contents of and only print : ; echo $ x: echo "hello hi" | tr ' ' '\n' $ y: echo "$x foo;$x bar" | tr ';' '\n' ``` -------------------------------- ### Call a Navi Cheat Source: https://github.com/denisidoro/navi/blob/master/docs/usage/shell-scripting/README.md Use this to call a Navi cheat directly from your shell script. Navi will prompt for any required variables. ```shell navi --query "change branch" --best-match ``` -------------------------------- ### Navigate to Navi Default Cheats Path (After 2.25.0) Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/README.md Use this command to change the directory to the default Navi cheats path for versions 2.25.0 and later. ```bash cd $(navi info default-cheats-path) ``` -------------------------------- ### Multiline Commands as Snippets Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/syntax/README.md Define multiline commands, referred to as snippets, using standard shell syntax with line continuation characters. ```sh % bash, foo # This will output "foo\nyes" echo foo true \ && echo yes \ || echo no ``` -------------------------------- ### Navigate to Navi Cheats Path (Before 2.25.0) Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/README.md Use this command to change the directory to your Navi cheats path for versions prior to 2.25.0. ```bash cd $(navi info cheats-path) ``` -------------------------------- ### Clone a Cheatsheet Repository Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/repositories/README.md Clone a cheatsheet repository to the specified folder using git. Replace `` and `` with your GitHub username and repository name. ```shell user="" repo="" git clone "https://github.com/${user}/${repo}" "$(navi info cheats-path)/${user}__${repo}" ``` -------------------------------- ### Select Best Match for a Variable in Navi Source: https://github.com/denisidoro/navi/blob/master/docs/usage/shell-scripting/README.md Use the `__best` suffix to specify the best match for a variable when calling a Navi cheat. This prevents interactive prompts and uses the provided value directly. ```shell branch__best="master" navi --query "change branch" --best-match ``` -------------------------------- ### Override FZF Globally with Environment Variable Source: https://github.com/denisidoro/navi/blob/master/docs/usage/fzf-overrides/README.md Set the `FZF_DEFAULT_OPTS` environment variable to apply custom FZF options to all Navi operations. ```bash FZF_DEFAULT_OPTS="--height 3" navi ``` -------------------------------- ### Define Navi Alias with Full Comments Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/syntax/README.md Define a bash function to query Navi for a specific command, allowing for full comments within the alias definition. This provides more descriptive aliases. ```bash navibestmatch() { navi --query "$1" --best-match } alias el="navibestmatch 'This is one command'" alias ef="navibestmatch 'This is another command'" ``` -------------------------------- ### Navi Variable Dependencies Source: https://context7.com/denisidoro/navi/llms.txt Define variables that depend on other variables. This can be implicit using `` syntax or explicit using `$variable`. ```sh % filesystem, paths # Print wallpaper folder path echo "" # Implicit dependency using syntax $ pictures_folder: echo "/my/pictures" $ wallpaper_folder: echo "/wallpapers" --- % interactive, choices # Print selected values echo # Explicit dependency using $variable $ x: echo "hello hi" | tr ' ' '\n' $ y: echo "$x foo;$x bar" | tr ';' '\n' ``` -------------------------------- ### Define Variables While Calling a Cheat Source: https://github.com/denisidoro/navi/blob/master/docs/usage/shell-scripting/README.md Set variables beforehand when calling a Navi cheat to avoid interactive prompts. The specified variable value will be used directly. ```shell branch="master" navi --query "change branch" --best-match ``` -------------------------------- ### Share Context with Extended Cheats Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/syntax/README.md Extend a cheat context by using the same tags in multiple cheats. This allows sharing variables and context across different commands. ```sh % dirs, common $ pictures_folder: echo "/my/pictures" % wallpapers @ dirs, common # Should print /my/pictures/wallpapers echo "/wallpapers" % screenshots @ dirs, common # Should print /my/pictures/screenshots echo "/screenshots" ``` -------------------------------- ### Filter Navi Cheat Results for a Variable Source: https://github.com/denisidoro/navi/blob/master/docs/usage/shell-scripting/README.md Filter Navi cheat results by providing a value for a specific variable using the `__query` suffix. Interactive prompts will still appear unless a single entry is automatically selected. ```shell branch__query="master" navi --query "change branch" --best-match ``` -------------------------------- ### Expand Variable to Multiple Arguments Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/syntax/README.md Use the --expand parameter to convert each line of a variable's output into a separate argument, useful for commands like cat with multiple files. ```sh # This will result into: cat "file1.json" "file2.json" cat $ jsons: find . -iname '*.json' -type f -print --- --multi --expand ``` -------------------------------- ### Override fzf Options During Cheat Selection (Environment Variable) Source: https://github.com/denisidoro/navi/blob/master/docs/configuration/README.md Set the NAVI_FZF_OVERRIDES environment variable to customize fzf behavior during cheat selection. ```bash export NAVI_FZF_OVERRIDES='--height 3' ``` -------------------------------- ### Define Navi Alias Function Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/syntax/README.md Create a bash function to query Navi for a specific command using a prefix. This is useful for creating shortcuts. ```bash navialias() { navi --query ":: $1" --best-match } alias el="navialias el" alias ef="navialias ef" ``` -------------------------------- ### Limit fzf Search to First Two Columns Source: https://context7.com/denisidoro/navi/llms.txt Customize fzf behavior for snippet selection using command-line flags. This limits the search to the first two columns. ```sh # Only search first two columns navi --fzf-overrides '--nth 1,2' ``` -------------------------------- ### Override fzf Options During Variable Value Selection (Environment Variable) Source: https://github.com/denisidoro/navi/blob/master/docs/configuration/README.md Use the NAVI_FZF_OVERRIDES_VAR environment variable to control fzf options when selecting variable values. ```bash export NAVI_FZF_OVERRIDES_VAR='--height 3' ``` -------------------------------- ### Multiline Commands in Markdown Code Blocks Source: https://github.com/denisidoro/navi/blob/master/docs/cheatsheet/syntax/README.md Embed multiline commands within Markdown code blocks, delimited by triple backticks, for better organization and readability. ```sh % git, code # Change branch ```sh git checkout ``` $ branch: git branch | awk '{print $NF}' ``` -------------------------------- ### Override FZF for Snippet Selection Source: https://github.com/denisidoro/navi/blob/master/docs/usage/fzf-overrides/README.md Use the `--fzf-overrides` argument to apply custom FZF options specifically when selecting snippets. ```sh navi --fzf-overrides '--height 3' ``` -------------------------------- ### Override fzf Options During Variable Value Selection (Config) Source: https://github.com/denisidoro/navi/blob/master/docs/configuration/README.md Configure fzf overrides for variable value selection within the Navi configuration file. ```yaml finder: command: fzf overrides_var: --height 3 ``` -------------------------------- ### Override FZF for Argument Value Selection Source: https://github.com/denisidoro/navi/blob/master/docs/usage/fzf-overrides/README.md Use the `--fzf-overrides-var` argument to apply custom FZF options specifically when selecting argument values. ```sh navi --fzf-overrides-var '--height 3' ``` -------------------------------- ### Prevent typing custom values for branch selection Source: https://context7.com/denisidoro/navi/llms.txt This snippet demonstrates how to use navi to select a git branch without allowing the user to type custom values. It uses `git branch` to list branches and restricts input to selection only. ```bash git checkout $ branch: git branch --format='%(refname:short)' --- --prevent-extra ``` -------------------------------- ### Deprecated Cheatsheets Path Directive Source: https://github.com/denisidoro/navi/blob/master/docs/configuration/README.md Previously, the cheatsheets path could be defined using the 'path' directive. This method is deprecated and will be removed in a future version. ```yaml cheats: path: /path/to/some/dir ``` -------------------------------- ### Remove PowerShell Navi Plugin Source: https://github.com/denisidoro/navi/blob/master/docs/widgets/README.md Use this command to remove the navi.plugin module from your PowerShell session. ```powershell Remove-Module navi.plugin ``` -------------------------------- ### Prevent fzf Auto-Selection Source: https://context7.com/denisidoro/navi/llms.txt Customize fzf behavior for snippet selection using command-line flags. This prevents auto-selection when there is only one result. ```sh # Prevent auto-selection when single result navi --fzf-overrides '--no-select-1' ``` -------------------------------- ### Override fzf Options During Cheat Selection (Config) Source: https://github.com/denisidoro/navi/blob/master/docs/configuration/README.md Specify fzf overrides for cheat selection directly in the configuration file. ```yaml finder: command: fzf overrides: --height 3 ``` -------------------------------- ### Define Custom Delimiter for Variable Parsing Source: https://github.com/denisidoro/navi/blob/master/docs/configuration/README.md Specify a custom regex delimiter for parsing selected variable results in the configuration file. This overrides the default whitespace delimiter. ```yaml finder: delimiter_var: ### By default the expression is \s\s+ ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.