I'm using "standard" just in case there's some obvious method, or this feature is part a larger issue that I'm not aware of (as in perhaps involving enabling related shortcuts and features). Otherwise I don't mind just adding my own shortcuts.
If your shell uses the
readline library, here is what I have in my default
# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving "\e[1;5C": forward-word "\e[1;5D": backward-word "\e[5C": forward-word "\e[5D": backward-word "\e\e[C": forward-word "\e\e[D": backward-word
This file is only read if the
INPUTRC environment variable is not set, and if you don't have any
.inputrc file in your home directory.
Now, we must instruct the console to emit one of the
backward-word strings when Ctrl-Left is pressed, and one of the
forward-word strings when Ctrl-Right is pressed.
For this, we must add some special keyboard mappings to
# Ctrl + Left arrows key (readline's backward-word) control keycode 105 = F200 string F200 = "\033[5D" # Ctrl + Right arrows key (readline's forward-word) control keycode 106 = F201 string F201 = "\033[5C"
Here I have borrowed two keysyms
F201 (picked up quasi randomly from the output of
dumpkeys --long-info) in order to store the sequences expected by
keycode 105 is the left arrow, and
keycode 106 is the right arrow (those keycodes were obtained with
Now, let's rebuild our new keymap :
It should (re)create the file
/etc/console-setup/cached.kmap.gz. You can load it manually with the command:
Or, better, similarly to when your machine boots:
service console-setup start
For Linux console, you can customize your keymap. The place to start is with
dumpkeys. That's the standard approach. There's no applicable standard for Linux console bindings, but you can certainly imitate GUI (i.e., xterm as hinted by xhienne).
I don't see a duplicate, but these would be helpful: