How can I format JS code in Vim?

前端 未结 7 1857
半阙折子戏
半阙折子戏 2020-12-14 08:19

I have this bit of JavaScript...

 15   $(\'.ajax_edit_address\').each(function() {
 16     $(this).ajaxForm({
 17       target: $(this).parents(\'table.addre         


        
相关标签:
7条回答
  • 2020-12-14 09:12

    Unfortunately, 'cindent' just isn't going to do the job since it's is very much tied to C syntax. Since all the default indent script for javascript does is turn on 'cindent', that's not much help. It even says so in the script!

    " Maintainer: None! Wanna improve this?

    I don't do anything other than really basic javascript so I've never bothered trying to find anything better. From a quick look on vim.org, this script looks like it may be worth a shot. It's newer, so it probably takes into account the more complex javascript that's used now days.

    0 讨论(0)
提交回复
热议问题