diff mbox series

[bug#48643] PATCH] gnu: fzf: Add fish shell functions to the package.

Message ID 20210525101650.0706dd75@perso.pw
State Accepted
Headers show
Series [bug#48643] PATCH] gnu: fzf: Add fish shell functions to the package. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Solene Rapenne May 25, 2021, 8:16 a.m. UTC
This allows to enable fzf functions for fish using the following code in
the file ~/.config/fish/config.fish 

source ~/.guix-profile/share/fish/functions/fzf
fzf_key_bindings


---
 gnu/packages/terminals.scm | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Efraim Flashner Sept. 26, 2021, 12:02 p.m. UTC | #1
I adjusted the fish completion path slightly to match the other
packages. Patch pushed!
wp1148917-web wp1148917-web Oct. 2, 2021, 8:43 p.m. UTC | #2
Efraim, there seems to be a bit of confusion about the nature of the installed file: It is NOT a completion, but code that sets fzf shell-hotkeys. This should become obvious if you look at the folder from the source: https://github.com/junegunn/fzf/tree/master/shell
The file should probably be installed to vendor_functions.d/ as e.g. Arch does it: https://wiki.archlinux.org/title/Fzf#fish
Efraim Flashner Oct. 3, 2021, noon UTC | #3
On Sat, Oct 02, 2021 at 10:43:15PM +0200, wp1148917-web wp1148917-web wrote:
> Efraim, there seems to be a bit of confusion about the nature of the installed file: It is NOT a completion, but code that sets fzf shell-hotkeys. This should become obvious if you look at the folder from the source: https://github.com/junegunn/fzf/tree/master/shell
> The file should probably be installed to vendor_functions.d/ as e.g. Arch does it: https://wiki.archlinux.org/title/Fzf#fish

First of all, thanks! I hadn't checked it too closely and relied on the
wording of 'fish completion'.

Checking the upstream documentation¹, Arch² and Debian³ the completions should
go in %output/share/fish/vendor_functions.d/fzf_key_bindings.fish, so
I've moved them there.

¹ https://fishshell.com/docs/current/completions.html?highlight=vendor#where-to-put-completions
² https://wiki.archlinux.org/title/Fzf#fish
³ https://sources.debian.org/src/fzf/0.24.3-1/debian/fzf.install/
diff mbox series

Patch

diff --git a/gnu/packages/terminals.scm b/gnu/packages/terminals.scm
index 37636c7cdc..5273dce005 100644
--- a/gnu/packages/terminals.scm
+++ b/gnu/packages/terminals.scm
@@ -25,6 +25,7 @@ 
 ;;; Copyright © 2020 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2021 Ekaitz Zarraga <ekaitz@elenq.tech>
 ;;; Copyright © 2021 Raphaël Mélotte <raphael.melotte@mind.be>
+;;; Copyright © 2021 Solene Rapenne <solene@perso.pw>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -851,11 +852,15 @@  usable with any list--including files, command history, processes and more.")
             (lambda* (#:key outputs #:allow-other-keys)
               (let* ((out (assoc-ref outputs "out"))
                      (bash-completion (string-append out "/etc/bash_completion.d"))
+                     (fish-completion (string-append out "/share/fish/functions"))
                      (zsh-completion (string-append out "/share/zsh/site-functions")))
                 (with-directory-excursion "src/github.com/junegunn/fzf"
                   (mkdir-p bash-completion)
                   (copy-file "shell/completion.bash"
                              (string-append bash-completion "/fzf"))
+                  (mkdir-p fish-completion)
+                  (copy-file "shell/key-bindings.fish"
+                             (string-append fish-completion "/fzf"))
                   (mkdir-p zsh-completion)
                   (copy-file "shell/completion.zsh"
                              (string-append zsh-completion "/_fzf"))))))))))