Move quickly in the console along the query string.

Hello.
Shell used csh.
Tell me please.
How to quickly navigate in the console, in the command prompt, for recently entered commands.
Let's say there is a command.
nano /etc/portage/package.use/package.use
In Linux I press the Ctrl+right_arrow end left_arrow, the cursor moves on this command bypassing letters, only by characters.
Sorry for my English. )
 
Solved the problem.
In .cshrc
Code:
bindkey '^[[1;5C' forward-word
bindkey '^[[1;5D' backward-word
 
There's no problem with remapping things if that's how you want to do it, but I thought you might want to know some more. If you need help, typing bindkey with no arguments will list the keybindings, such as forward-word and backword-word; ^[ represents the character generated when you press the Escape key (it's literally the ascii(7) ESC character, but you can also interpret it as the Meta prefix, e.g. ^[f and M-f are the same). Of course, the output of bindkey can be piped to grep(1) if you want to search for the key bound to a specific editor command or the editor command that is invoked when a specific key is pressed.

tcsh(1) says forward-word is bound to M-f and M-F by default; backward-word is bound to Meta-b and Meta-B by default, very much like Emacs.

You can also use bindkey -v to use vi-style keybindings. The man page focuses on the Emacs-based bindings, so editor commands like vi-word-fwd don't appear in the man page at all. It's a good idea to list the vi keybindings using bindkey or even use bindkey -l if you want to understand what a certain editor command does.
 
Back
Top