Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't setting ts=4 in .vimrc work?

Tags:

vim

I have a stupid question but I am stuck. I do set set ts=4 in my .vimrc file, but it looks not work. Open a new file, tab is still extended as 3 spaces. And under command mode, "set ts" got a "tabstop=3". Is there a final file like .vimrc that overwrite my ts?

Even I type :set ts=4, in vim, when I type tab, it only has 3 spaces in length.

Here is my suspicious options that cause this annoying result in my .vimrc

set autoindent
set shiftwidth=4
set softtabstop=4
set backspace=2

Thanks.

like image 445
Joe.Z Avatar asked Jun 05 '12 08:06

Joe.Z


People also ask

How do you set your editor to use 4 spaces indentation?

The shiftwidth parameter controls your indentation size; if you want four space indents, use :set shiftwidth=4 , or the abbreviation :set sw=4 . If only this is done, then indentation will be created using a mixture of spaces and tabs, because noexpandtab is the default.

How do I edit vimrc?

Opening vimrc Using file name completion, you could type :e $M then press Tab until you see the desired variable. If you only want to see the path, type :echo $M then press Tab to see the variable, and press Enter. In gvim, the Edit menu includes "Startup Settings" which will use $MYVIMRC to edit your vimrc file.


1 Answers

Try this:

:verbose set tabstop?

in vim, it will tell you where the tabstop option value is coming from.

like image 185
wroniasty Avatar answered Nov 10 '22 04:11

wroniasty