1

I set the expandtab option to on, but still I don't get spaces when I click tab, but I get actual tab.

This is how I set it:

set expandtab

set shiftwidth=4

set softtabstop=4

First I thought as this question says that a plugin is override it, but I executed:

:verbose set expandtab?

and indeed I get that last set is the line in my vimrc

how can I solve it?

0

1 Answer 1

0

There are two places you can set it: 1. $HOME/.vimrc 2. inline inside the file

.vimrc #1 This is the settings I'm using:

"indent settings
set shiftwidth=4
set softtabstop=4
set expandtab
set nocompatible  " <= vim, not vi

And it works for me, also make sure you're using vim not vi (?) ..

Inline #2

inline settings for vi supported only when using set modeline Meaning in your $HOME/.vimrc paste: set modeline and re-edit your file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.