Creating keyboard shortcuts for Terminal
Just to ensure that what I am saying is getting clearly across, I am not referring to things like iCanHazShortcut that allows you to execute a command anywhere through a keyboard shortcut.
I wanted to know if there is a way to have keyboard shortcuts that run a command in the current Terminal tab. I am fine with using 3rd-party applications.
Solution 1:
No need of 3rd-party apps.
You can go to the Preferences Tab(Menu -> Terminal -> Preferences or ⌘,
), then go to Profiles -> Keyboard.
There you can create shortcuts. Enter your command and end with an enter.
For example, if you want to run ls
each time you press F1
, select F1 in the Key
tab, and press "ls <enter>", which appears like ls\015
.
I didn't find a way to bind characters though, but using all these keys should be enough.