I like to use tabs for indentation (hey, don't bully me!). But 33% of other programmers prefer spaces.The norm with Python is to use spaces for indetation. Even so, I configured Vim to use tabs with Python since I recently worked on Python code that was indented with tabs. But right now I'm working on some other Python project which has spaces for indentation...So now I want to make Vim figure out which kind of indentation the file uses and indent accordingly. So my question is how can I accomplish that?I discovered the copyindent option, which seems to solve the problem. But I am unsure whether this is the correct way to solve the problem. Does it have any pitfall? Is there a better way to do this?For the sake of completeness, these are the contents of my .vim/after/ftplugin/python.vim file, which is the one ensuring tabs are used for Python right now. I also have filetype plugin indent on in my .vimrc.setlocal tabstop=4setlocal softtabstop=4setlocal shiftwidth=4setlocal textwidth=80setlocal smarttabsetlocal noexpandtab
Automatically determine whether to use spaces or tabs
vimrc;indentation;filetype python