Live data from Hacker News

Using Vim as a Python IDE

liuchengxu.org

101–110 of 158 posts

Re: Using Vim as a Python IDE

#101
post #52

Earlier quoted context omitted.

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.

Debugging directly on the production system? Yeah, nobody does that. Well, nobody who has any kind of serious operation going on. If you can't replicate a bug outside a production environment you have a serious deficit in the devops department. You should be able to stage a machine with a copy of the production DB/data and the same reproducible package(code) that currently runs on your production systems. Everything…

>> in those rare cases when you can't replicate bug locally

> directly on the production system?

Why does 'non-local' have to equate to production? Are you able to use an IDE in your container/VM/cloud server?

Re: Using Vim as a Python IDE

#102
post #52

Earlier quoted context omitted.

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.

Debugging directly on the production system? Yeah, nobody does that. Well, nobody who has any kind of serious operation going on. If you can't replicate a bug outside a production environment you have a serious deficit in the devops department. You should be able to stage a machine with a copy of the production DB/data and the same reproducible package(code) that currently runs on your production systems. Everything…

> Debugging directly on the production system? Yeah, nobody does that.

Uh, what bubble are you living in? Almost everyone does that to some extent. We can all pretend we're code ninjas with super clean deployment pipelines and strict policies, but all of us get lazy occasionally.

Re: Using Vim as a Python IDE

#103

I would love to replace Syntastic with ale, but (1) is there a way to have it just highlight the line with the error instead of using the gutter? And (2) is there a way to get it to use pyflakes instead? pylint is a little too aggressive: it complains about modules it can't import which is by design in my working environment.

Install flake8, there's support for mypy, flake8, and pylint. I can't answer the other, but you could always file a feature request.

Re: Using Vim as a Python IDE

#105
post #90

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.

Modern GNU/linux filemanagers support connecting to ssh server and browse and open and edit files just like they are local. You can do it in two seconds. In ubuntu it's file -> connect to server -> type in ssh://username@ip That's it you are done. You can now browse the files as if they are local and use sublime/gedit/VSCode/Pycharm/whatever you want

I like this answer. For everyone who wants to do this by commandline: Search for sshfs and FUSE (also possible on Mac with osxfuse). Only be aware that a mac uses a different kind of utf-8 than unix. My command I use for sshfs on a mac:

  sshfs -o Ciphers=aes128-gcm@openssh.com -o Compression=no -o reconnect \
  -o modules=iconv,from_code=utf-8,to_code=utf-8-mac \
  myremote:/somedirectory/ /mylocalmountdir

Re: Using Vim as a Python IDE

#107

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.

Plugins like https://atom.io/packages/remote-edit allow you to directly edit your remote code while still in the GUI. I still mostly use VIM, but its a nice alternative.

Re: Using Vim as a Python IDE

#108

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.

I have 20+ yrs of using vim. Tried numerous times to switch to emacs, I started using VSCode and love it. It's not useless, my vim skills is still handy. Logging in to servers to hotfix thing is no longer something to brag about. Cattle not pets. If I really need to login to a server to edit something, I don't need a fancy .vimrc. I don't code live on prod.

Re: Using Vim as a Python IDE

#109

Earlier quoted context omitted.

I prefer console in general, for everything. I've been doing this for 20+ years, and you can pry it from my cold, dead hands.

I've only been coding for 11 years professionally, but also as a hobby before that. Only in 2016 did I move most of my work out of VIM into an IDE: the Jetbrains family. That mostly started for better interactive debugging, but with IDEAVim handling 95% of my VIMisms I find that I'm simply coding in PyCharm and PhpStorm by default now. The base editor is open source but you can get the full PyCharm for $99 per year.…

I've used PyCharm. The editing feature is beyond useless to me, because it does not have vim key bindings. How am I supposed to cut and paste code when commands like "y}" don't work? You actually expect me to use a mouse to select things or move the cursor? Ridiculous.

The only thing I've found PyCharm good for is doing other functions, like linting, not for the actual code editing. No IDE is any good for that. Luckily, PyCharm works just fine when the code it's working with changes on the filesystem below it because of the use of an external editor.

Re: Using Vim as a Python IDE

#110

I would love to replace Syntastic with ale, but (1) is there a way to have it just highlight the line with the error instead of using the gutter? And (2) is there a way to get it to use pyflakes instead? pylint is a little too aggressive: it complains about modules it can't import which is by design in my working environment.

Alternatively, add the following to your `~/.pylintrc`. Granted pylint just stops checking those particular modules, but it's better than nothing.

    [TYPECHECK]
    ignored-modules = ssl,pyodbc
Post reply on HN