summaryrefslogtreecommitdiff
path: root/shell/key-bindings.fish
AgeCommit message (Collapse)Author
2025-10-12feat: Allow disabling Ctrl-R binding in shell integration (#4535)Jacobo de Vera
Close #4417
2025-10-09CTRL-R: Bind ALT-R to toggle-rawJunegunn Choi
2025-10-09Add '--bind ctrl-x:toggle-raw' to CTRL-R bindingsJunegunn Choi
2025-04-28[fish] Support deleting history items with SHIFT-DELbitraid
Bind to SHIFT-DELETE a command that deletes the selected history items. It can be overridden by $FZF_CTRL_R_OPTS.
2025-04-28[fish] Simplify commandline call in fzf-file-widgetbitraid
2025-04-28[fish] Add version checkbitraid
2025-04-28[fish] History: Operate only on line at cursorbitraid
This allows inserting history entries when constructing multiline commands.
2025-04-18[fish] Improve option prefix processingbitraid
- Support single-letter options without = such as -fFILEPATH - fish v3.3.0 and newer: Disable option prefix if -- is preceded
2025-04-18[fish] Fix whitespace/regex characters in command linebitraid
This is a rewrite of __fzf_parse_commandline function, that fixes the following issues, when CTRL-T/ALT-C is used and current command line token contains: - Escaped newlines (\n): This never worked correctly, but after 282884a, the string would split, and the script would enter an infinite loop while trying to set $dir. - Escaped bell (\a, \cg), backspace (\b), form feed (\v, \cl), carriage return (\r), vertical tab (\v, \ck): walker-root would not set correctly for existing directories containing any of those characters. - Regular expression special characters (^, +, ? etc): $dir would not be be stripped from $fzf_query if it contained any of those characters. The lowest supported fish version is v3.1b. For optimal operation, the function uses more recent commands when supported by the running version. Specifically, for versions equal or newer than: - v3.2.0: Sets variables using PCRE2 capture groups of `string match --regex` when needing to preserve any trailing newlines and simultaneously omit the extra newline that is appended by `string collect -N`. - v3.5.0: Uses the builtin path command for path normalization, dirname extraction and existing directories check. - v4.0.0: Uses the --tokens-expanded option of commandline, for expansion and dealing with unbalanced quotes and incomplete escape sequences. It also uses the regex style of string-escape, to prepare variable contents for regex operations. This is not used in older versions, because they don't escape newlines.
2025-04-18[fish] Fix for file/dir names containing newlinesbitraid
CTRL-T/ALT-C now works correctly when selecting files or directories that contain newlines in their names. When external commands defined by $FZF_CTRL_T_COMMAND/$FZF_ALT_C_COMMAND are used (for example the fd command with -0 switch), the --read0 option must also be set through $FZF_CTRL_T_OPTS/$FZF_ALT_C_OPTS.
2025-02-26[fish] Enable multiple history commands insertion (#4280)bitraid
Enable inserting multiple history commands. To disable, set `--no-multi` through `$FZF_CTRL_R_OPTS`. Also, remove the usage of `become` action, to avoid leaving behind temporary files. Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2025-02-20[fish] Add comment about fish version compatibilitybitraid
2025-02-20[fish] Reorder functionsbitraid
Move the helper functions to the top of the main function, and the main function commands (bind command) to the bottom.
2025-02-20[fish] Refactor bind commandsbitraid
Use single check for each default command variable.
2025-02-20[fish] Refactor fzf-cd-widgetbitraid
- Remove check/set of FZF_TMUX_HEIGHT variable. It is already done by __fzf_defaults. - Remove unnecessary begin/end block. - Simplify result variable check. - Set the command line using a single call to commandline.
2025-02-20[fish] Refactor fzf-history-widgetbitraid
- Remove check/set of FZF_TMUX_HEIGHT variable. It is already done by __fzf_defaults. - Remove unnecessary begin/end block. - Pass all fzf options (except query) through FZF_DEFAULT_OPTS variable.
2025-02-20[fish] Refactor fzf-file-widgetbitraid
- Remove check/set of FZF_TMUX_HEIGHT variable. It is already done by __fzf_defaults. - Remove unnecessary begin/end block. - Simplify result variable check. - Insert file names using a single call to commandline.
2025-02-20[fish] Refactor __fzf_parse_commandline, remove __fzf_get_dirbitraid
The __fzf_get_dir function was called only once, and was basically a single command in a while loop.
2025-02-20[fish] __fzfcmd: Don't set FZF_TMUXbitraid
The FZF_TMUX variable check has already been changed from numeric to string, so there is no need to set it to 0 if it's empty or undefined.
2025-02-20[fish] Refactor __fzf_defaultsbitraid
Append all arguments after the first one, so that functions don't have to pass all appending options as a single string. Also, output everything as a single string (an array of one item).
2025-02-11[fish] Unescape query from commandline (#4236)bitraid
More natural processing of the query taken from command line, by unquoting/unescaping the token. Unescaped open quotes are removed. Because of how `string unescape` works, if both single and double quotes are present, with the outer quotes open, only the outer quotes are removed. Examples: `'foo bar'`, `"foo bar"`, `foo\ bar` becomes `foo bar` `"foobar`, `'foobar`, `foo"bar`, `foo'bar` becomes `foobar` `'"foo"'`, `'"foo"` becomes `"foo"` `"'foo'"`, `"'foo'` becomes `'foo'` `"'foo` becomes `'foo` `'"foo` becomes `"foo`
2025-02-08[fish] Fix for directories with special characters (#4230)bitraid
Using CTRL-T or ALT-C when the current command line token contained a directory with special characters, the script would fail to detect it. For exampe, an existing directory named `it\'s\ a\ test`, instead of using it as walker-root, it would use it as the query.
2025-01-28[fish] Improve fish binary path detection (#4208)bitraid
Instead of exporting a local `$SHELL` containing the location of fish in `$PATH` when global `$SHELL` is not fish, always set `--with-shell` with the actual binary path of fish that the function is running from.
2025-01-28Enhance --min-height option to take number followed by +Junegunn Choi
2025-01-24[fish] Fix compatibility with v3.1.2 - v3.3.1 (#4200)bitraid
Don't use the command substitution syntax: $(cmd) Fix #4196
2025-01-19[fish] Allow setting multi-select and list reload for history (#4179)bitraid
* [fish] Drop support for versions older than 3.0b1 * [fish] Use `set` instead of `read` for `$result` This effectively makes CTRL-R non-blocking (the previous attempt was unsuccessful). * [fish] Allow FZF_CTRL_R_OPTS to set multi-select
2025-01-18[fish] CTRL-R: Make loading non-blockingJunegunn Choi
2025-01-12[fish] Optimize history formatting without perl (#4171)bitraid
2025-01-10[fish] Fix history formatting when perl is missing (#4166)bitraid
Don't add tab after escaped newline.
2025-01-09[fish] remove defunct bind feature detection (#4165)Kid
2024-12-20[fish] Partly revert change of 0167691 (#4137)bitraid
Don't use the `-f` switch of `string split`, because it was added in fish version 3.2.0.
2024-12-19[fish] Small syntax modification of some commandsbitraid
No actual change, just for consistency with the rest of the code.
2024-12-19[fish] Enable home dir expansion of leading ~/bitraid
Enable expanding to user's home directory, when pressing <Ctrl-T> or <Alt-C>, and the current command line token starts with `~/`.
2024-12-19[fish] Don't strip leading dot (.) characterbitraid
Fix the removal of the leading dot character from the query, when <Ctrl-T> was pressed and the current command line token started with a dot. It was also removed when <Alt-C> was pressed and the directory didn't exist under the current path.
2024-11-18[fish] Enable keys for scripts that use readbitraid
Remove the check that exits when the shell is non-interactive, so that the key bindings will work for the read command, when used by scripts.
2024-11-18[fish] Use more native syntaxbitraid
Mainly, replace [ with test. Also, change $FZF_TMUX check from numeric to string, so that it won't show error if doesn't contain a number.
2024-11-18[fish] Format history using builtins if perl is missingbitraid
2024-11-18[fish] Replace external commands with builtinsbitraid
- Use `string collect` instead of cat to get the contents of $FZF_DEFAULT_OPTS_FILE. Also, check if the file is readable first. - Use `string split` instead of cut to set $FISH_MAJOR, $FISH_MINOR. - Use `string replace` instead of perl to strip leading tabs.
2024-11-18[fish] Improve commandline parsingbitraid
- Enable using unescaped quotes for exact-match, exact-boundary-match. - Enable suffix-exact-match. - Enable inverse-exact-match, inverse-prefix/suffix-exact-match. - Allow searching for double quotes and backslashes. - Combine multiple consecutive slashes into one. - Workaround for test command bug, allowing $dir or $commandline be a single `!`.
2024-07-17fix(fish): partially revert dbe8dc3 by removing the 'builtin' for cdLangLangBart
2024-07-08Bind CTRL-/ and ALT-/ to toggle-wrap by defaultJunegunn Choi
2024-06-12[fish] Merge history before searching (#3852)ismay
Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2024-06-01[fish] Use builtins for cd and history (#3830)LangLangBart
Close #3826
2024-05-31[fish] Add --nth 2..,.. to allow anchored search against commandJunegunn Choi
2024-05-30[fish] Use perl instead of sed to strip leading tabsJunegunn Choi
https://github.com/junegunn/fzf/pull/3807#discussion_r1619520105
2024-05-29[fish] Better multi-line support for CTRL-RJunegunn Choi
Prepend each entry with an index number so that multi-line entries can be clearly distinguished.
2024-05-29[shell] Add --highlight-line to CTRL-R bindingsJunegunn Choi
2024-04-19Respect $FZF_DEFAULT_OPTS_FILE in key bindings and completion (#3742)Junegunn Choi
Fix #3740
2024-03-31[fish] Fix $dir in FZF_{CTRL_T,ALT_C}_COMMAND not evaluatedJunegunn Choi
Fix #3705
2024-03-19[fish] Fix Ctrl-T and Alt-C not using last token as search root (#3684)zeertzjq