dotfiles/.vim/pack/plugins/start/vim-hugo
2024-12-16 19:13:26 +01:00
..
after Update 2024-12-16 19:13 OpenBSD/amd64-t14 2024-12-16 19:13:26 +01:00
compiler Update 2024-12-16 19:13 OpenBSD/amd64-t14 2024-12-16 19:13:26 +01:00
ftdetect Update 2024-12-16 19:13 OpenBSD/amd64-t14 2024-12-16 19:13:26 +01:00
ftplugin Update 2024-12-16 19:13 OpenBSD/amd64-t14 2024-12-16 19:13:26 +01:00
indent Update 2024-12-16 19:13 OpenBSD/amd64-t14 2024-12-16 19:13:26 +01:00
syntax Update 2024-12-16 19:13 OpenBSD/amd64-t14 2024-12-16 19:13:26 +01:00
LICENSE Update 2024-12-16 19:13 OpenBSD/amd64-t14 2024-12-16 19:13:26 +01:00
README.md Update 2024-12-16 19:13 OpenBSD/amd64-t14 2024-12-16 19:13:26 +01:00

vim-hugo

This is a Vim plugin for web development with the static site generator Hugo.

HTML

  • syntax highlighting and identation is improved to support the HTML Go template syntax.
  • :h path includes default directories used by Hugo, like layouts/partials, which is convenient to start editing files with :h gf and friends.
  • matchit patterns are extended to support Go template.
  • A compiler plugin is made available so you can build your website from inside Vim with compiler hugo | make, and build errors will populate the quickfix list.

Markdown

Markdown syntax highlight is also improved to add support for shortcodes and YAML front matter.

Embedded languages inside the {{< highlight >}} shortcode will be highlighted. For example, to highlight Python code, add let g:markdown_fenced_languages=['python'] to your .vimrc or init.vim.

{{< highlight python >}}
import foo
{{< /highlight >}}

If you want to highlight JavaScript code with js as a shorthand, use let g:markdown_fenced_languages=['js=javascript']:

{{< highlight js >}}
import { bar } from './foo'
{{< /highlight >}}

This is reused from Vim's built-in syntax files for markdown, so it'll also be used for markdown code blocks.