diff options
author | Ahmed ElSamhaa <assamhaa@gmail.com> | 2023-04-05 06:35:00 +0300 |
---|---|---|
committer | Ahmed ElSamhaa <assamhaa@gmail.com> | 2023-04-05 06:35:00 +0300 |
commit | 91d3f16d66da3e9bebd3b1097e011ca59cfe645f (patch) | |
tree | 99f278503718913816fa978a8b8b7105a425713e /README.md | |
parent | bd025a06bfc38843073a36a033671e0372d459b9 (diff) |
Adds ability to cd into last changed-to directory with ZZ
- Adds a new keymap ZQ to exit fx without changind the directory
- Adds to README.md a tip to add the function to better integrate with unix shells
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 30 |
1 files changed, 25 insertions, 5 deletions
@@ -2,10 +2,10 @@ # _felix_ -A tui file manager with Vim-like key mapping, written in Rust. +A tui file manager with Vim-like key mapping, written in Rust. Fast, simple, and easy to configure & use. -For an overview of this app, take a look at this README, especially [key manual](#key-manual). +For an overview of this app, take a look at this README, especially [key manual](#key-manual). For more detailed document, visit https://kyoheiu.dev/felix. - [New release](#new-release) @@ -81,7 +81,7 @@ cargo install felix pacman -S felix-rs ``` -*The launcher binary name is `felix` via pacman. +*The launcher binary name is `felix` via pacman. Alias fx='felix' if you want, as this document (and other installations) uses `fx`.* ### NetBSD @@ -104,6 +104,25 @@ cargo install --path . ## Integrations +In order for the shortcut `ZZ` to work, you need to add the following to your `.bashrc` or `.zshrc` +or an equivalent depending on your (POSIX) shell: +```sh +fx() { + SHELL_PID=$$ command fx + cd "$( + set -e + if [ -n "$XDG_RUNTIME_DIR" ]; then + local runtime_dir="$XDG_RUNTIME_DIR/felix" + else + local runtime_dir="$TMPDIR/felix" + fi + cat "$runtime_dir/$$" + # Clean up the current and any leftover lwd files + find "$runtime_dir" \( -type f -mtime +1s -or -name $$ \) -delete + )" +} +``` + In addition, you can use felix more conveniently by installing these two apps: - [zoxide](https://github.com/ajeetdsouza/zoxide): A smarter `cd` command, which enables you to jump to a directory that matches the keyword in felix. @@ -172,14 +191,15 @@ Esc :Return to the normal mode. :trash :Go to the trash directory. :empty :Empty the trash directory. :h :Show help. -:q / ZZ :Exit. +:ZZ :cd to current directory and Exit. +:q / ZQ :Exit. ``` <a id="preview"></a> ## Preview feature -By default, text files and directories can be previewed. +By default, text files and directories can be previewed. Install `chafa` and you can preview images without any configuration. <a id="configuration"></a> |