This question already has an answer here:
I have the following in my
set expandtab "Use soft tabs (spaces) set shiftwidth=2 "Set tab width = 2 set softtabstop=2 "Set tab width = 2 set autoindent "Set indent of previous line
Now if I open another file which contains soft tabs of width 4 spaces, how can I make Vim to automatically set my tab also to 4 spaces, depending on the file. Currently, if I'm on a line which is indented 4 spaces and I press
o in normal mode, the cursor jumps to next line, but only 2 spaces from left.
I also tried using
set smartindent, but doesn't work.