In vim there is an option called showmatch. When you type a closing parenthesis in insert mode, this jumps the cursor to the matching opening parenthesis (at the same nesting level), then back again. This is very useful with languages like prolog and lisp, and is often present in their REPLs. Does Bash have a similar feature? I wonder if this might be part of readline, because the SWI-prolog interpreter does it, and as far as I know, also uses readline. If it is part on readline, which options do I need to set in my .inputrc?
Asked
Active
Viewed 354 times
6
Myc3lium
- 69
- 2
-
you seem to have created two different accounts. you should probably merge them. see https://unix.stackexchange.com/help/merging-accounts – cas Sep 27 '19 at 05:27
2 Answers
7
The question https://stackoverflow.com/questions/47358440/blink-matching-paren-not-working-in-readline-prompt lists as part of the question the readline setting
set blink-matching-paren on
which I have tried, and produces the result I was expecting.
myc3lium
- 71
- 1
-
Very good find! Also useful, if bash is set to use vi keys, pressing `Esc` (to enter normal mode) and then `%` moves the cursor to the matching parens. Pressing again returns to the original position, just like in vi or vim. – John1024 Sep 27 '19 at 05:38