Vim as a Python IDE, or Python IDE as Vim

“Vim as a Python IDE” is a hot topic. Everybody knows Vim is an incredible text editor for typing and editing text very quickly and efficiently (if you are an experienced Vim user, that is). Moreover, it is highly customizable, reliable, works in almost any environment and is praised by experienced developers as well. Naturally, lots of people choose Vim as their editor for coding in Python and other languages.

While Vim is a great choice indeed, as soon as you try to use it for anything it wasn’t designed for, you run into problems. For example, if you use it as an IDE. Clearly, many Python developers want it to be an IDE simply because productive Python development requires more than just a great editor. While this may work for some languages, it just doesn’t for Python, which is really hard to maintain on large and complex projects.

With Python, there is a real need to get rid of routine tasks and use supplementary tools like code inspections, error highlighting on the fly, dependency checks, quick-fixes, refactorings, a debugger, frameworks support, testing assistance, Version control, search and navigation, project management, remote development assistance, PEP-8 compliance checks. That’s quite a list. And all these features must work together in a reliable, efficient and robust fashion.

That’s what IDEs are designed for. They provide the necessary level of efficiency and comfort for using many tools and features in one place.

For better or worse, Vim is not an IDE. Sure, it is customizable and supports many things, with lots of plugins and add-ons and other bells and whistles. Yet it’s really far off from being a real IDE.

Here is a poignant example of Vim being overloaded. The result of many sophisticated hacks modifications, which are not clear even for experienced Vim users, is the following cramped editor window:

If you wanted an IDE to begin with, this is definitely the hard way to get one.

PyCharm has an upside-down approach to this problem. PyCharm is a complete IDE with a highly customizable and powerful editor inherited from the IntelliJ Platform. But you don’t have to choose between an IDE or Vim: thanks to the IdeaVim plugin (available for all IntelliJ-based products), you really can get the best of both worlds. IdeaVim supports many Vim features including shortcuts, motion keys, many types of commands, registers, macros, modes  and a lot more.

But don’t take our word for it. “Nothing can replace Vim, but IdeaVim feels closer than any other editor’s attempts,” says Andrew Brookins, an experienced developer who has tried different text editors and tools for Python and Web development, in his amazingly comprehensive review One Year Later: An Epic Review of PyCharm 2.7 from a Vim User’s Perspective. We strongly recommend reading it if you haven’t already.

To enjoy VIM emulation inside PyCharm, download and install PyCharm, go to File | Settings | Plugins and search for IdeaVim. Install it, restart the IDE and that’s it!
Give it a try, and while you’re at it feel free to vote for new features and report any issues in YouTrack.

Develop with pleasure!
PyCharm Team

This entry was posted in Cool Feature, Screencast. Bookmark the permalink.

