2010-04-30 2 views
5

개행이 작동 할 때 JavaScript 문을 세미콜론으로 끝내지 않습니다. 불길이 없으세요. 내 질문은 거기에 vim 자동으로 들여 쓰기 패키지가 작동합니까? 나는 다음과 빔 스크립트와 행복 해요세미콜론 삽입을 이해하는 Vim의 JavaScript 용 AutoIndent

$(function(){ 
    var foo // code starts here, 
    // The following line breaks things, but adding a comment to it fixes things 
({a:1}) 
var foo // everything is stuck left now. 
      ({a:1}) 
      var foo // previous line justifies all following lines wherever you put it 

      function flat(){ 
       var foo // function starts out right, but the next line dedents it 
      ({a:1}) 
      var foo 
     } 
     var foo // now we're over here 
     if (foo) { 
      var foo // this if block doesn't close properly 
      } else if (foo){ // add a comment here to dedent the else body 
      var foo 
      } else if (foo){ 
       var foo 
       } // add a comment here to indent and break the following lines 
       var foo 
       }) 
       // all parenthesis match, but yet our indentations don't 

답변

9

: 후 코드의

결과 다음

는 얼마나 바보의 예입니다 gg=G :

var one = 1 
var two = 2 
var fun = function(){ 
    var three = 3 
    var four = 4 
    var five = 5 
} 

var fun2 = (function(foo){ 
    var six = 6 
}) 
+0

고마워요! 이것은 굉장합니다. http://pastebin.com/yQh2MjWP –