I'm working on RHEL environment, and using xterm.
My question is that how to make the xterm command line works like vim instead of emacs (eg, selection, copy, paste, keyboard shortcuts)
Thanks!
I'm working on RHEL environment, and using xterm.
My question is that how to make the xterm command line works like vim instead of emacs (eg, selection, copy, paste, keyboard shortcuts)
Thanks!
As it was already mentioned, this has nothing to do with the terminal(emulator) you're using. In case you use zsh, you can enable vi-like bindings with:
bindkey -v
The Emacs-style keybindings to which you are referring are actually a feature of the Readline utility.
While adding, set -o vi
to the end of your ~/.bash_profile
should suffice (if you're a bash user), this utility can also be controlled through the use of an ~/.inputrc
file.
Create an ~/.inputrc
if it doesn't already exist and append this:
set editing-mode vi
set keymap vi-command
The benefit of this approach over set -o vi
is that this is read wherever readline is used include the MySQL command line interface and Ruby's IRB.
See this post for more Vim-related readline tips: http://vim.wikia.com/wiki/Use_vi_shortcuts_in_terminal