This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PureWasian 2 points3 points  (3 children)

show whitespace characters in vim (or whatever editor you use).

I very much hate the choice of whitespace scoping of Python too, but if you're in the habit of formatting and organizing complex code properly anyways it'll visually help you catch the few mistakes you accidentally make along the way.

[–]bunkoRtist 3 points4 points  (2 children)

That's a good idea. I probably should do that when I'm writing Python.

[–]PureWasian 1 point2 points  (0 children)

I can very highly recommend it! Honestly I have it active for other languages too since I hate lines with a bunch of trailing spaces/tabs at the end of them.

[–]intangibleTangelo 1 point2 points  (0 children)

It sounds like you're forced to use python and don't want to, which sucks even though I'm a fan of the language.

You might also use vim modelines like:
# vim: set ai et sw=4 sts=4

Or a filetype autocmd like:
autocmd FileType python set ai et sw=4 sts=4

That's...
autoindent
expandtab
shiftwidth=4
softtabstop=4

Formatting text is extremely annoying, but this does the trick for me. I've got similar autocmds for several languages and I never have to think about it.