jethrokuan / fzf

Ef-🐟-ient fish keybindings for fzf
MIT License
861 stars 66 forks source link

Key-binding Not Working in a New Session #136

Closed WIZARDELF closed 4 years ago

WIZARDELF commented 4 years ago

The key-binding only works for the session in which FZF is installed: $ fisher add jethrokuan/fzf In a new opened session, FZF cannot be activated by its key-binding, and one has to re-install it.

I guess the following 2 files should be placed into another directory:

~/.config/fish/conf.d/fzf.fish
~/.config/fish/conf.d/fzf_key_bindings.fish

They should be placed under ~/.config/fish/functions/.

jethrokuan commented 4 years ago

You're on an old fish version, new fish automatically loads files in the ~/.config/fish/conf.d folder. The workaround is to add a snippet in your config.fish that sources everything in conf.d, but you should upgrade your fish version.

WIZARDELF commented 4 years ago

I believe my box has the latest stable fish:

$ fish --version
fish, version 3.1.0

You're on an old fish version, new fish automatically loads files in the ~/.config/fish/conf.d folder. The workaround is to add a snippet in your config.fish that sources everything in conf.d, but you should upgrade your fish version.

WIZARDELF commented 4 years ago

My workaround is: $ source ~/.config/fish/conf.d/fzf_key_bindings.fish

jorgebucaran commented 4 years ago

@Kejia What's your version of fisher?

WIZARDELF commented 4 years ago

@jorgebucaran my fisher is:

$ fisher --version
fisher version 3.2.10 ~/.config/fish/functions/fisher.fish
jorgebucaran commented 4 years ago

Not sure what's happening, sorry. Maybe you upgraded from an old fisher (2.x), have an unusual configuration, or something else in your system is interfering with configuration snippets.

They should be placed under ~/.config/fish/functions/.

Nope. Those files are where they should be.

WIZARDELF commented 4 years ago

I found the reason: I had a key-binding collision in my sys. After I changed my key-binding in ~/.config/fish/functions/fish_user_key_bindings.fish, I don't have to manually source the ~/conf.d/fzf_key_bindings.fish file now:

function fish_user_key_bindings
    bind \cg __fish_cancel_commandline
    bind \cr up-or-search
    # bind \cs down-or-search # disable this for fzf
end

So, close this issue.