LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Swapping Esc-f and Ctrl-f for commandline word jumping (https://www.linuxquestions.org/questions/linux-general-1/swapping-esc-f-and-ctrl-f-for-commandline-word-jumping-945070/)

markdibley 05-15-2012 08:44 AM

Swapping Esc-f and Ctrl-f for commandline word jumping
 
Hello

Is there a way of swapping the keymappings of Ctrl-f with Esc-f. A common shortcut in all sorts of applications is jumping the cursor forward 1 word using Ctrl-f. However, Linux has it mapped to Esc-f. And you can't hold Esc down for multiple key presses.

Any advice on making this change would be great.

Thanks

Mark

pan64 05-15-2012 08:53 AM

actually Ctrl is a key modifier, but Esc is a key, so I do not really understand what do you want. From the other hand linux has not mapped anything. You can map keys in shells or in an editor, or?? Can you please specify where is it occured?

markdibley 05-15-2012 08:57 AM

Quote:

Originally Posted by pan64 (Post 4678871)
actually Ctrl is a key modifier, but Esc is a key, so I do not really understand what do you want. From the other hand linux has not mapped anything. You can map keys in shells or in an editor, or?? Can you please specify where is it occured?

My incorrect terminology is probably confusing. I am not necessarily looking to map keys. What I would like to do is replicate the action achieved on the command line when using Esc-f with something that uses either the Ctrl or Alt key.

To be totally clear, when you use Esc-f on the command line the cursor moves 1 word forward. I would like to do the same using either Ctrl-f or Alt-f.

Thanks for your reply.

pan64 05-15-2012 11:48 AM

so that is the bash bindings. See this page in general. Also this page about the basics of bindings

bind "\C-f":forward-word
should bind Ctrl-f to forward word

markdibley 05-15-2012 12:10 PM

Hi

Thanks for that. I am actually using tcsh, but your reply led me to this page which not only shows the same thing for tcsh but also reminds me that what I really wanted was Ctrl-right and Ctrl-left.

Thanks again for your help. This will make a lot of difference to my working environment.

Mark

pan64 05-15-2012 12:14 PM

If someone helps you, or you approve of what's posted, click the "Add to Reputation" button, on the left of the post.

I'm glad to help you


All times are GMT -5. The time now is 12:44 PM.