In iex, I would like to be able to type a [, {, (, ", or ’ and have the corresponding closing element appear, leaving the cursor between them. No luck guessing or asking google. crtl-] adds the closing ], }, or ) with the cursor following. Any help would be appreciated.
Hi @warren84 I do not think that iex
has this functionality.
You can try to use rlwrap and set up an .inputrc
to force iex to use readline and autopair things, it works, but it is a workaround and I can’t guarantee that it will not break other parts of the shell…
.inputrc
"\C-b": backward-char
"(": "\C-v()\C-b"
"[": "\C-v[]\C-b"
"{": "\C-v{}\C-b"
"\"": "\C-v\"\C-v\"\C-b"
"\047": "\C-v\047\C-v\047\C-b"
and then
rlwrap --always-readline iex
1 Like
Yeah, it breaks autocomplete (and who knows what else…)