Re: VIM and tab to space migration
From: Alejandro López-Valencia (me_at_privacy.net)
Date: 05/05/04
- Next message: Mark 'Kamikaze' Hughes: "Re: a=([],); a[0]+=[1]"
- Previous message: Mark 'Kamikaze' Hughes: "Re: Tkinter vs. wxPython?"
- In reply to: Alejandro López-Valencia: "Re: VIM and tab to space migration"
- Next in thread: Brian Quinlan: "Re: VIM and tab to space migration"
- Reply: Brian Quinlan: "Re: VIM and tab to space migration"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 5 May 2004 20:12:56 GMT
On 2004-05-05, Alejandro López-Valencia wrote in <c7bh99$239b8$1@ID-99513.news.uni-berlin.de>:
> On 2004-05-05, Brian Quinlan wrote in <mailman.279.1083781602.25742.python-list@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 :-)
>
I use these settings myself, but just now after posting, I realized that
it is far better to set the preferences on a per-buffer basis, so I
change my advice to the following:
$ mkdir -p .vim/ftplugin
$ cd .vim/ftplugin
$ vim python_pep8.vim
....
$ cat python_pep8.vim
if exists("b:did_python_pep8")
finish
else
let b:did_python_pep8=1
endif
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set textwidth=80
This way, you can open a python file and a file with a different syntax
on two buffers of the same vim session.
And this is *really* all there is to it.
Cheers
-- 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)
- Next message: Mark 'Kamikaze' Hughes: "Re: a=([],); a[0]+=[1]"
- Previous message: Mark 'Kamikaze' Hughes: "Re: Tkinter vs. wxPython?"
- In reply to: Alejandro López-Valencia: "Re: VIM and tab to space migration"
- Next in thread: Brian Quinlan: "Re: VIM and tab to space migration"
- Reply: Brian Quinlan: "Re: VIM and tab to space migration"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]