diff options
| author | Liam Hupfer <liam@hpfr.net> | 2025-06-22 12:03:50 -0500 |
|---|---|---|
| committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2025-06-22 21:38:04 +0100 |
| commit | 36dc401bbd1a2081d25cfe6491f7aadb9e71d99d (patch) | |
| tree | bcd960691b3691930c54a5d9ce9cd4866880eea0 | |
| parent | a706e205cff0404013cb0ec2312c6a9ee20870c6 (diff) | |
gnu: fzf: Use bashrc.d for Bash integration.
fzf comes with two Bash integration files.
The first, completion.bash, enables fzf-powered completion of various
types (files, variable names, processes, etc) for various commands (cat,
export, kill, etc). This is in contrast with the Bash completions most
packages ship, which are based on the bash-completion package and only
include completions for the package binaries. The bash-completion
package lazily loads completions from bash_completion.d directories when
the user invokes completion for a given command. fzf’s completion.bash
shouldn’t be installed to etc/bash_completion.d/fzf, since it doesn’t
depend on bash-completion and it supplies completions for more than just
the fzf binary. Instead, install it to the more general bashrc.d, where
users can source it so fzf-powered completions are immediately available
for common commands.
The second, key-bindings.bash, provides fzf-based history search for C-r
as well as a couple other convenient bindings. Install it to bashrc.d as
well so users can source it.
* gnu/packages/terminals.scm (fzf): [phases]{install-completions}: Use
bashrc.d for Bash integration files.
Change-Id: Ied0ec1187a04bcc74d39ee22957fc9b4573b5992
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
| -rw-r--r-- | gnu/packages/terminals.scm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm index 23faaa9d8e0..1a1ce1d297e 100644 --- a/gnu/packages/terminals.scm +++ b/gnu/packages/terminals.scm @@ -44,6 +44,7 @@ ;;; Copyright © 2024 Ashvith Shetty <ashvithshetty10@gmail.com> ;;; Copyright © 2024, 2025 Artyom V. Poptsov <poptsov.artyom@gmail.com> ;;; Copyright © 2025 Roman Scherer <roman@burningswell.com> +;;; Copyright © 2025 Liam Hupfer <liam@hpfr.net> ;;; ;;; This file is part of GNU Guix. ;;; @@ -1025,16 +1026,18 @@ minimalistic.") `("PATH" ":" prefix (,(string-append ncurses "/bin"))))))) (add-after 'install 'install-completions (lambda* (#:key import-path #:allow-other-keys) - (let* ((bash-completion - (string-append #$output "/etc/bash_completion.d")) + (let* ((bashrc-functions + (string-append #$output "/etc/bashrc.d")) (fish-functions (string-append #$output "/share/fish/vendor_functions.d")) (zsh-completion (string-append #$output "/share/zsh/site-functions"))) (with-directory-excursion (string-append "src/" import-path) - (mkdir-p bash-completion) + (mkdir-p bashrc-functions) (copy-file "shell/completion.bash" - (string-append bash-completion "/fzf")) + (string-append bashrc-functions "/fzf-completion.bash")) + (copy-file "shell/key-bindings.bash" + (string-append bashrc-functions "/fzf-bindings.bash")) (mkdir-p fish-functions) (copy-file "shell/key-bindings.fish" (string-append fish-functions "/fzf_key_bindings.fish")) |
