Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ fifc can use modern tools if available:
| [chafa](https://github.com/hpjansson/chafa) | file | Preview images, gif, pdf etc | `$fifc_chafa_opts` |
| [hexyl](https://github.com/sharkdp/hexyl) | file | Preview binaries | `$fifc_hexyl_opts` |
| [fd](https://github.com/sharkdp/fd) | find | Complete paths | `$fifc_fd_opts` |
| [exa](https://github.com/ogham/exa) | ls | Preview directories | `$fifc_exa_opts` |
| [eza](https://github.com/eza-community/eza) | ls | Preview directories | `$fifc_eza_opts` |
| [ripgrep](https://github.com/BurntSushi/ripgrep) | pcregrep | Search options in man pages | - |
| [procs](https://github.com/dalance/procs) | ps | Complete processes and preview their tree | `$fifc_procs_opts` |
| [broot](https://github.com/Canop/broot) | - | Explore directory trees | `$fifc_broot_opts` |
Expand All @@ -76,7 +76,7 @@ Show hidden file by default:

- `set -U fifc_fd_opts --hidden`

⚠️ Don't use quotes in variables, set them as a list: `set -U fifc_exa_opts --icons --tree`
⚠️ Don't use quotes in variables, set them as a list: `set -U fifc_eza_opts --icons --tree`

## 🛠️ Write your own rules

Expand Down
1 change: 0 additions & 1 deletion conf.d/fifc.fish
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ if status is-interactive
or set -U fifc_open_keybinding ctrl-o

for mode in default insert
bind --mode $mode \t _fifc
bind --mode $mode $fifc_keybinding _fifc
end

Expand Down
4 changes: 2 additions & 2 deletions functions/_fifc.fish
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function _fifc
set -gx fifc_group (_fifc_completion_group)
set source_cmd (_fifc_action source)

set fifc_fzf_query (string trim --chars '\'' -- "$fifc_fzf_query")
set fifc_safe_query (string unescape -- "$fifc_query")

set -l fzf_cmd "
_fifc_launched_by_fzf=1 SHELL=fish fzf \
Expand All @@ -41,7 +41,7 @@ function _fifc
--header '$header' \
--preview '_fifc_action preview {} {q}' \
--bind='$fifc_open_keybinding:execute(_fifc_action open {} {q} &> /dev/tty)' \
--query '$fifc_query' \
--query '$fifc_safe_query' \
$_fifc_custom_fzf_opts"

set -l cmd (string join -- " | " $source_cmd $fzf_cmd)
Expand Down
4 changes: 3 additions & 1 deletion functions/_fifc_preview_dir.fish
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
function _fifc_preview_dir -d "List content of the selected directory"
if type -q exa
if type -q eza
eza --color=always $fifc_eza_opts $fifc_candidate
else if type -q exa
exa --color=always $fifc_exa_opts $fifc_candidate
else
ls --color=always $fifc_ls_opts $fifc_candidate
Expand Down
4 changes: 2 additions & 2 deletions functions/_fifc_source_directories.fish
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
function _fifc_source_directories -d "Return a command to recursively find directories"
if type -q fd
set --local --export fifc_fd_opts -t d
set --local --export --append fifc_fd_opts -t d
_fifc_source_files
else
set --local --export fifc_find_opts -type d
set --local --export --append fifc_find_opts -type d
_fifc_source_files
end
end