Vim is really cool.  I have a couple of options that make it a little
more convenient to edit my Python files.  For example, the following
line makes it so that whenever I open a .py file, the tab key does 4
spaces instead of a tab character:

autocmd FileType python setlocal et sw=4 sts=4 

I also have the following line, which makes it so that any new file I
create that ends in .py gets started with a template Python script:

autocmd BufNewFile *.py 0r ~/.vim/skel.py

The skel.py file looks like this (everything inside the triple quotes):

"""
#!/usr/bin/env python


# vim: et sw=4 sts=4
"""

Who really wants to type "#!/usr/bin/env python" every time they make a new
file?  The ending line makes it so that any other Vim users that open my
file automatically get the same tab expansion settings.  Anyway, when I
create a new file, it looks like this:

"""
#!/usr/bin/env python


# vim: et sw=4 sts=4

"""

My question is why is there an extra blank line at the end of new .py
files I create?  The skel.py file doesn't have an extra line at the end.
Also, how do you stop it from making that new line?


-- 
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55  8012 AB4D 6098 8826 6868

Attachment: signature.asc
Description: Digital signature

--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info: http://uug.byu.edu/cgi-bin/mailman/listinfo/uug-list

Reply via email to