26 Responses to Vim as a Python IDE, or Python IDE as Vim

  1. G Mc says:

    Why do companies frequently feel that this sort of post — a tearing down of a popular alternative on the basis of sound logic that, gosh, others perhaps haven’t fully considered — isn’t transparent? There are better ways to promote PyCharm and the IdeaVim plugin. Don’t talk down to your customers. Doing so makes you look like JetIdiots.

    • TomP says:

      +1 This is a marketing blurb.

      The line that made me laugh was “Python development requires more than just a great editor. While this may work for some languages, it just doesn’t for Python, which is really hard to maintain on large and complex projects.”

      The truth is that Python is much easier to maintain for large projects than any other language I’ve worked with in my (very long) career as a developer. Version control, syntax checking, testing assistance, refactoring, yada yada yada, are part of development regardless of the language you’re working in.

    • Eric says:

      Agreed. I really like Jetrbrains, and the best marketing push, for me, was Jon Lindquists’ Seeing him effortlessly use shortcuts while teaching a framework immediately proved its value to me.

      JetBrains always seemed like a company that was above silly marketing, which is why you’re getting so many comments about this post at all. I think most of us really love your products and share them with our colleagues. I hope that your marketing conduct in the future reflects your products’ quality.

    • Matt says:

      I disagree. I don’t think that’s what’s happening here at all.

      I don’t work for JetBrains but I have converted over to PyCharm from vim. I think the points they make here are extremely valid, and are indeed the exact reasons I switched to PyCharm in the first place.

      I don’t think they talked down to anyone in that review.

  2. Norbert K. says:

    The vim screenshot has the following windows open:

    - two files
    - a file tree browser, with its help (deliberately?) open
    - an undo tree browser
    - a ctags browser
    - a status line

    Big surprise it looks cramped.

    • behzad says:

      that vim screenshot is more like cold war propaganda than any moment that I had vim open in front of me!

    • florian says:

      Haha, so true.

      “The result of many sophisticated hacks modifications, which are not clear even for experienced Vim users, is the following “: a bad example and bad usage of vim.

      • Xewal Salo says:

        so show me some good examples.. multi class refactorings for example

        i don’t see how you would use VI in big projects with tight schedules and many co-workers..

        either way python sux anyway

  3. David Ichim says:

    You can advertise IdeaVim all you want and I hope that by doing so more users will install it and add bug reports and star missing features… but until major issues like this get some work done after 9 months of no one being assigned we will still have a half baked solution and workflow.

    • Andrey Vlasovskikh says:

      Actually I’ve filed this VIM-288 feature request and it’s obvious that I will work on it as the current plugin maintainer. It’s on my priority list (marked as major) along with window splitting commands (note that I usually fix major bugs first). By the way, IdeaVim is an open-source project open for contributions. There are already several people who have contributed to the project.

  4. yakiang says:

    Does it support a customized .vimrc file ?

  5. Anon says:

    Developers of a paid product bashing a free (as in speech and as in beer) software. Gross.

  6. Bobby says:

    Im a vim nutball – and i now swear by pycharm + ideavim. I had been using plain vim as my python editor for a long time – and still use it for remote editing on servers; That being said, I tried out pycharm with the ideavim about three months ago and it has improved my productivity and the quality of my code base. Pycharm brought several things together: excellent refactoring capabilities, visual step through debugging with realtime pause/breakpoint edits and gevent support, brilliant code and library navigation, code inspection, selective pep compliant formatting that’s vcs friendly, vcs integration (though I still prefer command line hg/git + vimdiff), autocompletion that’s doesn’t need to be configured manually, regex search replace that’s actually better than s/a/b/, fast switching between virtual envs, recognition and maintenance of requirements.txt files, support for multiple vcs flavors, and automatic and frequent detection of remote changes.

    Ideavim Is not vim. But it does support enough vim features for me to work with extreme productivity. If there was a couple of things that I have to flag as killer fails, it’s the poor support for change lists and vsplit/split. Navigating backwards and forwards through changes doesn’t work very well in ideavim. Other than that I don’t find myself missing all that much – the hybrid of core vi features with IntelliJ features more than makes up for the missing vim features – I could never go back.

  7. Burke says:

    Not to be snarky but why pay $100 to get the functionality of something that’s free?

    • Dmitry Filippov says:

      Because you get a complete development environment with many essential features working together in reliable, smooth manner – not simply set of different good tools. And it is really handy. The only way to understand this is to try yourself.

  8. Although vim is great, I’m a big fan of the PyDev plugin for Eclipse. It’s free, graphical, and easy to debug your programs. We have had our Python students try numerous IDEs, and this has by far received the best feedback.

  9. Henri says:

    The vim plugin for Idea is shitty.
    The power of vim isn’t in its legacy command, but in its powerfull configuration capacity.
    Thinking that you could replace a configured vim by your IDE is nonsense. You just don’t know how vim works.

  10. Reed Sorensen says:

    Seriously? You’re trying to promote proprietary software by talking down about vim? Pretty out of touch with your audience, Jetbrains guys.

    • Dmitry Filippov says:

      Hi Reed,
      In my post there was really no intention to talk down about vim. Seriously.
      I was just talking about natural differences between great editor (VIM) and great IDE (PyCharm). Both have their pros and cons. PyCharm is not ideal, but it is Python dedicated complete, convenient, smart and tested solution. But you can’t use it for everything and it has serious limitations. And it consumes a lot of resources. Thats true. Vim in turn is great and I use it by myself… But I wanted just tell you that for python/django development PyCharm works better, easier, simplier than Vim plus bunch of plugins. Especially on big projects, where you need strong solution, which works equally for each member of a team + additional standardized assistance

      • rohit says:

        Hi Dmitry,
        Your answer is simple & clear. I am totally agree with you. I am also big fan of vim, though for projects I prefere pycharm. Every editor has pro & cons. We should be flexible. If pycharm is offering some great features very easily compared to Vim, why shouldn’t we try? Vim is always there, was there & will be there.
        Though, vim plugin is not as much good as original Vim, I have great hope that soon we will get new version. Also instead of criticising plugin, people should try to improve it as Andrey has mentioned already that it is open for contributions.

        • Dmitry Filippov says:

          Hi, thanks! Oh, yeah PyCharm’s vim is just emulation. We don’t pretend it will replace original vim ever. However we try to implement most commonly used vim commands there. Other supposed to be performed by PyCharm’s shortcuts. Still many things to do and we really appreciate any contribution.

  11. rohit says:

    Also I would like to share one more thing. Pycharm has already provided integrated terminal support. Using that we can nicely combine, vim with pycharm.

  12. omar says:

    marketing bullshit.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>