andersjanmyr
andersjanmyr

Reputation: 11540

Is it possible to add multiple commands to the readline .inputrc file?

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

Upvotes: 5

Views: 1115

Answers (2)

Antibaddy
Antibaddy

Reputation: 254

Try:

"\e\"": "@{}\e[D"

Upvotes: 6

ELLIOTTCABLE
ELLIOTTCABLE

Reputation: 18029

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'!

Upvotes: 0

Related Questions