Markdown snippets for Vim
After switching to Neovim, I needed two snippets to be able to write without pausing to add mark-ups for links, and figures. They are as below, and now available from GitHub.
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
Assuming Vim Plug for managing plug-ins, one would add this below to ~/.vimrc
, and run :PlugUpdate
in the Normal mode to get it working.
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 demo. of the power of snippets in action, see this.