Re: [Fish-users] How to bind a key sequence to another key sequence?

2017-03-20 Thread Shiyao Ma
Hi,

On my terminal, ctrl+enter generates a seq of "^[[27;5;13~"
I'd like to bind it to a plain "enter".  So pressing ctrl+enter is the same as 
pressing a mere "enter".

I tried
bind \e"[27;5;13~" \r

but with no success.




On Mar 21, 2017, 12:43 +0800, Kurtis Rader , wrote:
> > On Mon, Mar 20, 2017 at 9:19 PM, Shiyao Ma  wrote:
> > > How to bind a key sequence to another key sequence?
> > >
> > > Reading the `man bind', I can only figure out how to bind a key sequence 
> > > to a function.
> > >
> > > But what about binding it to another key sequence?
> >
> > I do not understand the question. You can bind a key sequence to any 
> > sequence of commands, not just a function. It doesn't make sense to execute 
> > `bind abc ab` where the final `ab` in that command refers to the character 
> > sequence in `bind ab some_function`.
>
> --
> Kurtis Rader
> Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] How to bind a key sequence to another key sequence?

2017-03-20 Thread Kurtis Rader
On Mon, Mar 20, 2017 at 9:44 PM, Shiyao Ma  wrote:
>
> On my terminal, ctrl+enter generates a seq of "^[[27;5;13~"
> I'd like to bind it to a plain "enter".  So pressing ctrl+enter is the
> same as pressing a mere "enter".
>
> I tried
> bind \e"[27;5;13~" \r
>
> but with no success.
>

What you want to do is run `bind \r` which will tell you it is bound to
`execute`. So just `bind \e"[27;5;13~" execute`.

At this time there is no way to write "bind this sequence to the same
commands as this other sequence". It is not clear such a feature would be
useful and unambiguous; e.g., how do you deal with cycles? But if you can
define a sensible syntax and behavior for it please open an issue at
https://github.com/fish-shell/fish-shell/issues/new

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] How to bind a key sequence to another key sequence?

2017-03-20 Thread Kurtis Rader
On Mon, Mar 20, 2017 at 9:19 PM, Shiyao Ma  wrote:

> How to bind a key sequence to another key sequence?
>
> Reading the `man bind', I can only figure out how to bind a key sequence
> to a function.
>
> But what about binding it to another key sequence?
>

I do not understand the question. You can bind a key sequence to any
sequence of commands, not just a function. It doesn't make sense to execute
`bind abc ab` where the final `ab` in that command refers to the character
sequence in `bind ab some_function`.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users