highlight then press ‘Tab’, the highlight snippet code is generated automatically.
To make your emacs easy to use, I strongly suggest you use existing good emacs configuration if you are junior emacs user, like Steve Purcell. You can find detail how to install and use it from previous link. This configuration sets up a strong tool ido, which helps you to easy find your file. But sometimes it’s annoy when you want to open a directory or create a new file.
In ido mode, to create a new file you can enter
C-x C-f to find the directory you want to save to, then enter
C-f again to switch to normal mode, then you can continue enter your file name to create a new file.
In ido mode, to open directory you can enter
C-x C-f to find the directory first, then enter
C-d to open that directory.
You can find more information about ido from here
Now let’s install yasnippet.
On the list,
C-sto find “yasnippet”, you can find some plugin like “yasnippet yet another snippet extension for emacs”. Enter
enterto open it, then on the openned page you can see
Installon the top, move your cursor to there and press
enterto install it.
Now you have to add some config into ~/.emacs.d/lisp/init-local.el, if it’s not exist please create a new one like below:
- restart your emacs, and open any markdown file with extension ‘.md’, you can enter
highlightand then press
Tab, you can see snippet works!!!