How do I fix incorrect inline Javascript indentation in Vim?

后端 未结 9 1563
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-12 15:09

I can\'t seem to get inline Javascript indenting properly in Vim. Consider the following:

  $(document).ready(function() {

  // Closing brace correctly inde         


        
9条回答
  •  抹茶落季
    2020-12-12 15:40

    I had this same issue. This is the best of all Javascript indentation scripts:

    http://www.vim.org/scripts/script.php?script_id=1840

    It requires the IndentAnything plugin

    http://www.vim.org/scripts/script.php?script_id=1839

    As an added bonus, I wrote this indent script that will make Javascript blocks quite pretty. It uses the default html indenter by default (and the IndentAnything one when within a Javascript block)

    http://gist.github.com/371902

提交回复
热议问题