Thursday, May 2, 2024
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 7104  / 3 Years ago, mon, june 14, 2021, 2:49:52

Is there a way to bind hotkeys to textual commands in the terminal? For example:
ctrl+b == git branch <ret>


More From » gnome-terminal

 Answers
4

You can use the bash bind command as seen in the linked Stackoverflow answer.



In your case, the command would be:



bind '"C-b":"git branch
"'


To make it stick from session to session then add it to your ~/.inputrc



Bash bind reference. (also available as man bash)


[#34116] Monday, June 14, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rmiend

Total Points: 292
Total Questions: 101
Total Answers: 111

Location: Azerbaijan
Member since Tue, Aug 9, 2022
2 Years ago
;