How do I fix incorrect inline Javascript indentation in Vim?

后端 未结 9 1590
爱一瞬间的悲伤
爱一瞬间的悲伤 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条回答
  •  旧时难觅i
    2020-12-12 15:34

    The scripts mentioned above do not format the closure-syntax often used in jQuery correctly:

    $(function() {
      // only one level of indentation, not two
    });
    

    This script works better for me: http://www.vim.org/scripts/script.php?script_id=2765

提交回复
热议问题