Skip to content

Instantly share code, notes, and snippets.

@ethagnawl
Last active May 5, 2021 19:54
Show Gist options
  • Select an option

  • Save ethagnawl/86a0284c990196ae31b7 to your computer and use it in GitHub Desktop.

Select an option

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.

ghost commented Sep 25, 2015

Copy link
Copy Markdown

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

@benlieb

benlieb commented Oct 12, 2015

Copy link
Copy Markdown

Me neither :(

@eunleem

eunleem commented Oct 14, 2015

Copy link
Copy Markdown

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

@sonthonaxrk

Copy link
Copy Markdown

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

@Marskey

Marskey commented Jun 5, 2016

Copy link
Copy Markdown

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

@Marskey

Marskey commented Jun 5, 2016

Copy link
Copy Markdown

i mean when you using mac.

@YangVincent

Copy link
Copy Markdown

You need bash version 4.3+

@curtiszimmerman

Copy link
Copy Markdown

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