I currently have the filetype plugin indent
setting in my ~/.vimrc file, but it seems to be causing issues with the indentation of JSON objects.
When I start vim using
vim -N -u NONE <filename.js>
I am enabling both :filetype plugin indent on
and :set sw=4 fileetype=javascript
However, this is the result I am seeing:
var foo = {
Bar: function(){
},
Baz: function(){
}
};
This is how I would like it to look -- is there a way to achieve this? :
var foo = {
Bar: function(){
},
Baz: function(){
}
};
The reason behind enabling the indent plugin was to make block commenting easier. If I type /* <enter>
, it should assume I'm starting a block documentation comment. However, if it continues to affect the ending brace of my JSON object, then I will refrain from using it.