Welcome to the Treehouse Community
Looking to learn something new?
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,865 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.