Markdown snippets for Vim
After switching to Neovim, I needed a two snippets to be able to write without pausing to add mark-ups: one for links, and the other for figures. Powered by UltiSnips, it is:
snippet lnk "Link" b
[${1:key}]: ${2:url} "${3:title}"
endsnippet
snippet fig "Figure" b
<figure>
<img alt="${1:description}" src="${2:url}" loading=lazy />
<figcaption>${3:caption}</figcaption>
</figure>
endsnippet
It is now available on GitHub. To get this working in Vim, one would add this to ~/.vimrc
, which assumes Vim Plug — for managing plug-ins:
call plug#begin()
Plug 'sirver/ultisnips'
Plug 'ckunte/markdown-snippets-vim'
call plug#end()
let g:UltiSnipsExpandTrigger = '<tab>'
let g:UltiSnipsJumpForwardTrigger = '<c-j>'
let g:UltiSnipsJumpBackwardTrigger = '<c-k>'
For a demonstration of the power of snippets in action, see this.