on-internet
← Community

How can I set a permanent default indentation for Python files to X spaces?

Stack Overflow ·

I have searched to find a solution for (Astro)N(eo)vim, and it is commonly suggested to set a tab equivalent to a default number of blank characters. However, I have observed that even if I set these variables in a configuration file, vim.opt.tabstop = 2 vim.opt.softtabstop = 2 vim.opt.shiftwidth = 2 unfortunately, for python files a separate additional line is needed: vim.cmd [[autocmd FileType python set shiftwidth=2 tabstop=2 expandtab]] If this line is not provided, e.g the tabstop option is not applied but only in python files This is also possibly related to this question: NeoVim tab siz

Comments

Sign in or sign up to comment and upvote.

No comments yet.