Python + vim + spaces vs tab

Hans Mulder hansmu at xs4all.nl
Mon Jun 7 17:18:14 EDT 2010


Jean-Michel Pichavant wrote:
> Hello,
> 
> Does anyone knows a way to configure vim so it automatically select to 
> correct expandtab value depending on the current buffer 'way of doing' ?
> I need to edit different files, some are using spaces, others tabs. 
> Those belong to different projects, and changing all spaces to tabs is 
> not an option for me.
> 
> I can't make vim automatically comply with the current buffer coding 
> style, anyone knows if it is possible ?

If you can't get vim to automatically recognize the different styles you
have to work with, then you could look into adding a "modeline" to each
file.  Typing ":help modeline" in vim will tell you how they work.

Adding such a line to each and every file may be a bit of work, and you
may have to convince other people working on the project that "explicit
is better than implicit".

-- HansM




More information about the Python-list mailing list