4

I want to unmap (unbind) certain keys such as Up, Down, Left, Right, Page Up, Page Down, Home, End specifically in the shell.

I guess I have to use the bind command in the .config/fish/fish.config file, but I am not sure how.

3
  • 1
    For interest, how come?
    – Zanchey
    Nov 21, 2016 at 7:05
  • @Zanchey to "lock" (and never deviate from) vim style (key bindings, navigation, modes) activated in fish by me :)
    – user86041
    Nov 21, 2016 at 9:58
  • 2
    @Chinggis6: Note that fish 2.4.0 made the vi-bindings more vi-y. 2.3.X just added them on top of the normal bindings (i.e. vi-mode inherited from emacs-mode), while 2.4.0 only shares a few explicit things that don't really conflict with vi-style text editing.
    – faho
    Nov 21, 2016 at 10:24

1 Answer 1

3

You will need to define a custom fish_user_key_bindings function with the appropriate bind --erase statements, then save that function with funcsave or by editing ~/.config/fish/functions/fish_user_keybindings.fish directly.

For example:

function fish_user_key_bindings
    bind --erase --key up
    bind --erase --key down
    # and so on
end

funcsave fish_user_key_bindings

Note that some terminals don't send the terminal codes that their terminal description files say they do - you may need to use fish_key_reader (introduced in 2.3.1) to confirm the exact binding you need to erase.

You must log in to answer this question.