I have this tab spacing setting:
set autoindent set smartindent set expandtab tabstop=4 shiftwidth=4 smarttab softtabstop=4
and at the end of the configuration I will put this:
autocmd FileType javascript,jade,json set shiftwidth=2 tabstop=2 softtabstop=2
The 2 space tab works great. But, if I type input (new line), it becomes 4 spaces. Here is an example:
var Post = orm.define ('Post', {
title: sequelize.STRING,
content: sequelize.STRING,
| / * wrong spaces * /
});
But if I use 4 tab areas, it also uses 4 spaces after input.
I can’t understand what the problem is.
EDIT:
This ONLY happened when I write a literal object in a javascript callback function (like the example code above). It works great with general code instruction and in the json object literal. Here is an example:
/ * the 2 spaces works fine * /
app.set ('port', 3000);
app.use (express.bodyParser ());
/ * also works fine here * /
var config = {
host: 'localhost',
port: 5432
}
vim
Kiddo
source share