3

This question already has an answer here:

I recently discovered terminal's feature, you can set the keys emacs or vi style

I prefer the second. so if you do

set -o vi

You can use k j l h keys to navigate on the command line. And you can switch between 'Normal' and 'Insert' modes like in vim.

However there's no way to visually distinguish one mode from another, even cursor doesn't change. Which makes vi-style pretty much useless. Is there a way to make it truly vim-like?

marked as duplicate by Gilles, jasonwryan, slm, Anthon, Patrick Feb 23 '14 at 5:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

As far as I know, this is not possible in Bash. But ZSH supports this. See here.

3

Should be available in bash 4.3 - see the changelog -

j.  New user-settable variable, show-mode-in-prompt, adds a characters to the
    beginning of the prompt indicating the current editing mode.

bash 4.3 is currently at the rc stage, you should be able to get packages for most distros without compiling from source, though not in the main repositories. Eg. Ubuntu (amd64) here and Debian (experimental repo) here.

Not the answer you're looking for? Browse other questions tagged or ask your own question.