Home » Questions » Computers [ Ask a new question ]

Using VIM keys in shell (zsh or bash)

Using VIM keys in shell (zsh or bash)

I want to use vim editing keys in my shell (zsh).

Asked by: Guest | Views: 257
Total answers/comments: 2
Guest [Entry]

"As for the bash part in the title: You can put bash into vi mode by calling set -o vi (e.g. put that into your .bashrc).
To bind functions to specific keys you have to use bind in bash. See help bind to list the available functions and examples of how to call it.

""Change inner word"" is not in vi, but vim, so it is not available."
Guest [Entry]

"In bash pressing v (in command mode) opens vi(m) with the current content of the command line. You can now edit the line, using every feature of vi(m), and after quitting the line will be automatically executed.

Take a look at this article for a good introduction and a cheat sheet of vi command line editing mode."