Live data from Hacker News

Using Vim as a Python IDE

liuchengxu.org

61–70 of 158 posts

Re: Using Vim as a Python IDE

#61

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.

Atom has a nice package with that feature. https://atom.io/packages/Hydrogen

Re: Using Vim as a Python IDE

#62
this look s ok but i don't see a section on pdb integration - i'd say thats key. I'm still looking for a sensible description of how to develop python in emacs. I'm amazed that there doesn't seem to be a de facto way to do it..

Re: Using Vim as a Python IDE

#63
post #51

Earlier quoted context omitted.

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.

Can you elaborate on how you handle the project thing? I really miss having the concept of "solution" and "project" in Vim from VS. Not just to have my files grouped logically in a $Project/{source,include}/blah.{h,cpp} tree, but also to be able to apply per-project settings like clang-complete options, etc. Right now I don't see a way to have e.g. three different projects that all build from the same files, but use different build options (mainly third-party sdk versions) and thus should give me different completions and code navigation.

Re: Using Vim as a Python IDE

#64
post #23
post #2

I keep seeing tmux mentioned recently. Can someone eli5 what it does and why it's useful?

tmux is like structured LSD, opening terminals to the Universe in unlimited instances and recursions of Sessions and Windows and Panes, and Windows and Panes, Panes, Panes ... Panes ... Multiple realities of Sessions can be started, persisted, detached, reattached, and can exist on your local laptop, another machine on your LAN, or school or corporate network, or the Space Station or Mars, all spanned by your one min…

I think you wanted a different link the second time? Give us the full story!

Re: Using Vim as a Python IDE

#65
post #23

Earlier quoted context omitted.

tmux is like structured LSD, opening terminals to the Universe in unlimited instances and recursions of Sessions and Windows and Panes, and Windows and Panes, Panes, Panes ... Panes ... Multiple realities of Sessions can be started, persisted, detached, reattached, and can exist on your local laptop, another machine on your LAN, or school or corporate network, or the Space Station or Mars, all spanned by your one min…

I think you wanted a different link the second time? Give us the full story!

Ah, thanks. https://www.ocf.berkeley.edu/~ckuehl/tmux/

Re: Using Vim as a Python IDE

#66
post #6
post #2

I keep seeing tmux mentioned recently. Can someone eli5 what it does and why it's useful?

tmux is a terminal multiplexer - if you have ever used the `screen` command you already know what it is. I use a macbook pro with iterm2, and I prefer to use a terminal multiplexer instead of tabs or the native screen split of iterm2. If you ssh remote boxes a lot, it is very useful because you will not lose your session in case of an occasional disconnection.

iTerm2 has tmux integration. No need to give up native tabs!

Re: Using Vim as a Python IDE

#67

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…

pycharm let's you do this! this is the only thing I missed from MATLAB. you can set a breakpoint in a script and open up the debug console and see all the live variables and run code. it works perfectly and you get Python + pycharm. I'm spoiled now and anticipate having trouble moving to another language.

Re: Using Vim as a Python IDE

#68

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.

Why not just run PyCharm on your local box and tunnel-via-SSH-and-pydevd to remote-debug your programs on the target system? You get (a) a full IDE running on your local system (no need to install anything on target system); (b) full debugging and breakpoints; (c) your choice of any "real" or "virtualenv" Python deployment on the target machine. Downsides are that your own source code on the local and remote systems need to match (for your step-through-code to make sense), and you need to set up mappings between directories with source code on the local and remote systems -- but that's a low cost for full visibility into how your program runs on the target system.

Re: Using Vim as a Python IDE

#69
Seriously people this is 2017! We have the technology. Learn vi in order to have the same editing experience everywhere but honestly when it comes to IDEs, there are just really good software packages out there with 0 configuration hassle.

Re: Using Vim as a Python IDE

#70

Nice post. I also really like you "space-vim" project. Another similarly named project — "SpaceVim" http://spacevim.org/ — was posted recently. "SpaceVim" was really upsetting because it missed so many of the important ideas of Spacemacs, such as pneumonic keybindings. "SpaceVim" is a garden variety vim distribution coopting the "Spacemacs" name, but you stayed true to the "Spacemacs" principles. Nice work!

A Chinese programmer emailed me because I starred the linked SpaceVim repo. I guess there's some confusion about all the forks of this project.
Post reply on HN