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 against vim, just want to mention how impressed I was)
I also have been switching over to VSCode for coding. The vim plugin is pretty decent.
I still keep vim around for huge files though. I work daily with NASTRAN input and output files, routinely multiple 100 mb, sometimes multiple-gb. I edited a 10gb file earlier this week and vim didn't choke up too much. Best editor I've found so far for huge files.
Which VIM plugin are you using? I've tried them all, including the recommended one simply called 'vim', and they are all missing the most basic of features. Go-to-definition (Ctrl-]) was one missing for me just a few hours ago when I last tried it!
I have vscodevim plugin, currently 0.5.2 and it's decent, it's been making progress, yet still it has little things that definitely detract from the experience, like motion keystrokes do not take the key auto-repeat. Actually it works moving by block ({}) and line (+-) but not with character (i,j,k,l) or word motions (wW,bB,eE) or next/previous occurrence of search (nN). Annoying. At least now they've fixed the issue where I had to re-enter a search term when switching buffers. So there's progress, and it will eventually be just as good.
Both VSCode and Atom are memory intensive as well.
That being said I've used PyCharm on a system with 2 GB memory before and that does work okay, you just need to make sure that no other memory-hungry apps run at the same time (browser, email, multimedia) and that the system itself doesn't use too much memory.
Does it support virtual environments that are within a vagrant machine? That is a use case that I hardly find integrated in IDE's (other than pycharm) and so I usually quickly go back to vim and terminal again.
FWIW the "vim" vim-plugin for vscode isn't terrible either, if one wants all that with modal editing. I actually think that vscode with vim plugin is somewhat better on windows than vim is. Depends on how one usually configures vim, of course.
But isn't it still easier to use a proper IDE in the local machine with Linux/Windows/OSX gui and then just git push the code? What advantages does your setup have?
I work from home and I voluntarily choosed exactly this setup. Windows desktop and IDE tools are more comfortable, but the "real" software runs on Linux VM.
VSCode (+ Python plugin) is much faster (I also have the feeling VSCode is using less resources than sublime+Anaconda!) and inline help is much more "helpful" during coding. I'm using Anaconda and Sublime since 1-2 years now and Anaconda is better than nothing but it pales when comparing it to VSCode (+Python plugin).
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.
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 else is just an accident waiting to happen.
> 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.
Our host, Paul Graham, talks about his first successful startup sometimes. It's ViaWeb, now Yahoo Stores, and it made him the rich investor he is today.
He edited the code live on the production server sometimes. And he did it in the repl, not by editing source files, so he didn't even have a record of what he changed that could go into version control.
When you're nimble and you need every advantage to compete, sometimes you have to be able to do things the hard way.
Not that I would recommend it; every ethical programmer in the galaxy has denounced the practice. And they have good reasons.
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 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. Worth every cent.
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.
Console for everything is the same like saying I never touch console, only GUI. There is a usecase for everything... I also want to see how you manage a bigger Java project from console with your 20+ years of expertise.
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.
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.
> Are any of your plugins from 10 years ago still around?
Ctrlp, python (the filetype plugin), vimwiki... most of them honestly.
> You can't compare naked Vim with VSCode.
If you're doing C programming, it's probably close to equivalent out of the box. For Python development, you'll want to at least get the Python plugins; but you'll be doing that in most editors.
IMO, VSCode is interesting, but it's not that spectacular if you've been using any form of IDE (or a decent text editor with plugins). That is, it doesn't offer any major advantages over the other editors.
I know atom is easy to slow down with tons of plugins and extensions but why does it have a bad wrap? I am just curious because I've seen this sentiment but I find Atom has an amazing ecosystem of plugins it's not the editor for me mostly cause I came into it with Sublime that is what I personally like and now recently spacemacs but I'm curious
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.
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:
I also thought the same, you would not recognize it most of the time (even while transferring). But I'm german and I use sometimes Umlauts in filenames/directories. They did not showed up in my Samba share so I got aware of this issue. I think this issue is too hidden.
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.
I used VSCode once and in just ten minutes, I helped a repressive megacorp meet their HN marketing goals, instead of supporting developers who might actually need it.
hm, I also don't like MS. But kudos to this open source editor and what it can do with Python and JS code. It is by the way developed in Switzerland by a former Eclipse founder (Erich Gamma).
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.
I built a small plugin to do that, it's called vim cell mode and provide "send selection to ipython" and "send block to ipython". I find the block mode very useful when developing data analysis scripts.
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.
If you could point to one simple example of this it works be awesome! I've used org-babel but in a very fragmented way. My sessions were separated from each other and I did not use multiple languages on the same data
I did this with a tslime plugin from vim for several years. I used it extensively for javascript, sql, python, and clojure. After awhile, I stopped fighting and switched to spacemacs so I wouldn't have to both do my dayjob and maintain an IDE.
Hadn't heard of w0rp/ale, but it looks like an improvement over Neomake. I feel like I've done a pretty good job at enabling a lot of features with only ~200LOC vimrc[0]. I also avoid dependencies that need to be compiled or depend on a scripting language installed to the system. My .zshrc these days even parallels my vimrc style[1].
Same here, I'd never heard of it. I switched over to check it out, and am very pleased with how much more responsive it is than neomake. It's marking things while I'm still in insert mode, and not waiting till I save the file, quite useful. It's probably going to stick around and be my new go too!
Even though I write ruby and javascript all day, I still like to go and read how others are using vim. I usually walk away with a keybinding or plugin that makes my life better.
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 if I could ditch it that would be amazing. Nothing against Rodeo or other editors, but vim habits are hard to break.
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.
I want to give a shout out to spacemacs.org which let's you do so many of these things and really does feel like the best of Emacs and Vim together. I will say I am a new convert so I can't comment so much in the plugin infrastructure but raw coding is really good and it's very configurable like emacs but without all of emacs overhead
did you have experience beforehand in using emacs? I've been using spacemacs for a couple of weeks, but I'm having trouble getting past the most basic usage, and partially it's because I feel like I don't have much experience with emacs.
I did not in any real sense. I did the tutorial and chose the sane defaults recommended (so called Evil Mode) which gives you some great controls and a nice tutorial you can walk through if you type :tutor at the main screen.
I admit I have never used Vim or Emacs but the tutorial was enough to do movement and I also read this wonderful documentation as well: First this here which gives a wonderful overview of the whole philosophy behind SpaceMacs:
It took me like a week to be efficient but now I'm flying so much faster than I was with VS Code or Atom. I still use Sublimr Text for some things because I like it but this is a great editor and has a lot of potential and is extremely extensible with Emacs lisp and I believe they already have a way to bridge in Vim plugins too
Most of the other comments mention that you can split your screen into tabs and panes. But by far the most important feature of gnu-screen or tmux is the ability to have a shell session running even when you're not logged in. So you can use tmux to start a shell session and run a script(say a command line IRC client) and leave it running. Next you'll just 'detach' from your tmux session and can logout. Your irc client or any number of scripts you started from your tmux session will still be running. You can relogin later and 'attach' to that session and you'll continue where you left off. Infact you can start a tmux session on the server in the office, detach/logout and go home and attach to the same exact screen from home, that you left in the office.
Not to mention you can share your command line shell session/screen with other people!!
This is the best feature of tmux. It's worth pointing out here though (in a post about making the terminal act like an IDE), that you can split the terminal into two panes so you can have an editor and a REPL open at the same time similar to many IDE's. There are even some projects that make it easy to pass code between the editor and the REPL in the other pane, though I have never gotten them to work very well.
vim (and emacs) can do that without the need for a terminal multiplexer (though in vim you need to use a "plugin" for it, or, at least, you used to, and I'm sure the new async functionality in vim 8 has improved the experience quite a bit)
I figured out running screen at the beginning of pretty much every ssh session probably freshman year of college, and it kind of shocks me to hear that people don't regularly do that.
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 mind and The One Mind.
Maybe my favorite feature of tmux, which I don't see mentioned here, is that I can configure it to start up in a certain way.
Using tmuxinator, I might set up a config for a rails project, for instance.
That way when I start tmux I get a vim editor in one window, a bash prompt in the next (for git), a rails server in the third, tests in the fourth, maybe another process in the 5th like sidekiq or something if required. Note, these (tmux-)windows all live inside of one terminal window.
So once you spend about 2 minutes writing that config, you can always start up your environment with tmuxinator start project-name and a few seconds later you're good to go.
The most useful feature of tmux for me is the ability to switch between different projects effortlessly. Within a session i would have multiple windows, one for each project. Within each window i would have one pane for editing code and another pane running a development server. If you've used macos multi desktops you can think of a session as a macos machine, a window as a desktop, and a pane as a application window. And everything is persistent so you can detach from the session and reattach and all your windows and panes will be there as you left it.
A terminal mux. Mux is short for multiplexer, which chooses between different inputs. It is a tool for running keeping multiple terminal sessions open at the same time. These sessions can be attached and detached from, which is often helpful when working on a remote machine you may want to access from different work stations.
The more you use the terminal to do complicated stuff, such as managing screens, the more you actually offload part of the work to your brain. You have to remember mapping, positions, transitions, and think every time you interact with them. This cognitive load takes CPU cycles from your brain instead of your machine, which is then not available for your current task, and of course it tires you more on the long run
That's why, while I use VIM when I have to, I much prefer the technology to handle automatically whatever it can. Like maintaining states, making them obvious and offload any fruitless decision making.
Iterm2 also has a nice tmux integration. You can connect to a session but use native tabs and panes. It even works on remote servers over ssh. You just add a '-CC' arg. (You may also have to enable it in the prefs, don't remember for sure)
It also allows you to "split" your terminal into multiple tabs, panes and windows, which makes it easy to hop back and forth between sessions in multiple environments. As others have said though the killer feature really is that you can run it on a remote machine and attach and detach at will.
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!
I am sorry for that issue, and sorry for all the emails,but SpaceVim is not only copy the name of spacemacs,it has many important ideas of spacemacs, such as layers(plugin and config groups), leader guide,and mappings fuzzy searching.
so I do not want to support it, but when I create SpaceVim, and post blog anout SpaceVim, the author of space-vim comments a lot of unfriendly message.
and here is the link.
so I will apologies to all the people who receive my emails about SpaceVim, but I will not apologies to the author of space-vim.
The maintainer of the competing "SpaceVim" project I mentioned just opened an GitHub issue on my personal dotfiles repo to spam me with his project: https://github.com/superquest/dotfiles/issues/1
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
* The idea of a project (Creating, building, export/importing, libraries, dependencies)
* Automatically generated & maintained building system at the click of a run button
* Documentation at a single click or on hover if possible
* Integrated console for running a project
* File and source manager that should be easy to use
* Binding profiles for Eclipse, NetBeans, JetBrains, VS20XX, ReSharper
Optionally these would be nice:
* Formal Method Verification?
* Coloring/styling of the entire TUI
* Simple to interact with menus
* Rust, Go, JavaScript (Browser & Node), Java, Scala, C, C++, PHP, Python support
* Pluggable language support that allows the plugin to provide static analysis & compiler data
If that can all be provided that could easily sell for $25 to $50 per user and I'd be happy, happy!, to pay every last dollar of it. It'll never happen. The world will never be that kind to software developers.
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.
Part of why I switched to emacs was something called helm: https://tuhdo.github.io/helm-intro.html
It fuzzy matches almost anything: files, function names, or commands
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.
Well, if you genuinely want a braindead alternative to `vim-conda`, you're welcome to this brittle hack I use. (For my purposes, fast-and-dirty has been an efficient solution, but I don't actually recommend this to anyone.)
Add it to your `ftplugin/python.vim`. Requires you to have activated the Conda environment before opening the Python file, uses hard-coded Python versions, doesn't work with multiple environments, doesn't bother with `os.path.join` so no Windows compatibility, etc etc. Like I said: a hack.
" Cheap trick to use the Conda environment with omnicompletion
python3 << EOF
import os
import sys
cenv = os.environ.get('CONDA_PREFIX')
if cenv is not None:
# Taken from `sys.path` as reported by ipython
sys.path.insert(0, cenv + '/lib/python3.5/site-packages')
sys.path.insert(0, cenv + '/lib/python3.5/lib-dynload')
sys.path.insert(0, cenv + '/lib/python3.5/plat-linux')
sys.path.insert(0, cenv + '/lib/python3.5')
sys.path.insert(0, cenv + '/lib/python35.zip')
sys.path.insert(0, cenv + '/bin')
EOF
set omnifunc=python3complete#Complete
edit: mentioned `os.path.join` to warn Windows users and fixed in-place bugfix.
I have been using vim as my primary IDE for small projects for more than a year till previous month. Everything was fine, even optimizing slow plugins was OK for me. The best plugin I used was a YCM, the best autocomplete I've seen in console world, and there were so many problems with it.
Finally I gave up and moved to NeoVim and have no issues with my vim anymore. Maybe later I will give another try to spacevim or emacs. Maybe. So far, keeping my fingers safe :D
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..
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.
You imply that vim is somehow technological inferior to some other tool. I take issue with that. I don't use vim because I have to or some silly 'vim everywhere' argument. I use it because it is a demonstrably superior text editing appliance.
Every so often when vim irritates me I try out PyCharm or vm-whatsit, and while IDE's do have better viz for some use cases, the actual act of manipulating code in-buffer never comes close to speaking vim. And I always add the vim plugin, without them the tool would be of no use to me whatsoever.
I hope someday some tool will eclipse (no) vim, but that's simply not the case in 2017.
I'm in the same boat. Local development only, my terminal is still my IDE. Other editing tools I've attempted and jumped back out of:
PyCharm - No good vim emulation for editing
Spacemacs - Soft locks, Ctrl-] doesn't follow the same word boundaries as Meta-. (which matches Vim's implementation)
Sublime Text - Closest fit (enough that I own a personal license), but again, the vim emulation is pretty bad.
Atom - Slow. Even at its fastest, it's noticeably slower than Vim
VSCode - Slow (though faster than Atom), no good vim emulation.
Yes, most of my criticisms form around the lack of good vim emulation - my muscle memory is very well established. I've just yet to find a good, responsive, and comfortable editing scheme from a non-Vim editor.
I recently switched back to doing Java almost 100% of the time and have been using IntelliJ. There are definitely a lot of Java-specific features I use very heavily that I wouldn't be able to get without a lot of of time and plugins in Vim. But sometimes I hit weird bugs that highlight the relative complexity of the core, and I often feel frustrated by how light-weight it isn't (granted, I've tried some other Java IDEs and it's amazing by comparison).
But I used to work more with various scripting languages, and my gvim setup just couldn't be beat. So light-weight, but easy to set up again if I needed to. Still able to navigate code structures, debug without context switching. I often did something with a partner that amazed them, because they couldn't do it with their IDE; my favorite thing in the world is the look on someone's face when I select a rectangular section of text and change the indentation without affecting the stuff on the left. It was incredibly productive for years. I still occasionally go back there when I'm working in a single Java file, because the vi emulation mode in IntelliJ isn't quite there and I can manipulate the raw text so much faster in gvim.
If you are editing files inside a package, you can generate a tags file for definitions inside that package.
More useful, IMHO, is the general solution of jumping to the definition that would be resolved by the python interpreter, regardless of location. For that, the key binding will depend on the plugin. For `jedi-vim`, you use `<leader>d` [0].
Incidentally, if you're new to using VIM as a python IDE, also note the value of `jedi-vim` providing Python docstrings via the standard VIM keybinding `K`. This is also mentioned in [0].