Bind Ctrl+Right to nextword in nano (as it is in all other apps)

Sadly, I don't think this is possible. I've found a thread where a nano developer said:

Hi, I've searched high and low trying to find out if it's possible to navigate through the text with CTRL left/right-key to jump word by word...

Unfortunately, no. Meta-Space and Ctrl-Space are the only keys to do that. This is because in text mode, there's no way for nano to tell the difference between Ctrl-Left and Left and between Ctrl-Right and Right.

On another, he added:

because I figure that nano should work the same way under both X terminals and the console, and I have yet to find a console that can distinguish between [arrow key] and Ctrl-[arrow key]. I do wish that wasn't the case...


There is a solution to this problem. Redefine Ctrl-Left and Ctrl-Right in your Terminal program to seldom-used keys, such as F13 and F14.

Then in ~/.nanorc:

bind F13 prevword main
bind F14 nextword main

Now, a shortcoming, for me at least, is that it will only work when you're using the Terminal program you used for the key redefinition. For example, in my situation, this doesn't work when I'm at the physical console of my OS (in my case, FreeBSD). But I use QVT/Term from my desktop in the other room almost 100% of the time. Works like a charm.


Install the latest version of nano. They have added ctrl+left and ctrl+right to move by words. (For sure v2.7.4 has this).