'Vim doesn't use tabstop distance in insert-mode

I'm having problems with auto indentation in vim while programming in lisp.

My .vimrc had the following settings for tabs:

set noexpandtab
set autoindent
set softtabstop=0
set shiftwidth=8
set tabstop=8

When I type (if <enter> in insert-mode, a new line is created with an indentation of two spaces. None of my settings say anything about two spaces, so why don't I get a tab? What setting can I use to change the indentation while in insert-mode?

Thanks in advance!

Update: Thanks for the answers, the settings are not overwritten. It has to do with the "default lisp indenting". In the :help lisp it says something about changing the p flag in cpoptions. This is what it says in the help for the cpoptions flags:

p - Vi compatible Lisp indenting.  When not present, a slightly better algorithm is used.

Setting it does change the indent to one space instead of two spaces. Still not sure how to change this to something else though.



Solution 1:[1]

Each filetype can have its own settings in vim. So your .vimrc values can be overwritten in filetype plugins. To learn the current values of the settings for lisp filetype open the lisp file and run the following commands in vim command line:

:set noexpandtab?
:set autoindent?
:set softtabstop?
:set shiftwidth?
:set tabstop?

If they are different from the ones in .vimrc, then your values are overwritten in some plugin.

In order to overwrite them again with your custom values, create the ~/.vim/after/ftplugin/lisp.vim file with the required values:

set noexpandtab
set autoindent
set softtabstop=0
set shiftwidth=8
set tabstop=8

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Draco Ater