YASnippet in Eshell

Álvaro Ramírez has a great, quick tip for Eshell users. Actually, it’s a good tip for any shell you’re using in Emacs. Ramírez starts by revisiting level 4 from Vivek Haldar’s classic post on the levels of Emacs proficiency. I wrote about my own experience with his post here.

Level 4 is about discovering the shell within Emacs. In Ramírez’s case that shell is Eshell but he had trouble remembering the syntax for some of the commands that he used infrequently such as for. Then he remembered that Eshell is just another Emacs buffer so he could use YASnippets to complete the commands for him. Thus for the for he simply typed for and Tab to get a for template that he could fill in by tabbing through the fields.

Ramírez has a link to a YASnippet tutorial if you aren’t already familiar with writing the templates. As I said, the same idea would work with other shells because they, too, are just Emacs buffers. It’s a small thing but it can eliminate one piece of annoying friction in your workflow.

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