othree / html5.vim

HTML5 omnicomplete and syntax
http://www.vim.org/scripts/script.php?script_id=3236
934 stars 76 forks source link

indentation incorrect for multiline `var` #27

Closed pengyu closed 11 years ago

pengyu commented 11 years ago

The following is what is indented in vim. The lines after var is indented incorrectly. Is there an easy fix for this problem?

<!DOCTYPE html>
<html lang="en">
  <body>

    <script>

      var x,
      y;

f();

</script>
  </body>
</html>
othree commented 11 years ago

Using cindent for that block, looking for a way to call the indent method for a filetype other than current one. If no, there is no easy solution.

othree commented 11 years ago

Fixed, use your Vim's indent function for js/css. If you don't have other js indent plugin. Default is cindent.