You can change your key bindings in fish_default_key_bindings.fish.

Ctrl-arrow keys didn't work for me so I just sent a patch adding them.
 While doing so I noticed there is a nextd-or-forward-word and
prevd-or-backward-word to bind keys to, which combines both the
functionality you are mentioning. It goes back or forth in the
directory history if nothing is on the line I believe.

I made the following change (after the other patch I sent) to combine
these functions into ctrl-(left|right)-arrow keys.

(note: gmail will wrap the patch lines, which is why I normally attach
patches I submit)

diff --git a/share/functions/fish_default_key_bindings.fish
b/share/functions/fish_default_key_bind
index a26387d..5bb7b74 100644
--- a/share/functions/fish_default_key_bindings.fish
+++ b/share/functions/fish_default_key_bindings.fish
@@ -68,8 +68,8 @@ function fish_default_key_bindings -d "Default
(Emacs-like) key bindings for fis
        bind \e\x7f backward-kill-word
        bind \eb backward-word
        bind \ef forward-word
-       bind \e\[1\;5C forward-word
-       bind \e\[1\;5D backward-word
+       bind \e\[1\;5C nextd-or-forward-word
+       bind \e\[1\;5D prevd-or-backward-word
        bind \ed forward-kill-word
        bind -k ppage beginning-of-history
        bind -k npage end-of-history

On Wed, Nov 24, 2010 at 10:16 PM, Philip Ganchev <[email protected]> wrote:
> I agree that Ctrl+Left and Ctrl+Right are more customary for moving
> forward/backward by 1 word, and Fish should be usable on the console.
> That should be the default key combo on Fish.
>
> I don't see the argument against Alt+Up, Alt+Down for moving through
> history words.
>
> Philip
>
>
> On Wed, Nov 24, 2010 at 8:49 PM, James Bowlin <[email protected]> wrote:
>> I use tabbed terminal emulators in X and I also often make use of
>> the virtual consoles in Linux (ctrl-alt-F[1-6]).  AFAIK, the normal
>> key combo for changing to the next/prev virtual console is alt +
>> left/right arrow.  Because of this I make all my tabbed terminal
>> emulators use this key combo as well for switching between
>> terminal tabs.
>>
>> I've tried other solutions but one problem is that if I'm trying
>> to fix someone else's Linux machine and I'm in the virtual
>> consoles, then I get confused unless I'm used to using alt +
>> left/right arrow for switching vconsoles on my machine.
>>
>> IMO, the binding in fish of alt + left/right arrow for directory
>> history and moving forward and backward one word should be
>> changed to ctrl + left/right arrow.  Inside of X-windows, it
>> doesn't make much difference but I do think ctrl + arrow is more
>> natural for moving by words.
>>
>> All the problems come in the vconsoles.  Normally alt + arrows are
>> bound to switching vconsoles so not only do those combos fail to
>> do what is expected in fish (dir history or move one word) they
>> do something very unexpected: they change the vconsole.
>>
>> The problem in the vconsoles is that unless we run loadkeys (as
>> root) alt + arrows changes vconsoles and all other $meta + arrow
>> combinations do the same thing as the arrow keys alone.  So with a
>> default setup ctrl + arrows will also be broken in the vconsoles
>> but not nearly so broken as alt + arrows.  If we are willing and
>> able to run loadkeys as root then we can map ctrl + left/right to
>> alt + b and alt + f which are also mapped to the
>> prevd-or-backward-word and nextd-or-forward-word commands which
>> makes ctrl + left/right work in the vconsoles.  That is how my
>> machine is configured now.
>>
>> Bottom line: I think the default alt + left/right bindings should
>> be changed to ctrl + left/right and alt + left/right should be
>> unbound.  While this would still be broken OOTB in the vconsoles,
>> it is less broken.  Further, it is easily fixed by running
>> loadkeys as root without disrupting the normal use of alt +
>> left/right to change vconsoles.
>>
>>
>> Peace, James
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
>> Tap into the largest installed PC base & get more eyes on your game by
>> optimizing for Intel(R) Graphics Technology. Get started today with the
>> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
>> http://p.sf.net/sfu/intelisp-dev2dev
>> _______________________________________________
>> Fish-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/fish-users
>>
>
> ------------------------------------------------------------------------------
> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
> Tap into the largest installed PC base & get more eyes on your game by
> optimizing for Intel(R) Graphics Technology. Get started today with the
> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
> http://p.sf.net/sfu/intelisp-dev2dev
> _______________________________________________
> Fish-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/fish-users
>

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to