Re:Reworder – A tale of learning Python and launching an app...
by bwooceli on Tuesday October 26, 2010 @09:17PM
(#1836855)
Could not agree more!!!! If you're a vimmy, be sure to add this friendly helper into your .vimrc
:set tabstop=4
:set shiftwidth=4
:set expandtab
Re:Reworder – A tale of learning Python and launching an app...
by mattdawson on Wednesday October 27, 2010 @12:25AM
(#1837248)
Or, if you only want to use these settings for python files, create a ~/.vim/ftplugin/python.vim file. Mine looks like this:
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal textwidth=80
setlocal smarttab
setlocal expandtab
setlocal smartindent
Re:Reworder – A tale of learning Python and launching an app...
by whimsy on Wednesday October 27, 2010 @05:27AM
(#1837884)
Today I learned...
Thanks.
It looks like ftplugin is a native vim extension - is that correct?
Re:Reworder – A tale of learning Python and launching an app...
by mattdawson on Thursday October 28, 2010 @12:45PM
(#1843627)
I'm a bit late in responding, but yes, it's a native vim extension. To make sure your plugins are loaded automatically, put
filetype plugin on
in your .vimrc.
Re:Reworder – A tale of learning Python and launching an app...
by shortlived on Tuesday October 26, 2010 @08:35PM
(#1836769)
I was fixing a makefile the other day with a coworker and it ended up being an indentation issue. And then we asked out loud why anyone would repeat this hell again...
Now, I am not a python programmer, but I am interested to learn more about how the structure via indentation how worked out for the language.
Re:Reworder – A tale of learning Python and launching an app...
by sahillavingia on Tuesday October 26, 2010 @06:47PM
(#1836464)
Ah yes, I'll read more into it! thanks :)
I disagree. Idiomatic Python uses 4 spaces per indent.
Either solely use tabs or solely use spaces, they don’t work well together, at least in my experience
Mixing tabs and spaces is indeed very unwise. You can run Python with the -tt option to make sure you're consistent.
Read Style Guide for Python Code for more advice on this front
I agree ;-) The author probably refers to PEP8, http://www.python.org/dev/peps/pep-0008/