DEV Community

Cover image for How to Make Vim a Python IDE - Best IDE for Python.

How to Make Vim a Python IDE - Best IDE for Python.

Hamdi Jr on December 09, 2020

Hello everyone, I'm back with another Linux tutorial. We are going to talk about something which is also my personal favorite - VIM. We are all fed...
Collapse
 
nicolus profile image
Nicolus

I haven't tested your setup but it looks more like a nice editor than an IDE (as in "Integrated Development Environment", as in you have all the tools you need to write, test and compile your project). In my opinion here's what you should add to have a true IDE :

  • The ability to run tests and get the results from the IDE
  • The ability to run tests automatically when you change something
  • The ability to place breakpoints and run the debugger from the IDE
  • Git/SVN integration that shows you which lines were changed/added/removed in the gutter, can quickly "git blame" the line you're editing, and of course commit/push from the IDE.
  • An SQL and NoSQL client that integrates with your code (by completing table / column names when you type them in your code for eg.)
  • An HTTP Client to test your APIs right from the IDE.
  • Refactoring features : if you change the name of a variable/function, will it change all the calls automatically ? If you rename a file will it change the rest of your code automatically ? Can you extract a part of code to a new function ? Move some methods to a new class ?
Collapse
 
tacsiazuma profile image
Krisztian Papp
  • vim-test plugin
  • simple autocommand
  • vim-vebugger or vimspector
  • vim-fugitive for commands and vim-signify for gutter.
  • vim-dadbod and vim-dadbod-ui and vim-sql-suggest
  • thats what automated tests for but if you really want it then vim-http plugin
  • that is where it lacks some features, even with coc.nvim, extract features are limited.
Collapse
 
jrhamdi profile image
Hamdi Jr

Thank you for your suggestions.

Collapse
 
nicolus profile image
Nicolus

Great suggestions, thanks !

Collapse
 
daandl profile image
Daan De Lombaert

By the time you've installed and configured all that, you could've just installed PyCharm and be done with it..

Also the more plugins you install, the slower it'll get.

Thread Thread
 
tacsiazuma profile image
Krisztian Papp

And I'd have an IDE which also has a bunch of plugins in order to operate, generally slow and requires a bunch of resources, less configurable, and works for python mostly. Also this configuration is like sharpening an axe. In order to excel in PyCharm you also need to memorize/customize keybindings, etc. The only difference is Vim just requires some of that work upfront.

Collapse
 
jrhamdi profile image
Hamdi Jr

Thank you for your response. I will try to add these features and write another blog soon.

Collapse
 
tacsiazuma profile image
Krisztian Papp

First of all, Vim is anything but easy to learn. That's why the internet is filled with memes about it's steep learning curve. Also, why do you use nano for editing the .vimrc file in a VIM tutorial? And why do you need sudo for that?

Collapse
 
jrhamdi profile image
Hamdi Jr

I used nano because it's beginner-friendly and adding sudo won't cause any errors too.

Collapse
 
tacsiazuma profile image
Krisztian Papp

Yeah, nano is beginner friendly and in any other tutorials I get it why people are using it. But this one is a VIM tutorial :) You could've shown how to copy paste in vim, how to exit it and so much. And your argument "won't cause any errors too" still not justifies the using of sudo.

Thread Thread
 
jrhamdi profile image
Hamdi Jr

Its your personal preference if you want you can use vim. I had troubles using vim before finishing the tutorial.

Collapse
 
ianturton profile image
Ian Turton

It's a bad habit to get into, you should only use sudo when you absolutely need to escalate to root and you should think before doing it.

Thread Thread
 
tooblippe profile image
Tobie

He who plays in root, will eventualy kill tree.

Collapse
 
morggoth profile image
Konstantin Yakovlev

$ cd ~
$ touch ~/.vimrc
$ sudo nano ~/.vimrc

Why use SO many useless commands? That would be enough:

$ vim ~/.vimrc
or
$ nano ~/.vimrc

Collapse
 
sq5rix profile image
Tom

Good job! I use less plugins, and the most important is the mighty coc, which has, basically, everything.

Collapse
 
jrhamdi profile image
Hamdi Jr

Thank you.

Collapse
 
anikethsdeshpande profile image
Aniketh Deshpande

Nice 👍

Collapse
 
jrhamdi profile image
Hamdi Jr

Thank you.