VIM and tab to space migration

Alejandro López-Valencia me at privacy.net
Wed May 5 16:02:51 EDT 2004


On 2004-05-05, Brian Quinlan wrote in <mailman.279.1083781602.25742.python-list at python.org>:
> Christophe Cavalaria wrote:
>
>> Try adding that line at the end of each modified file :
>> 
>> # vim:sw=4:softtabstop=4:expandtab
>> 
>> It tells vim all the commands it should automatically run when it opens the
>> file and it should get you the correct behaviour for 4 spaces no tab
>> indentation.
>
> Thanks for the suggestion but modifying all my files is a pretty ugly 
> solution. Not that I'm above using it if there is no better way :-)

The better way is to read the fine manual (not that many do, it is too
big :-).

	$ mkdir -p .vim/ftplugin
	$ cd .vim/ftplugin
	$ vim python_pep8.vim
	....

dradul at shangri-la ~/.vim/ftplugin
[238]-% cat python_pep8.vim
if exists("did_python_pep8")
        finish
else
        let did_python_pep8=1
endif
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set textwidth=80

And that's all there it to it.

-- 
Alejandro López-Valencia
qenqhy ng rgo qbg arg qbg pb
http://dradul.tripod.com/
The limits of my language are the limits of my world.
                                    (L. Wittgenstein)



More information about the Python-list mailing list