问题
I am stucked by this for a long time. How can I move the cursor in the command line of tcsh, as did by ctrl + arrow in vim editor, ipython shell, firefox, word etc. All these above can do this nicely, excetp tcsh, which is really frustrating.
回答1:
Try Escb and Escf.
For future reference, non-programming-related questions like these may be more appropriate at SuperUser.
回答2:
tcsh has key bindings to mimic VI-style editing commands. Just put this in your ~/.cshrc file:
> bindkey -v
You can then begin vi-style editing of previous commands by hitting esc. Then, use "k" or "j" to scroll backward/forward in the command history. Use word movement keys "b" or "w" to move backward/forward one word. Use "cw" to change a word, etc. When done, hit ret (from anywhere in the command line) to execute the new (edited) command. For example:
> bindkey -v
> echo a b c d
a b c d
At this point, type 'esc k b' to recall the previous command and move back 1 word. Then type "cw z esc" to change the word "c" to "z". Then hit ret to execute the new command and get:
> echo a b z d
a b z d
>
Enjoy!
Alan Thompson
来源:https://stackoverflow.com/questions/13089573/how-to-move-the-cursor-by-word-in-command-line-of-tcsh