i have a simple sort of a database file which consists only of entries in the following format
variable=value
i want to create a simple vim syntax highlighting for it and set it for specific file extension
for instance, variable part could be light blue, and value part light red
i googled it and came across things such as $vimruntime\syntax\
, syntax set=
, syntax match
, and hi
keywords, but couldn't set it up myself eventually
so i want a very simple vim code snippet that would realize it by matching the left and right hand sides and coloring them separately
Best Answer
Assuming your file's extension is
*.foo
…Create these files and directories if they don't exist:
Put the following in
$HOME/.vim/ftdetect/foo.vim
:Put the following in
$HOME/.vim/syntax/foo.vim
:Put the following lines at the very end of
$HOME/.vimrc
(or at least after anycolorscheme
line):Make sure you have the following line somewhere in your
~/.vimrc
: