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.

https://github.com/user-attachments/assets/c3e1e753-2c38-4c57-89ad-dcfca9cea85d

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

Features

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

Usual Directory Change

</div>

Synopsis: cd [string...]

[!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.<br>

<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...]<br>          cd .. 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 | --cleanup)

You can choose to either remove invalid paths from the history or clear the entire history. However, Navita will automatically remove non-existent and non-executable directories.

<div align="center">

Version Information

</div>

Synopsis: cd (-v | --version)

View Navita's version information.

<div align="center">

Tab Completion

</div> <!-- > [!TIP] > In Bash, you can make Readline perform filename matching and completion in a case-insensitive fashion by setting the `completion-ignore-case` variable to `on` in your *inputrc* file. For example, you can refer to my [inputrc file](https://github.com/CodesOfRishi/dotfiles/blob/main/Bash/.inputrc) or alternatively add `bind "set completion-ignore-case on"` in your `.bashrc` file. --> <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{Score} = \ln\left(\frac{F \times (T_2-T_1)}{T_2}+1\right) \times e^{\left(\frac{-k \times T_1}{T_2}\right)} $$

where:

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

Aging

</div> <!--<div align="center">--> <!----> <!--### Add Annotations--> <!----> <!--*Feature Name: UserAnnotations*--> <!----> <!--</div>--> <!----> <!--- Annotate a specific directory path with a note or comment that will appear in the [ViewHistory](view-history) or [NavigateHistory](search--traverse-History) feature.--> <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.

[!WARNING] The decay factor should always be positive. Only adjust the decay factor if you are confident in the algorithm's behavior with the new value.

<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> <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.