I write blog posts with Jekyll, and for that I end up using three different languages in the same file: YAML at the start for post metadata, Markdown in the body, and C++ in
Quick fix: append syntax on
to the last line of your .vimrc
, which is the same as setting :syn on
in the live session.
Not So Quick:
Looks like you might have installed the custom 'jekyll' syntax alongside the default syntax files in $VIMRUNTIME
.
According to Vim wiki section on custom syntax, it's preferable to keep all personal customizations within ~/.vim
. For example, putting your jekyll.vim
syntax in ~/.vim/syntax/
.
Do not use a directory containing the files distributed with Vim because that will be overwritten during an upgrade (in particular, do not use the $VIMRUNTIME directory).
In the Vim syntax docs:
:syntax enable
runs ':source $VIMRUNTIME/syntax/DEFAULT_SYNTAX.vim'.
:syn on
(or :syntax on
) will "overrule your settings with the defaults".
So if setting :syntax on
makes your custom syntax work, it must be contained in the default syntax set.
Try keeping all the custom stuff in ~/.vim
and see if that settles things.