Last active
August 1, 2024 17:34
-
-
Save jfreeze/8894279 to your computer and use it in GitHub Desktop.
Get VI bindings in IEX (Elixir REPL)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Thanks for this
alias iex='rlwrap -a foo iex'
What is the foo
?
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
.
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
Thanx!