8vius
8vius

Reputation: 5836

Change indentation settings in VIM with Janus

I'm trying to change the indentation settings on my vim config, which is currently set to 2 spaces. But neither changing the vimrc.old nor vimrc.after manually nor using the echo 'setting' >> ~/.vimrc.after way is changing the setting. How can I change my indentation settings with Janus?

Upvotes: 2

Views: 1043

Answers (3)

Mike Lee
Mike Lee

Reputation: 1215

Actually, you don't have to drop Janus. I really like janus myself (for the color theme).

Just create a file ~/.vimrc.after

within the file, set tab to 4 spaces set tabstop=4

Then janus will load the .vimrc.after file after janus

Upvotes: 3

Jozef Legény
Jozef Legény

Reputation: 1167

The best way I found was to create a folder in the ~/.janus folder (let's call it mysettings)

In ~/.janus/mysettings/after/ftplugin/ create a file with the name of your file-type you wish to change the indent for. For cpp it would be cpp.vim

Then inside this file set the indent style you wish to use, in my case:

setlocal noexpandtab
setlocal tabstop=4
setlocal shiftwidth=4
setlocal softtabstop=4
setlocal textwidth=0

Then in your .vimrc.after put a line

filetype plugin indent on

Upvotes: 1

romainl
romainl

Reputation: 196536

Drop Janus and use a regular ~/.vimrc.

Alternatively, you could type :verbose set {setting} to see where {setting} is set. The "problem", here, is that Vim may use a bunch of settings for indentation: try the code above with:

tabstop
softtabstop
shiftwidth

Upvotes: 1

Related Questions