How do I prevent vim from replacing spaces with tabs when autoindent is on?
An example: if I have two tabs and 7 spaces in the beginning of the line, and tabstop=3, and I press Enter, the next line has four tabs and 1 space in the beginning, but I don’t want that…
It is perhaps a good idea not to use tabs at all.
If you want to replace all the tabs in your file to 3 spaces (which will look pretty similar to
tabstop=3):(where
^Iis the TAB character)From the VIM online help: