5

I'm trying to configure my Terminal and I would like to insert @{} at one key-stroke. This works with the following code

# .inputrc
"\e\"": "@{}"

But I also want the cursor to end up inside the braces. How can I do this? The following doesn't work.

# .inputrc
"\e\"": "@{}": backward-char

2 Answers 2

6

Try:

"\e\"": "@{}\e[D"
2
  • Beautiful, thank you. Where did you find the char code for the left arrow? Jan 19, 2009 at 18:21
  • 3
    If you type CTRl-V in the terminal it will display the escape code for the next key you type.
    – Antibaddy
    Jan 19, 2009 at 20:14
0

My immediate way to fix your overall goal (not really answering your question, but hopefully helping you anyway): write a bash alias or function for it. grev() perhaps, or something similar - at least, this is what I would do were I in your situation.

I am interested to see if what you originally asked is possible, however, so voting up your question in hopes that you can get a 'real answer'!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.