Crates.io | fogo |
lib.rs | fogo |
version | 0.1.3 |
source | src |
created_at | 2024-11-24 11:14:23.039376 |
updated_at | 2024-11-24 14:00:07.596416 |
description | 📂 Fogo: A fast terminal file explorer replacing cd and ls for quick folder navigation. |
homepage | https://trinhminhtriet.com/ |
repository | https://github.com/trinhminhtriet/fogo/ |
max_upload_size | |
id | 1459156 |
size | 253,278 |
__
/ _| ___ __ _ ___
| |_ / _ \ / _` | / _ \
| _|| (_) || (_| || (_) |
|_| \___/ \__, | \___/
|___/
fogo is a fast, minimal terminal file explorer designed to streamline your navigation workflow. Instead of relying on repeated use of cd
and ls
to browse your filesystem, fogo provides a simple and efficient Text User Interface (TUI) for navigating folders.
fogo is not a file manager. It cannot manipulate files or directories—its purpose is strictly navigation.
Efficient filesystem navigation is essential for developers and power users. fogo simplifies this process, helping you move around your terminal quickly without breaking focus.
To install fogo, simply clone the repository and follow the instructions below:
git clone git@github.com:trinhminhtriet/fogo.git
cd fogo
cargo build --release
cp ./target/release/fogo /usr/local/bin/
cd
using fogo
fogo
only prints a folder when it exits. To make your shell actually cd
to this folder, you have to define a function or alias, since the working directory cannot be changed by a subprocess. See instructions for your shell below.
Put this in your .bashrc
or .zshrc
:
fogo() {
local result=$(command fogo "$@")
[ -n "$result" ] && cd -- "$result"
}
Put this in your config.fish
:
function fogo
set --local result (command fogo $argv)
[ -n "$result" ] && cd -- "$result"
end
Put this in your .xonshrc
(Xonsh v0.10. or newer is required):
def _fogo(args):
result = $(fogo @(args)).strip()
if result:
cd @(result)
aliases["fogo"] = _fogo
Put this in your config.nu
(Nushell 0.88.0 or newer is required):
def --wrapped --env fogo [...args]: {
let result = ( ^fogo ...$args )
if $result != "" {
cd $result
}
}
Put this in your $PROFILE
:
function Invoke-Tere() {
$result = . (Get-Command -CommandType Application fogo) $args
if ($result) {
Set-Location $result
}
}
Set-Alias fogo Invoke-Tere
Put this in a batch script file called fogo.bat
in a folder included in your PATH
environment variable such as C:\Windows
:
@echo off
rem set the location/path of the fogo executable here...
SET TereEXE=C:\path\to\fogo.exe
FOR /F "tokens=*" %%a in ('%TereEXE% %*') do SET OUTPUT=%%a
IF ["%OUTPUT%"] == [""] goto :EOF
cd %OUTPUT%
Note that if you want to make fogo
work with both PowerShell and CMD, you should not put fogo.exe
to a location that is in your PATH
, because then the .exe
will be run instead of the .bat
. Place fogo.exe
somewhere that is not in your PATH
, and use the full path to the exe in both the .bat
file and in the PowerShell $PROFILE
.
If fogo
is not in your PATH
, use an absolute path to the fogo binary in your shell config file. For example, for Bash/Zsh, you would need to replace local result=$(command fogo "$@")
with local result=$(/path/to/fogo "$@")
, or for PowerShell, replace (Get-Command -CommandType Application fogo)
with C:\path\to\fogo.exe
.
fogo
has the following keyboard shortcuts by default:
Description | Default shortcut(s) | Action name |
---|---|---|
Enter directory under cursor | Enter or → or Alt-↓ or Alt-l or if not searching, Space | ChangeDir |
Go to parent directory | ← or Alt-↑ or Alt-h or if not searching, Backspace or - | ChangeDirParent |
Go to home directory | ~ or Ctrl-Home or Ctrl-Alt-h | ChangeDirHome |
Go to root directory | / or Alt-r | ChangeDirRoot |
Move cursor up | ↑ or Alt-k | CursorUp |
Move cursor down | ↓ or Alt-j | CursorDown |
Move cursor up by one screen | Page Up or Ctrl-u or Alt-u | CursorUpScreen |
Move cursor down by one screen | Page Down or Ctrl-d or Alt-d | CursorDownScreen |
Move cursor to the top | Home or Alt-g | CursorTop |
Move cursor to the bottom | End or Alt-Shift-g | CursorBottom |
Erase a character from the search | Backspace if searching | EraseSearchChar |
Clear the search | Esc if searching | ClearSearch |
Toggle filter search | Alt-f | ChangeFilterSearchMode |
Change case sensitivity mode | Alt-c | ChangeCaseSensitiveMode |
Change gap search mode | Ctrl-f | ChangeGapSearchMode |
Change sorting mode | Alt-s | ChangeSortMode |
Refresh current directory | Ctrl-r | RefreshListing |
Show help screen | ? | Help |
Exit fogo |
Esc or Alt-q | Exit |
Enter directory and exit fogo |
Alt-Enter or Ctrl-Space | ChangeDirAndExit |
Exit fogo without changing directory |
Ctrl-c | ExitWithoutCd |
Some of the shortcuts starting with Alt should be familiar to Vim users.
Keyboard shortcuts in fogo
can be customized using the --map
(or -m
) command-line option. Mappings follow these formats:
--map key-combination:action
--map key-combination:context:action
key-combination
): Specifies a key or combination, e.g., ctrl-x
.action
): Represents a predefined operation such as Exit
or ChangeDir
(refer to the --help
output or documentation for a full list).context
): Optional, determines when the mapping applies, e.g., Searching
or NotSearching
.To remove a mapping, specify None
as the action:
--map key-combination:None
You can define multiple mappings by:
--map
option:
--map combination1:action1 --map combination2:action2
--map combination1:action1,combination2:action2
For additional examples and a full list of actions, use the --help
option.
fogo
enables fast folder navigation with its incremental search feature. Simply type to begin searching for items in the current directory. Matching results are highlighted dynamically, and navigation is limited to those matches. Key behaviors include:
Default Behavior:
fogo
searches folders only, as it cannot operate on files. Use the --files
option to modify this behavior.--ignore-case
, --case-sensitive
, or toggle it with Alt-c.Search Modes:
dt
matches both DeskTop
and DocumenTs
.--gap-search-anywhere
: Allows matches even if the first query character doesn’t align with the folder name’s start.--normal-search
or --normal-search-anywhere
to enforce strict matching of consecutive characters.Toggle search modes dynamically using Ctrl-f.
While fogo
is optimized for keyboard use, it supports mouse navigation when enabled via --mouse=on
.
Mouse navigation is disabled by default for compatibility.
fogo
offers various options to customize its behavior:
--help
, -h
: Display a help summary and available options (output to stderr
).--version
, -V
: Show the current version of fogo
.--filter-search
, -f
/ --no-filter-search
, -F
: Choose whether to show only matching items (--filter-search
) or all items (--no-filter-search
) while searching.--files
, -l ignore/hide/match
: Configure file handling during search:
ignore
(default): Searches folders only.hide
: Displays folders but hides files.match
: Matches both files and folders (useful for verifying file presence).--smart-case
, -S
/ --ignore-case
, -i
/ --case-sensitive
, -s
: Configure case sensitivity.--gap-search
, -g
/ --gap-search-anywhere
, -G
/ --normal-search
, -n
/ --normal-search-anywhere
, -N
: Customize search behavior (see Searching above).--sort name/created/modified
: Change sorting criteria for listed items.--autocd-timeout
: Automatically navigate to a matching folder after a specified timeout in milliseconds (use off
to disable).--history-file
: Define the path to save folder navigation history (default: $CACHE_DIR/fogo/history.json
). Set to ''
to disable saving history.--mouse=on/off
: Enable or disable mouse navigation.For options with opposing flags (e.g., --filter-search
vs. --no-filter-search
), the last specified option takes precedence. This allows default settings in shell configuration files while permitting overrides during runtime.
For more detailed information, refer to --help
.
We welcome contributions!
git checkout -b my-feature
;git commit -m "feat: my new feature"
;git push origin my-feature
.Once your pull request has been merged, you can delete your branch.
This project is licensed under the MIT License - see the LICENSE file for details.