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

About Dmitry Filippov

Product Marketing Manager at JetBrains
This entry was posted in Cool Feature, Screencast. Bookmark the permalink.

49 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.

      • Ankit says:

        “I disagree.”
        “I think the points…”
        “I don’t think they…”

        Get over yourself. While they post wasn’t overtly patronizing, it seemed conceited to assume that the workflow with vim is “cramped” and that this method is “a hard way”.

        Meanwhile, you didn’t give a single reason why they were right other than the three attempts at anecdotes I didn’t fully quote above.

    • Joseph G. Mitzen says:

      What I see all the time is that people get defensive when someone else points out an inferiority in their pet product. I’ve seen MySQL users write in to PostgreSQL blogs asking them not to “tear down” MySQL, Vim/Emacs fans now asking not to show their deficiencies as IDEs, Windows fans not wanting to have Windows problems discussed on Linux websites, Perl users not wanting Perl comparisons on Python blogs, etc.

      As the PostgreSQL author explained, when people are looking at products, an inevitable question comes up: “How does your product compare to X?” It makes no sense to avoid this question as the only way something can be understood to be “good” or “bad” is in relation to what your other options are.

      On the contrary, I’m familiar with some poor products that make no mention of their competition at all on their websites and even one’s CEO declined to give one reason to buy their product over the more popular competition during an interview. Ignoring the competition or refusing to compare often suggests that one knows one has an inferior solution. It also makes it harder for people seeking an overview of their options to decide how products stack up. If a company won’t answer “Here’s why you should buy our product over the competition”, then there probably isn’t a reason.

      I’ve always wanted to know: how/why do people use a text editor as an IDE? Now I know the answer is: they really don’t and they get upset when it’s pointed out. :-(

      Please don’t ask JetBrains to be silent; make Vim better instead.

      • Luna=Luna says:

        “I’ve always wanted to know: how/why do people use a text editor as an IDE? Now I know the answer is: they really don’t and they get upset when it’s pointed out. :-(

        Not sure how you arrive at that conclusion.
        Some people use it as an IDE some people don’t.

        People use Vim because it is exceptional at what it is designed for, ie editing text and thats what programming involves a lot of. It also makes editing text fun at the same time.

        It’s not for everyone, but thats fine.

  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.

      • diefans says:

        The terminal together with a nice (tiling) window manager is the “Environment” in “IDE” where basically everything (tools which do one thing really great?) integrates finally. Vim is “just” the “integrated” editor of a productive python developers IDE – and it is a great editor!

        So when you say “productive Python development requires more than just a great editor” you are right! But you are not right when you suggest, that a “productive” Python developer would consider Vim as his “Development Environment”!

        What you are doing is to reintegrate/simulate all the great tools back into your Editor: File browser, Search, VCS, testrunner, even the terminal, … and you are complaining about an absolutely unusual and unusable vim mockup which you willl never find in wildlife (I guess there might be some cases but I would not consider them “productive”)???

        I have seen pair-programming sessions where the other guy was using PyCharm while I was really wondering how much time and effort several things take in comparision to my IDE.

        I think you are trying to make your editor more than it should be. While everybody – especially productive people – tend to have a very unique pattern of methodology to maintain and improve their productivity, you are constraining those with your own pattern when you sell your product – so this is the end when it comes to improvement or extension, its a bottleneck – a single point of failure!

        From my perspective you are reinventing/simulating something what is already out there. Productive development is always self-development and your Product is hunting those who have not seen a real free IDE yet…

  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.

  13. lasse says:

    This is like: Here you have some red paint, and a horse sticker now your 1980ies VW jetta is a ferrari f40.

    A real feature would be to have a fully loaded vim editor (which is not possible) in the IDE (maybe you should have a look at neovim!)

  14. syahdeini says:

    Actually, I have used pycharm for about three-four months it’s very friendly for someone who doesn’t really mastered vim, but after using vim again, I feel that the speed of vim when coding. I just feel more faster using vim than any modern IDE

    • Dmitry Filippov says:

      There is no one solution for everybody! I think that Vim brings many unique benefits that speedup your coding. But an IDE as approach to coding tools has its own advantages as well. With IdeaVim plugin we try to combine advantages from both worlds of text editors and IDEs.

  15. Jesus says:

    Fuck you vim is the best ide

  16. Sventimir says:

    Give me a good IDE for the three languages that I work with the most: Haskell, Python, Bash (in that order) and preferably for others too. Until you achieve that, Vim will be my very best tool. And besides many refactoring issues can be easily met with use of find and sed in plain terminal. No clicking, no waiting, just learn your tools.

  17. Denis says:

    anything similar for Sublime?

  18. Sudo Myju says:

    well pycharm was kind of sympatic. i’ve installed it on windows machine as why not try trial comerz ide. but that was far before reading this .. i’m disgusted. was that supposed to make you look like profesionals ? wanting to look colorful throwing dirt on the patriarch of all editors? be ashamed .. rm -rf your god damned pyBlastedCharmSmurf

  19. NanoDano says:

    I do not see this post as ‘talking down’ or ‘bashing’ Vim and its users. I like Vim a lot, but I 100% believe JetBrains products are far more efficient and have better features. I also notice a lot of comments for JetBrains include ‘I love X and I couldn’t live without Y any more’. There are many examples given saying ‘but what about doing Z in Vim?’

    What I don’t see a lot of in these comments is “Yeah, but Vim does X and JetBrains doesn’t”

  20. Eddy says:

    Please just make it swallow just a little bit less RAM and will give it another try in the near future.

  21. Dmitriy says:

    hi! can you say what color schema is in the first vim screenshot (not video)? thank you in advance)

  22. Saby says:

    What is the color theme for Vim in this screenshot and font? Very pretty!

  23. poker Dewa says:

    Highly descriptive post, I enjoyed thnat bit. Will there be a part 2?

  24. Rohit Vishwakarma says:

    Other than IntelliJ, none of the Jetbrains products (CLion, WebStorm) are worth the trouble. I will stick to vim. CLion is the absolutely worst, freezes randomly, can’t parse simple template definition is header files, break point doesn’t stop the code where it supposed to be. I’ve gone back to vim and very happy. Youcompleteme plugin does universal auto completion (any language), autoformat plugin does universal code formatting (any languaue), combined with tmux, it is perfect IDE. Did i mention that it doesn’t take more than few MB in RAM.

Leave a Reply

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