Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
James Zwar11,737 Points
Trying to solve a Python/VIM problem (I think)
I keep getting an indentation error when I try to run the code for this lesson. I'm confident it isn't the code because copying and pasting it into workspaces will run.
I'm using VIM (watched kenneth's workshop) - and I think it may be the source of the problem. I made some changes to the ~/.vimrc file to make indentation smaller and I think this threw things off a bit.
My question I suppose is - what is a good setup for python with vim to avoid indentation problems (or other common errors)?
William LiCourses Plus Student 26,868 Points
I'm using vim with python-mode, I believe with this plugin installed, its default setting forces you to write PEP8-compliant Python code.
You may wanna adjust some default setting for python-mode, for example, I don't like the automatic code folding, so I added this line to my
.vimrc to turn it off.
let g:pymode_folding = 0
Also, the rope plugin included with python-mode crashes my vim while triggering certain code completion, so I switched to jedi, which is a much nicer code completion engine. But rope and jedi have conflict issue, so you need to turn rope off if you decide to use jedi or some other code completion plugin.
let g:pymode_rope = 0
Hope it helps.