title: JavaScript syntax & indentation in Vim
body: <p>I know this has been asked before, but I'm having trouble getting JavaScript indentation to work properly in Vim.</p>
  
  <p>I tried installing this plugin:</p>
  
  <p><a href="http://www.vim.org/scripts/script.php?script_id=3081" rel="noreferrer">http://www.vim.org/scripts/script.php?script_id=3081</a></p>
  
  <p>And I get this behaviour:</p>
  
  <pre><code>if (x == 1) {
  alert("nice");
  }
  </code></pre>
  
  <p>This is my vimrc:</p>
  
  <pre><code>syntax on
  set background=light
  colorscheme solarized
  set tabstop=4
  filetype plugin indent on
  let g:solarized_termcolors=16
  </code></pre>
  
  <p>I also tried it with this plugin:</p>
  
  <p><a href="http://www.vim.org/scripts/script.php?script_id=1840" rel="noreferrer">http://www.vim.org/scripts/script.php?script_id=1840</a></p>
  
  <p>But that gives me this:</p>
  
  <pre><code>if (x == 1) {
          alert("nice");
  }
  </code></pre>
  
  <p>i.e., two tabs, where I only want it to indent by a single tab.</p>
  
  <p>Anyone have any ideas what to do here?</p>