Live data from Hacker News

Using Vim as a Python IDE

liuchengxu.org

51–60 of 158 posts

Re: Using Vim as a Python IDE

#51
post #3

I would love to download a config file with a curated list of plugins that turns vim into a good Python IDE.

Let me augment that with this: I would love to donate to a project that uses ${INSERT_TERMINAL_TEXT_EDITOR} and turns it into a general IDE. I'm talking the full shebang. * Autocomplete/Autoimporting (Static Analysis backed by compiler output) * Formatting * Linting * Fast or able to run over a slow SSH connection. * Default error resolutions (if test() throws an exception generate a try { }) * Global refactoring * T…

I have almost all of this in both emacs and vim and it only took me 5 years to get it just right.

Re: Using Vim as a Python IDE

#52

Earlier quoted context omitted.

VSCode/Atom are great, but for most folks on UNIX they are worthless, since you have to use something else when ssh-d into another machine. So folks build these elaborate Vim and EMACS set-ups so that they could use the same editor and the same config on all of their machines, whether they're local or remote. Vim is an acquired taste, but once acquired, it's pretty awesome.

Well this is your use case. I use Linux every day but I never touch python code directly on remote systems (it's getting automatically or manually deployed). All my python code lives in virtualenv locally here. But I understand when people work for many projects they maybe want to encapsulate it more (vagrant etc.).

Of course, use cases are different. In my case I usually deploy either automatically or manually, but in those rare cases when you can't replicate bug locally there is nothing better than vi. But of course, to each his own.

Re: Using Vim as a Python IDE

#53

Yesterday I've downloaded VSCode and https://github.com/DonJayamanne/pythonVSCode (seriously, look at the GIFs in this repo!) for first time and I had autocompletion (with IntelliSense and documentation lookup), refactoring and code define jumping for Python code out of the box working within 10 minutes in a VirtualEnv. VSCode + one plugin (all opensource) and I had something similar to PyCharm and fast. (nothing aga…

I use vim via ssh and in tmux everyday. I mostly love it.

But sometimes there are merge conflicts. I've settled for xpra and kdiff3 as the mergetool. I just can't handle the problem without a GUI tool.

Re: Using Vim as a Python IDE

#54

The one thing I'd love to see, as a vim user and a scientist, is something like Matlab/RStudio/Spyder where you can explore variables that exist within a session. Maybe it could hook up to an ipython session and you could display it in a separate terminal and send commands with vim-slime to be updated in real time. For the most part, when I need this, I revert to Rodeo (since it has vim bindings like RStudio's), but…

I know you are looking for a python plugin. But since you mention R, have you tried nvim-R? Works for vim 8+

https://github.com/jalvesaq/Nvim-R

Re: Using Vim as a Python IDE

#56

Yesterday I've downloaded VSCode and https://github.com/DonJayamanne/pythonVSCode (seriously, look at the GIFs in this repo!) for first time and I had autocompletion (with IntelliSense and documentation lookup), refactoring and code define jumping for Python code out of the box working within 10 minutes in a VirtualEnv. VSCode + one plugin (all opensource) and I had something similar to PyCharm and fast. (nothing aga…

VSCode/Atom are great, but for most folks on UNIX they are worthless, since you have to use something else when ssh-d into another machine. So folks build these elaborate Vim and EMACS set-ups so that they could use the same editor and the same config on all of their machines, whether they're local or remote. Vim is an acquired taste, but once acquired, it's pretty awesome.

VSCode seems to be great, Atom is mediocre and that is polite.

Re: Using Vim as a Python IDE

#57
post #29

Emacs comes configured with a command called "send-region-to-shell" that will take the current region and send it to a python interpreter. It makes for a great development experience that I haven't seen replicated with other tools and I'm not sure why there's not a bigger interest in it.

Also, comes with org-babel that can do similar stuff with literate programming.. Also not sure how people live without it.

One of the features that elevates org-babel is being able to work on the same data in multiple tools. It's not uncommon for me to start with data in a table, transform it with a bit of python or lisp, and feed the result into gnuplot.

Re: Using Vim as a Python IDE

#58

Earlier quoted context omitted.

I use supercomputers which only have a terminal interface. I found it was easier to do most of the development of the code on my machine with a GUI (e.g. Pycharm or VSCode) and then push code to the cluster for production runs. I use vim for minor adjustments, but it seemed way easier to just push code rather than configuring vim when something like VSCode is so much easier to get set up.

Thing is, you only need to configure Vim once, and then use your version controlled config everywhere for 10 years, very gradually improving it. I doubt VSCode will even exist in 10 years.

Are any of your plugins from 10 years ago still around? You can't compare naked Vim with VSCode.

Also, Visual Studio has been around since 1997 and there's no reason to assume, out of hand, that VSCode won't last as long, being both popular and Open Source.

I'm a Vim user, but cut the FUD.

Re: Using Vim as a Python IDE

#59

Earlier quoted context omitted.

VSCode/Atom are great, but for most folks on UNIX they are worthless, since you have to use something else when ssh-d into another machine. So folks build these elaborate Vim and EMACS set-ups so that they could use the same editor and the same config on all of their machines, whether they're local or remote. Vim is an acquired taste, but once acquired, it's pretty awesome.

Well this is your use case. I use Linux every day but I never touch python code directly on remote systems (it's getting automatically or manually deployed). All my python code lives in virtualenv locally here. But I understand when people work for many projects they maybe want to encapsulate it more (vagrant etc.).

My developer machines I have a neovim setup with a bunch of extra config and plugins, but when doing remote work I often have to use vanilla vi or vim.. and I just put up with it.

If I need to do something significant, i'll scp the file around. I know vim can edit over ssh, but I honestly never do.

I've never tried vscode, but I am tempted to try the remote support: https://github.com/DonJayamanne/pythonVSCode/wiki/Debugging-...

Re: Using Vim as a Python IDE

#60

Earlier quoted context omitted.

I use supercomputers which only have a terminal interface. I found it was easier to do most of the development of the code on my machine with a GUI (e.g. Pycharm or VSCode) and then push code to the cluster for production runs. I use vim for minor adjustments, but it seemed way easier to just push code rather than configuring vim when something like VSCode is so much easier to get set up.

Thing is, you only need to configure Vim once, and then use your version controlled config everywhere for 10 years, very gradually improving it. I doubt VSCode will even exist in 10 years.

I don't even need to configure Visual Studio, and it's been around for 20 years.
Post reply on HN