Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8293567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:52:15+00:00 2026-06-08T13:52:15+00:00

Working on various GNU Readline-based CLIs and it would dramatically speed me up if

  • 0

Working on various GNU Readline-based CLIs and it would dramatically
speed me up if there was a way to have brackets and quotes
automatically closed when you type.

Thus typing a ' or ( on Bash (or other CLIs) would actually
append the closing quote or bracket '' or () and place the cursor
inbetween for writing.

I’ve looked around for quite some time trying to find out anything related
(e.g. ~/.inputrc setting), but didn’t find anything and I wonder if that’s
at all achievable. Any comments would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T13:52:17+00:00Added an answer on June 8, 2026 at 1:52 pm

    It’s a bit tricky, but doable. As a bash command:

    bind '"(" "\C-v()\e[D"'
    bind '"\"" "\C-v\"\C-v\"\e[D"'
    

    As a setting in .inputrc (so any program using readline gets the behavior):

    "(": "\C-v()\e[D"
    "\"": "\C-v\"\C-v\"\e[D"
    

    You can prefix each key with Control-v to type “plain” quotes and left parentheses without triggering the auto-close behavior.

    The above assumes Emacs keybindings. For vi bindings, use

    bind '"(": "\C-v()\ei"'
    bind '"\"" "\C-v\"\C-v\"\ei"'
    

    or

    "(": "\C-v()\ei"
     "\"": "\C-v\"\C-v\"\ei"
    

    Essentially, just replace the [D with i; instead of sending the escape sequence to move the cursor left, just send \e to drop back into command mode after inserting the parentheses/quotes, then re-enter insert mode, which should position the cursor inside the characters just typed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working my way through displaying various data elements from parent & child data,
In a typical stored procedure i am working there are various checks with the
So I'm working on a problem where I have to find various string repeats
We have a multiwar project and with various people working on the project a
Have tried various escape functions but can't seem to get the below working... .background-radial(@colour,
Working in SSRS I have columns of values, totals for the month on various
The project I am working on would trigger various asynchronous jobs to do some
I'm currently working my way through various Rails tutorials, but all seem to recommend
We have been working with various versions of the PagedList , however these pagedlists
I have been working on Neural Networks for various purposes lately. I have had

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.