x********g 发帖数: 100 | 1 Suppose you entered a long command, now you want to entered the same command
with slight modificaitons, you press up arrow key and modify it. The
editing however, is not so convinient. Is there any hotkeys like in vim: /
for search, cw to change a word, etc.? Or maybe other terminal emulators
have such features? | a*****i 发帖数: 4391 | 2
command
Sure there are.
http://www.catonmat.net/blog/bash-emacs-editing-mode-cheat-sheet/
【在 x********g 的大作中提到】 : Suppose you entered a long command, now you want to entered the same command : with slight modificaitons, you press up arrow key and modify it. The : editing however, is not so convinient. Is there any hotkeys like in vim: / : for search, cw to change a word, etc.? Or maybe other terminal emulators : have such features?
| x********g 发帖数: 100 | 3
Thanks! I am to enter the vi mode by adding "set editing-mode vi" in ~/.
inputrc. However, before I did that I have
"\e[1;2A": history-search-backward
"\e[1;2B": history-search-forward
in ~/.inputrc which enable Shift+up and Shift+down to search the command
history that matches my input. For example, suppose my last three commands
are
sudo gvim bla.sh
ls -a
./bla.sh
Now if I type "sudo" and Shift+up, it will complete my command to match the
nearest history that starts with "sudo", i.e. "sudo gv
【在 a*****i 的大作中提到】 : : command : Sure there are. : http://www.catonmat.net/blog/bash-emacs-editing-mode-cheat-sheet/
| e******d 发帖数: 310 | 4 if you use bash, add line
=============
set -o vi
=============
into .bashrc file |
|