Spacevim: Javascript files: how to set indentation to 4 spaces

Created on 28 Jun 2017  路  3Comments  路  Source: SpaceVim/SpaceVim

I wonder how I change the indentation on javascript files from 2 to 4 spaces, as adding the configuration to ~/.SpaceVim.d/init.vim had no effect:

set tabstop=4
set shiftwidth=4
set expandtab

I did not find anything in the documentations so I believe this should be as simple as configuring a vanilla vim/neovim. Still, adding the settings above didn't work.
If I change the configuration after vim is up and running, it works as expected.

All 3 comments

:h SpaceVim

https://spacevim.org/documentation/#code-indentation

TL;DR:
Add default_indent = 4 to the [options] block of your configuration in ~/.SpaceVim.d/init.toml
If you need it just in one project you can add it to a local config file .SpaceVim.d/init.toml like this one:

[options]
    default_indent = 4

Thanks for your tips :)

Was this page helpful?
0 / 5 - 0 ratings