Skip to content

Instantly share code, notes, and snippets.

@ethagnawl
Last active May 5, 2021 19:54
Show Gist options
  • Save ethagnawl/86a0284c990196ae31b7 to your computer and use it in GitHub Desktop.
Save ethagnawl/86a0284c990196ae31b7 to your computer and use it in GitHub Desktop.
Display Vim mode in Bash prompt
# requires >= Bash 4.3
# note: the prompt will not be updated if you use a custom PS1 which contains a newline character
set editing-mode vi
set keymap vi-command
set show-mode-in-prompt on
# if it's configured correctly, your prompt will be prefixed with a `+` while in insert mode and a `:` when in command mode.
Copy link

ghost commented Sep 25, 2015

I am using MacBookPro 2015, this .inputrc config does not work.

@benlieb
Copy link

benlieb commented Oct 12, 2015

Me neither :(

@eunleem
Copy link

eunleem commented Oct 14, 2015

Confirmed working on Fedora 22.
Saved it under ~/.inputrc and opened a new terminal works like a charm!

@sonthonaxrk
Copy link

@FZX @benlieb, that is because OSX uses a build of bash way back from 2007.

@Marskey
Copy link

Marskey commented Jun 5, 2016

try " bind 'set show-mode-in-prompt on' "

@Marskey
Copy link

Marskey commented Jun 5, 2016

i mean when you using mac.

@YangVincent
Copy link

You need bash version 4.3+

@curtiszimmerman
Copy link

May one of your next meals be delicious beyond your wildest expectations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment