1

I am trying to configure a bind command so that it is persistant. It seems that the right file to put it in is ~/.config/fish/config.fish

I put there

set fish_greeting "wazaa"
bind \n 'commandline -f accept-autosuggestion execute'

and I get for a new shell

root@srv ~# fish  
wazaa
root@srv ~# 

The file is therefore indeed parsed but the bind command is not taken into account.

The same command started from the prompt works fine.

Is there a special way of adding bind commands to the startup file?

WoJ
  • 27,165
  • 48
  • 180
  • 345

1 Answers1

3

Put them into a function called fish_user_key_bindings, i.e.

function fish_user_key_bindings
    bind \n 'commandline -f accept-autosuggestion execute'
end

This is because fish sets its keybindings after config.fish (in order to support emacs and vi-mode, and switching between them).

(The documentation will mention this in the next release, unfortunately it was missing before)

faho
  • 14,470
  • 2
  • 37
  • 47