I want my terminal to automatically close my brackets, quotation marks, etc.
For example, I want to type (
and I want it to complete to
(|)
where | represents the mouse cursor.
Is there a way to do this? If so, how?
I want my terminal to automatically close my brackets, quotation marks, etc.
For example, I want to type (
and I want it to complete to
(|)
where | represents the mouse cursor.
Is there a way to do this? If so, how?
bash
reads ~/.inputrc
file, which allows binding certain keys to macros. In our case, we need macro that automatically types in "()" and Ctrl+b (which is move back one word ) shortcut.
Open the file with gedit or any other text editor and type in the following
"\C-]":"()\C-b"
That will bind Ctrl + ] to do what you want. Now open terminal or call a new instance of the shell and test it out.
You can try binding it to any other keyboard short-cut, but there is only so much you can do.