Home

Awesome

<div align="center">

Navita: Navigate Smarter, Not Harder

Derived from "navigate" and "ita" (short for "iteration"), suggesting a tool that helps you navigate through iterations of directory visits.

FeaturesDependenciesInstallationEnvironment VariablesKnown CaveatsConcept/MotivationContributing to NavitaLicense

Tired of typing out long, complex directory paths? Navita is here to simplify your command-line experience! The powerful Bash tool uses fuzzy search to get you to your destination in seconds.

Forget about tedious typing. You can instantly find and jump to any directory, no matter how deeply nested. Navita is a great tool for boosting your productivity and saving you valuable time.

navita-demo3

</div> <div align="center">

Features

</div> <div align="center">

Usual Directory Change

</div>

Synopsis: cd [PCRE_EXPRESSION... | DIR]

[!NOTE] Navita will compare the last word of the string argument to the end of the paths in the history to determine the highest-ranked matching directory. You can override this behaviour by explicitly specifying $ (End-of-String Anchor) in your search string.<br>

<details> <summary> <b>Useful PCRE search syntaxes↴</b> </summary><br>
PatternInfo
aThe character a
abThe string ab
<code>a|b</code>a or b
a*0 or more a's
\Escapes a special character
*0 or more
+1 or more
?0 or 1
{2}Exactly 2
{2,5}Between 2 and 5
{2,}2 or more
[ab-d]One character of: a, b, c, d
[^ab-d]One character except: a, b, c, d
\dOne digit
\DOne non-digit
\sOne whitespace
\SOne non-whitespace
\wOne word character
\WOne non-word character
^Start of string
$End of string
\bWord boundary
\BNon-word boundary
[:alnum:]Letters and digits
[:alpha:]Letters
[:digit:]Decimal digits
[:ascii:]Ascii codes 0 - 127
[:blank:]Space or tab only
[:space:]Whitespace
[:lower:]Lowercase letters
[:upper:]Uppercase letters
[:word:]Word characters
</details> <div align="center">

Search & Traverse Child Directories

</div>

Synopsis: cd (-s | --sub-search) [STRING...]

Recursively search subdirectories, excluding .git and its subdirectories, and navigate to the selected one.

<div align="center">

Search & Traverse Parent Directories

</div>

Synopsis: cd (-S | --super-search | ..) [STRING...]

Search directories one level below the parent directories and navigate to the desired one. The current working directory will not be considered in the search.

<div align="center">

Search & Traverse History

</div>

Synopsis: cd -- [STRING...]

Search your recently visited directories and select the desired one. The current working directory will not be considered in the search.

[!NOTE] Visit a few directories after a clean or initial installation to build a history.

<div align="center">

View History

</div>

Synopsis: cd (-H | --history) [--by-time | --by-frequency | --by-score]

View Navita's history of visited directories. The history will be displayed in the less pager, or directly to STDOUT if it fits on a single screen. The output will be sorted based on the provided option:

<div align="center">

Toggle Current & Previous Directories

</div>

Synopsis: cd -

Switch between your current directory and the previous directory you were in. The previous directory is specific to the current shell.

<div align="center">

Clean-up History

</div>

Synopsis: cd (-c | --clean) [--invalid-paths | --ignored-paths | --custom-paths | --full-history]

You can choose to either remove invalid paths or paths matching regex in the $NAVITA_IGNOREFILE file or custom paths from the history, or clear the entire history.

<div align="center">

Version Information

</div>

Synopsis: cd (-v | --version)

View Navita's version information.

<div align="center">

View Help

</div>

Synopsis: cd (-h | --help)

View help message.

<div align="center">

Tab Completion

</div> <div align="center">

Path Exclusion for History

</div>

[!NOTE] Even if a path was part of the history prior to its inclusion in the $NAVITA_IGNOREFILE using a regular expression pattern, it will still be visible, but Navita will cease to boost its ranking.

<div align="center">

Frecency Directory Ranking

</div>

The Frecency algorithm ranks directories based on a combination of two factors:

This ensures that the most relevant directories—those accessed both frequently and recently—are ranked higher, while directories with older access are deprioritized.

<details> <summary>How it Works?</summary>

$$ \text{FrecencyScore(t)} = \ln\Bigg(k + \frac{10}{1+\alpha_1(t-T_0)} + \sum_{i=0}^{n} e^{-\alpha_2(t-T_i)} \Bigg) $$

where,

</details> <div align="center">

Aging

</div> <div align="center">

Additional Info

</div>

[!NOTE] If this option is used, it should be the very first option given to Navita.

<div align="center">

Dependencies

</div> <div align="center">

Installation

</div>
  1. Download the navita.sh file.
# using wget2
wget2 https://raw.githubusercontent.com/CodesOfRishi/navita/main/navita.sh

# or using curl
curl https://raw.githubusercontent.com/CodesOfRishi/navita/main/navita.sh --output navita.sh
  1. Source the navita.sh file in your .bashrc/.zshrc configuration file.
source "path/to/the/navita.sh"
<div align="center">

Environment Variables

</div>

[!NOTE] If you want to keep your desired values rather than the default ones, make sure to export these environment variables before sourcing the navita.sh file in your .bashrc/.zshrc.

<div align="center">

Non-Configurable Environment Variables

</div> <div align="center">

Known Caveats

</div> <div align="center">

Concept/Motivation

</div> <div align="center">

Contributing to Navita

</div>

To review the latest changes that have not yet been included in the latest release, check out the dev branch.

<div align="center">

Reporting Issues

</div>

If you encounter any bugs or issues while using Navita, please open an issue on the Navita GitHub repository. Provide as much detail as possible, including steps to reproduce the issue and any relevant error messages.

<div align="center">

License

</div>

This project is licensed under the Apache License 2.0. See the LICENSE for details.