Page MenuHomeSolus

fzf Fish shell keybindings installed in wrong folder
Closed, ResolvedPublic

Description

The Fish keybindings for fzf are currently installed into /usr/share/fzf/ which is not sourced by Fish.

Adding install -Dm00644 shell/key-bindings.fish $installdir/usr/share/vendor_functions.d/fzf_key_bindings.fish (similar to https://github.com/junegunn/fzf/blob/80b5bc1b682898e3089f6caf1120919fc0933562/install#L302) would make the keybindings available.

Event Timeline

DonHugo created this task.Sep 10 2019, 6:29 AM

Calling @xulongwu4, he did the last change on fzf package.

I inspected package.yml and found single install command for shell bindings, maybe it should be done separately for each shell.

install -Dm00644 shell/key-bindings.* $installdir/usr/share/fzf
xulongwu4 added a comment.EditedSep 10 2019, 1:41 PM

The keybindings are not enabled by default. If you want to enable it, you can add the source statement in your shell init script. For example, I have this in .bashrc:

FZF_KEYBINDING_FILE=/usr/share/fzf/key-bindings.bash
[[ -f $FZF_KEYBINDING_FILE ]] && source $FZF_KEYBINDING_FILE
DonHugo updated the task description. (Show Details)Sep 12 2019, 4:12 AM

If you don't want to enable that functionality, wouldn't it make sense to inform the user about the about it and tell them where to find the necessary files? Or create a fzf-keybinds package?

If you don't want to enable that functionality, wouldn't it make sense to inform the user about the about it and tell them where to find the necessary files?

I guess it makes sense, but I don't know how to inform the user.

@xulongwu4 Help Center Article most likely.

@DonHugo I created a pull request to add the documentation for enabling fzf command-line autocompletion and key-bindings to the Solus help center here: https://github.com/getsolus/help-center-docs/pull/230. Can you try to see if it works correctly for you?

@xulongwu4 I think you should use Fish's autoloading mechanism to load the keybindings as it will not increase start up time.

@xulongwu4 I think you should use Fish's autoloading mechanism to load the keybindings as it will not increase start up time.

Huh? Autoloading is for functions, not for sourcing config files.

@xulongwu4 I think you should use Fish's autoloading mechanism to load the keybindings as it will not increase start up time.

Huh? Autoloading is for functions, not for sourcing config files.

But it is a function ?

Sure, but you still need to run it to set up the keybinds. autoloading doesn't do that.

You need to do that when using source $FZF_KEYBINDING_FILE from the snippet as well (I just tested it) or add

function fish_user_key_bindings
	fzf_key_bindings
end

to the fish config, which I believe is the recommended way to create user keybinds.

Anyways, I don't want to argue too much about a minor issue.

@DonHugo I updated the documentation according to your suggestion. Can you take a look and see whether that is better?

@xulongwu4
Looks good to me. Thanks.

DataDrake triaged this task as Normal priority.Nov 18 2019, 7:56 AM
DataDrake edited projects, added Software; removed Lacks Project.

Moving this until the PR is accepted.

DataDrake moved this task from Backlog to Package Fixes on the Software board.Jan 29 2020, 11:16 AM
DataDrake closed this task as Resolved.May 28 2020, 8:32 PM
DataDrake claimed this task.