Simplifying terminal navigation
goto
is a lightweight terminal tool that simplifies directory navigation.
Coming soon!
git clone https://github.com/gabrielg2020/goto.git
cd goto
go build -o goto ./cmd/
PATH
:mv goto /usr/local/bin/
Please make sure that these are installed.
Run the provided setup script to automate this setup:
./setup.sh
Add the following function to your .bashrc
or .zshrc
:
goto() {
dir=$(/usr/local/bin/goto "$@")
if [ -d "$dir" ]; then
echo "Changing directory to: $dir"
cd "$dir"
else
echo "No directory selected or invalid directory: $dir"
fi
}
[!NOTE] Coming soon!
goto --help
goto <pattern>
goto src
Option | Description |
---|---|
-d |
Specify maximum search depth. |
-h |
Display help message. |
<pattern> |
Fuzzy search pattern for directories. |
goto
allows you to customize its behavior using a configuration file. This file provides options to define default search settings and exclude specific directories from the results.
The configuration file is located at: ~/.goto_config.yaml
This file is optional. If it doesn’t exist, goto
uses sensible defaults.
The configuration file is written in YAML format. Below is an example configuration:
maxDepth: <integer>
excludeDirs:
- <string>
- <string>
Option | Description | Default |
---|---|---|
maxDepth |
Maximum search depth. | 5 |
excludeDirs |
Directories to be excluded from the search. | ".git", "node_modules" |
Here’s a complete example of a typical .goto_config.yaml
file:
maxDepth: 5
excludeDirs:
- build
- dist
- .cache
This guide explains the architecture, key decisions, and trade-offs made during the development of goto
.
Directory/File | Description |
---|---|
cmd/main.go |
Entry point for the application. |
cmd/pkg/search.go |
Logic for directory searching using find and fzf . |
cmd/pkg/config.go |
Logic for dealing with user configurations. |
setup.sh |
Shell integration setup script. |
test/ |
Unit tests. |
find
and fzf
?find
is robust and handles directory traversal efficiently.fzf
provides a fast, well-supported fuzzy search interface..bashrc
and .zshrc
enable seamless navigation.goto
files:
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Coming soon!