I use a terminal for just about everything. There are a few commands that I often execute within a directory like:
emacs main.tex
evince main.pdf
It may seem silly, I'd like to be able to run a set of commands like this with a single keystroke. Is there any way to map (say) F9
to write a specific sequence of characters to an open gnome terminal?
gnome-terminal doesn't have such a feature, but you might configure bash (actually, readline) to insert a certain string for a given key. Edit ~/.inputrc
or /etc/inputrc
and add such lines:
"\e[19~": "emacs main.tex"
"\e[20~": "evince main.pdf"
Watch out: When you press F8 or F9, these will do exactly the same as if you've typed those characters; no matter what the context is. E.g. if you type rm
and then press space, F8, Enter, you'll remove your main.tex
!