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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ By default fifc override `tab`, but you can assign another keybinding:
set -U fifc_keybinding \cx
```

To append custom fzf options globally, for example to disable the `--exact` flag and increase the fuzziness:

```fish
set -U fifc_custom_fzf_opts +e
```

fifc can use modern tools if available:

| Prefer | Fallback to | Used for | Custom options |
Expand Down
6 changes: 3 additions & 3 deletions functions/_fifc.fish
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function _fifc
set -l result
set -Ux _fifc_extract_regex
set -gx _fifc_complist_path (string join '' (mktemp) "_fifc")
set -gx _fifc_custom_fzf_opts
set -gx fifc_effective_fzf_opts $fifc_custom_fzf_opts
set -gx fifc_extracted
set -gx fifc_commandline
set -gx fifc_token (commandline --current-token)
Expand Down Expand Up @@ -42,7 +42,7 @@ function _fifc
--preview '_fifc_action preview {} {q}' \
--bind='$fifc_open_keybinding:execute(_fifc_action open {} {q} &> /dev/tty)' \
--query '$fifc_safe_query' \
$_fifc_custom_fzf_opts"
$fifc_effective_fzf_opts"

set -l cmd (string join -- " | " $source_cmd $fzf_cmd)
# We use eval hack because wrapping source command
Expand Down Expand Up @@ -82,8 +82,8 @@ function _fifc
rm $_fifc_complist_path
# Clean state
set -e _fifc_extract_regex
set -e _fifc_custom_fzf_opts
set -e _fifc_complist_path
set -e fifc_effective_fzf_opts
set -e fifc_token
set -e fifc_group
set -e fifc_extracted
Expand Down
2 changes: 1 addition & 1 deletion functions/_fifc_action.fish
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function _fifc_action
eval $$comp[$i][4]
break
else if test "$action" = source; and test -n "$$comp[$i][5]"
set _fifc_custom_fzf_opts "$$comp[$i][6]"
set fifc_effective_fzf_opts $fifc_custom_fzf_opts $$comp[$i][6]
if functions "$$comp[$i][5]" 1>/dev/null
eval $$comp[$i][5]
else
Expand Down