I\'m trying to get VIM to indent Javascript with the \'=\' and related commands. When I try to auto indent the following, for example:
new function($) {
I had the same problem some time ago and the solution was the plugin "vim-javascript". It is JavaScript bundle for vim providing syntax and indent plugins.
https://github.com/pangloss/vim-javascript
The installation is very simple.
If you are using pathogen, use the follow steps:
cd ~/.vim/bundle
git clone https://github.com/pangloss/vim-javascript.git
If you are using vundle use the follow steps:
Add the follow line to your vimrc file:
Plugin "pangloss/vim-javascript"
And install it:
:so ~/.vimrc
:PluginInstall