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

New horizons

I originally started this blog with ideas of reviewing devices and services and hoping that eventually if it gets popular enough somebody starts sending me stuff to review. A lot has changed since, I stopped obsessing that much about new gadgets and got into vintage electronics, many of things that were new and interesting a few years ago are a commodity now. I thought about reviewing the phone I finally got to refreshing last year (S23 Ultra is ok upgrade for Note 8, I'm glad that new ultras will finally have flat screen again, I might upgrade next year or so just for that) but I don't really feel like it or think it would mean much for the readers. Most of my vintage electronics is at home where I haven't been for a couple years and it's not something I can currently do something about, I touched a soldering iron like once or twice this year. I might post something work-related once I get the hang of what I'm actually doing there and have some rough ideas wen dece...

Huawei TalkBand B3 (active) review

Despite the fact that no manufacturer ever sent me any free gadget for review, I'm continuing doing it. Maybe I'll become a popular reviewer and they will change their mind. This post will be the first in this year's wearable gadget reviews. To put it into perspective for those who don't know me, I'm not a fitness person, like at all. I eat healthy, I walk kinda a lot, I do some aerobics and occasional cardio but that's it. I'm too lazy even for jogging. But, for some reason, I currently have not one, not too, but three fitness trackers on my wrists. Yeah, crazy, I know, but that was the only way to compare them properly. By the way, wearing TalkBand on the same wrist with anything else is super inconvenient, you can hardly take it out for calls. But more on that later. Why do I need any fitness tracker? Apart from knowing time, I like to know how active I'm during the day, and, more importantly, track my sleep. I have some issues in that department so...

Using virtualenv for more than Python projects

Sorry, it's not a complete instruction, just a thought. It occurred to me (some time ago) that Python's virtualenv is, essentially, a simplified version of system "prefix", it has bin, lib, include, and can have more stuff when needed. If you're willing to experiment (you'll probably have to set a few additional environment variables and/or build flags but that's no big deal), you can install various other tools there up until you have a complete system with its own compiler and complete set of libraries although it's much simpler to keep using system compiler and libraries only complimenting them when needed. Granted, prefixes are nothing new, people were using /opt (and their home directory) this way since the beginning of time. But with little help of virtualenv-wrapper or pyenv you can easily switch between them and isolate environments better. Binaries and stuff installed in virtualenv would override system defaults but only when venv is activat...