Skip to content

Instantly share code, notes, and snippets.

@jfreeze
Last active April 2, 2024 08:15
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save jfreeze/8894279 to your computer and use it in GitHub Desktop.
Save jfreeze/8894279 to your computer and use it in GitHub Desktop.
Get VI bindings in IEX (Elixir REPL)
# VI bindings in iex:
brew install rlwrap # on OSX
echo "alias iex='rlwrap -a foo iex'" >> ~/.bash_profile
echo "set editing-mode vi" >> ~/.inputrc
source ~/.bash_profile
# To run iex WITHOUT rlwrap
\iex
# Note
You cannot have vi bindings through rlwrap AND command completion at the same time.
The author of rlwrap explains the reason here: http://stackoverflow.com/questions/9210931/is-there-a-way-of-running-rlwrap-with-tab-completion-disabled
@mkyed
Copy link

mkyed commented Feb 17, 2015

Thanx!

@chrisdambrosio
Copy link

Thanks for this

@dylan-chong
Copy link

alias iex='rlwrap -a foo iex'

What is the foo?

@led
Copy link

led commented Nov 24, 2017

The -a switch tells rlwrap to 'always remain in readline mode'. On OSX the -a option requires an argument, in this case a dummy argument foo.

@Lumuy
Copy link

Lumuy commented Feb 22, 2019

Thanks

alias iex='rlwrap -a iex'

On unbuntu, this worked for me.

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