mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
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>
This commit is contained in:
parent
a706e205cf
commit
36dc401bbd
1 changed files with 7 additions and 4 deletions
|
@ -44,6 +44,7 @@
|
||||||
;;; Copyright © 2024 Ashvith Shetty <ashvithshetty10@gmail.com>
|
;;; Copyright © 2024 Ashvith Shetty <ashvithshetty10@gmail.com>
|
||||||
;;; Copyright © 2024, 2025 Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
;;; Copyright © 2024, 2025 Artyom V. Poptsov <poptsov.artyom@gmail.com>
|
||||||
;;; Copyright © 2025 Roman Scherer <roman@burningswell.com>
|
;;; Copyright © 2025 Roman Scherer <roman@burningswell.com>
|
||||||
|
;;; Copyright © 2025 Liam Hupfer <liam@hpfr.net>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -1025,16 +1026,18 @@ minimalistic.")
|
||||||
`("PATH" ":" prefix (,(string-append ncurses "/bin")))))))
|
`("PATH" ":" prefix (,(string-append ncurses "/bin")))))))
|
||||||
(add-after 'install 'install-completions
|
(add-after 'install 'install-completions
|
||||||
(lambda* (#:key import-path #:allow-other-keys)
|
(lambda* (#:key import-path #:allow-other-keys)
|
||||||
(let* ((bash-completion
|
(let* ((bashrc-functions
|
||||||
(string-append #$output "/etc/bash_completion.d"))
|
(string-append #$output "/etc/bashrc.d"))
|
||||||
(fish-functions
|
(fish-functions
|
||||||
(string-append #$output "/share/fish/vendor_functions.d"))
|
(string-append #$output "/share/fish/vendor_functions.d"))
|
||||||
(zsh-completion
|
(zsh-completion
|
||||||
(string-append #$output "/share/zsh/site-functions")))
|
(string-append #$output "/share/zsh/site-functions")))
|
||||||
(with-directory-excursion (string-append "src/" import-path)
|
(with-directory-excursion (string-append "src/" import-path)
|
||||||
(mkdir-p bash-completion)
|
(mkdir-p bashrc-functions)
|
||||||
(copy-file "shell/completion.bash"
|
(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)
|
(mkdir-p fish-functions)
|
||||||
(copy-file "shell/key-bindings.fish"
|
(copy-file "shell/key-bindings.fish"
|
||||||
(string-append fish-functions "/fzf_key_bindings.fish"))
|
(string-append fish-functions "/fzf_key_bindings.fish"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue