Eshell and Abbreviations

I’m a big fan of eshell and much prefer it to running Bash inside a terminal buffer. I like to run it full frame and wrote some code to automatically save my window configuration and then run eshell in the entire frame. When I quit eshell, the old configuration is restored.

Xah Lee has an interesting post on using abbreviations with eshell. He points out that eshell is superior to a running a Bash shell because in addition to having all the power of Emacs available, you can leverage the Emacs abbreviation system. Lee, of course, is very concerned with ergonomics and invoking functionality with the least effort possible. One way he does that is to have a collection of abbreviations for some of the complex shell commands he runs.

But now there’s a problem. He has a lot of abbreviations and many have similar names because they are variations on a theme so he has a hard time remembering them. To solve that problem he wrote a bit of Elisp to access those abbreviations through ido. For example, several of his abbreviations start with img. To choose the correct one he just types 【i】 and ido provides him with a handy list that he can select from it the usual ido way.

If, like Lee, you have a lot of long, complex shell commands you might want to steal his code or work up something similar of your own. Even if you don’t have this particular problem, you still have to love how Emacs allows you to adapt it to your workflow.

This entry was posted in General and tagged . Bookmark the permalink.