使用VI的同学有福了…
不管在Mysql, Shell或者IRB都可以用Vi的编辑模式

HOWTO

把以下脚本放到Home目录的.inputrc就可以了….

# Enable vi mode for many apps that use libreadline including:
# ncftp, lftp, ftp, mysql, bc, python, etc...
set editing-mode vi
set keymap vi  

# Chinese support requires 8 bits...
# Enable 8bit input
set meta-flag on
set input-meta on

# Turns off 8th bit stripping
set convert-meta off 

# Keep the 8th bit for display
set output-meta on

# Show filelist after one tab, Make file previews work like ls -F
set visible-stats on
set show-all-if-ambiguous on

# The readline 'edit-and-execute-command' function will:
# Invoke an editor on the current command line, and execute the result as shell
# commands. Bash attempts to invoke $FCEDIT, $EDITOR, and emacs as the editor, in that order.

Control-o: edit-and-execute-command
# Use “bind -l” to see all readline options and “bind -P” to see options plus bindings
# For more information on proper syntax, see:
# http://checkmyip.com/man/sh.html

*按esc就就进入VI模式….

转载请注明:韦旭红的点点滴滴 » 所有的console都用VI模式