for many file types vim will use the heredoc names as a clue. For example in php files I'm often creating here docs thus:
Solar
Is good
html;
$my_js = <<
works beautifully, with only problem being that indentation is problematic (the closing marker cannot have preceding spaces)