Skip to main content

Nice Python pack for Vim

I usually use Vim for my coding and all other stuff requiring text editing. There are a lot of plugins, scripts, configs, packs for Vim and a lot of them help with Python. But  so far I could not find the pack I'd love and I'm too lazy to make it on my own, so I usually throw out and re-create my whole Vim config dir once a year or so.

This time I used Klen's Python Mode and it's good judging by number of tools involved: almost all code style/syntax helpers I know (pep8, pep257, pyflakes, pylint, mccabe, and pylama to integrate them), autopep8 to help with formatting and stuff, rope for refactoring (sorry, I won't overwhelm this post with links – look for them in readme in github repo). It can more or less integrate with virtualenv and, of course, use Python syntax and identation plugins for Vim.

It provides commands for almost everything but doesn't provide a lot of convenient hot-keys. Also there are no hotkeys for Django stuff: I'd like to have hotkeys or some menu at least for launching Django's dev server and running tests (with quick-jumps to error positions, as usual). Those things are usually needed not only with Django, but there are usualy no standard ways to do it in Flask or whatnot (maybe Flask-Script will do, but I didn't check it out yet).

It can run syntax checkers on every write or on every write if file's changed, but it doesn't work very good when you write a lot of files in tabs at once with :wa (you'll see several windows with errors at once, one per each file). Maybe I'd like to have my test run on each write (preferably with errors in the same window as syntax checkers), or maybe not – tests can be pretty slow.

Also this and almost every other pack lack possibility to set some settings on per-project basis. Sometimes it can help if you need to set paths, scripts, syntax check options.

But if I start building my own vim-python pack someday, I'll probably fork Klen's one. I didn't see anything better with all those external tools so far.

Popular posts from this blog

Settling the bracket discussion once and for all

There are quite a few ways you can format a multi-line function call/list/dictionary in a programming language. With Python (at least with PEP8) it's just two ways: hanging indentation and vertical indentation. The latter is quite straight-forward and I mention it in the notes below. The former one is what this post is about. Well, about a minor but important question of where to place the closing bracket when using it. Yes, style is much more than formatting the commas and brackets so let's settle this and move on to the more important questions. When using hanging indentation, the only true way is this one(*): some_tuple = ( # Nothing here, only opening bracket. item1, item2, item3, item4, # Several items on one line is acceptable though not recommended. item5, # Last comma is important. And never, never place the closing bracket here. ) # Again, nothing here but the bracket and it's on the same level as the opening line. Empty line after the o

Huawei TalkBand B2 review

Ok, so I've bought a new gadget. It was long overdue because I, being a MediaPad X1 user, sometimes feel uncomfortable pulling that monster of a phone just to check the time on answer a call. Of course, Bluetooth headsets are cheap and abundant but I don't really like the idea of keeping one in my ear all the time. And having it not in the ear usually makes it pretty much unusable. Various wearable gdgets that can show time and some notifications aren't new either, and there are a lot of cheap options, but, again, there are even cheaper watches and I don't care much about fitness tracking (I don't mind it though) and notifications (reading long texts is seldom convenient on a small screen anyway). So when I heard about the new TalkBand that combines watch and wireless headset I was all interested, read reviews, became even more interested, and waited a few weeks only because of the price and availability. The price, for most people around the world it might seem a

Russia becomes an internet outcast for some reason

It's starting to happen more and more often to me. I'm trying to use some service and all of a sudden I see an error page, sometimes a custom one but more often generated by cloudflare or a similar service, with error message effectively saying that IP addresses from Russia are banned on the service. And what is even more interesting, most of this services don't have any particular policy reasons not to allow Russian users, it's not not like they are publishing prescribed materials or doing anything interesting whatsoever. A payment processor, a popular online course provider, some random forums and information sites, one site with educational videos that I like (that one is especially funny because I'm banned from the subscription page and so can't pay them but their cdn does't care and I can actually download any video I want). But why does it happen? Is there some recommendation in some popular security guideline "block Russia, Cambodia, and Afghan