As shown in the following screencast, when I open this Haskell file (extension hs), a long multi-line comment is not recognized appropriately.

Based a previous question of mine I've verified that :syntax sync fromstart correctly recolors the syntax. However, putting it into ~/.vim/after/syntax/hs.html doesn't see to have effect.



The syntax is haskell, not hs, so you need to put your code in ~/.vim/after/syntax/haskell.vim (see :help syn-files).

You can see the name of the syntax with

:setlocal syntax?

(add :verbose to see where it came from).

In general, the value of the syntax option is the same as the value of the filetype option, so it is usually enough to check

:setlocal filetype?

Note however that for ftplugins using the filetype mechanism, you have some more freedom on names (:help ftplugin-name).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.