FileCTRL is a light, opinionated, responsive, theme-able, and simple Text User Interface (TUI) file manager for Linux and macOS
git clone
andcd
into this repository- Run
cargo build --release && sudo cp target/release/filectrl /usr/local/bin/
Run filectrl --help
to view the available command line arguments and options:
Usage: filectrl [<directory>] [-c <config>] [--write-config]
FileCTRL is a light, opinionated, responsive, theme-able, and simple
Text User Interface (TUI) file manager for Linux and macOS
Positional Arguments:
directory path to a directory to navigate to
Options:
-c, --config path to a configuration file
--write-config write the default config to ~/.config/filectrl/config.toml,
then exit
--help display usage information
Normal mode
Keys | Description |
---|---|
q | Quit |
j / k | Move selection down / Up |
Backspace, Left, b, h | Navigate to the parent directory |
Enter, Right, f, l | Open the selected file or navigate to the selected directory |
CTRL+f, CTRL+d PgDn | Move selection and scroll down one page |
CTRL+b, CTRL+u, PgUp | Move selection and scroll up one page |
Home, ^ | Select the first item |
End, $ | Select the last item |
Delete | Delete the selected file or directory |
r, F2 | Rename the selected file or directory |
CTRL+r, F5 | Refresh |
n | Sort by name (toggle direction if already sorted) |
m | Sort by modified (toggle direction if already sorted) |
s | Sort by size (toggle direction if already sorted) |
e | Clear error messages |
p | Clear progress bar |
? | Toggle help |
Filtered mode
Keys | Description |
---|---|
Esc | Exit filtered mode |
Input mode
Keys | Description |
---|---|
Esc | Exit input mode |
Enter | Submit your input and exit input mode |
The configuration is drawn from the first of the following:
- The path specified by the command line option:
--config-path
- The default path, if it exists:
~/.config/filectrl/config.toml
- The built-in default configuration
Run filectrl --write-config
to write the default configuration to ~/.config/filectrl/config.toml
.
Keyboard key | Description |
---|---|
f | Open the selected file using the default application configured in your environment |
o | Open the selected file using the program configured by: open_selected_file_template |
t | Open the current directory in the program configured by: open_current_directory_template |
w | Open a new filectrl window in the terminal configured by: open_new_window_template |
# %s will be replaced by the current directory path:
open_current_directory_template = "alacritty --working-directory %s"
# %s will be replaced by the selected file or directory path:
open_selected_file_template = "pcmanfm %s"
All colors can be changed by editing the configuration file:
filectrl --write-config
vim ~/.config/filectrl/config.toml
You can see all of the available theme variables in the default configuration.
You can make filectrl
the default application for opening directories. Start by copying the filectrl.desktop
file to ~/.local/share/applications/
:
cp filectrl.desktop ~/.local/share/applications/
xdg-mime default filectrl.desktop inode/directory
update-desktop-database ~/.local/share/applications/
- andornaut@github /til/rust
- See Cargo.toml for dependencies.
cargo clippy
cargo fix --allow-dirty --allow-staged
cargo test
cargo run
cargo build --release
./target/debug/filectrl
# Log to ./err
RUST_LOG=debug cargo run 2>err
Changing cargo-husky configuration:
- Edit the
[dev-dependencies.cargo-husky]
section of Cargo.toml rm .git/hooks/pre-commit
(or other hook file)cargo clean
cargo test
- Verify that the changes have been applied to
.git/hooks/pre-commit