It's basically this feature request: https://youtrack.jetbrains.com/issue/IDEA-226455
Maybe they just need a few more votes on it. Or some more popularity.
Or is it just me and most people don't really need this? I'm still not really sure about the optimal remote work setup. Other people might just use Mosh + Tmux + Vim... I heard that Google has some very nice internal web IDE. If there would be a web IDE as powerful as PyCharm and the other JetBrain IDEs, that would also be a nice option.
But serious question though: what workflow do you have that remote code editing is necessary?
I agree that remote code editing is not strictly necessary since you can perform such task with sshfs or git push/pull workflows.
On the other hand, having the remote environment in your local IDE quickens the development and you don't have to setup a full replica of your environment locally.
edit: ML/DL here stands for Machine Learning/Deep Learning
Since it needs to do an incremental build to provide any of the intelligent tools for Rust, it means editing directly on the Surface Go degrades to a text editor experience, while doing the remote editing lets the IDE-like features work.
I wrote a bit more about my setup here: https://mtlynch.io/building-a-vm-homelab/
I want to work on code which runs there in the cluster.
I could have a local Git checkout of the code (partly). But sometimes it's a lot of trial and error, and it would be quite annoying to keep extra care that my local Git checkout gets synchronized with the copy in the cluster. Sometimes it might also have other files as dependencies which are simply only there in the cluster - or it would be extremely complicated to replicated all the same locally, and keep it all in sync. Even if PyCharm could help on the syncing part, it would still not be perfect, and would be annoying.
VS Code Remote SSH is basically perfect and exactly like I want it. The only problem is that I still prefer PyCharm.
For starters, there seems to be more than one way to do it - one of the responses below refers to remote-mounting the filesystem using SSHFS, but another way to do it is through the Tools -> Deployment menu. The SSHFS approach is presumably the better one if your particular problem is trying to write code across several machines; the Tools -> Deployment avenue seems much better suited an actual deployment (it is, after all, in the name).
It's got me wondering whether I could get away with doing all my Python development in VS Code but obviously everyone has different constraints.
Here's an example of how Databricks improved their dev cycle with beefy machines running Bazel + remote cache: https://databricks.com/blog/2019/02/27/speedy-scala-builds-w...
In Pycharm, you don't just open remote files via SSH, the files are actually stored on the local machine. The point is to run the interpreter and the debugger on the remote machine.
This allows an integrated workflow with access to things you might not have on the local dev machine.
If your workflow is editing files in Vim / Sublime Code / whatever and then running them from the command line, I guess there really isn't that much benefit to this.
Examples:
- Access to some firewalled-off machine - Load big amounts of data from another machine while your dev machine is on a low bandwidth connection - Access hardware you might not have locally, such as a big GPU while coding on a light laptop
- Not everybody uses a "standard" set of shortcuts (understandable); so whenever I need to do something on another's system, unless they're on "IntelliJ IDEA Classic" keymap, I'm clueless for a while.
- Not wanting to re-learn the "default" (shipped with) "macOS" keymap in case they change it again because of clashes with system shortcuts
- When switching to Linux (when my MBP just decides to limit all cores to 0.8GHz for thermals and I can get no work done), I have no idea what shortcuts are there. It's a hit-and-miss, hoping Cmd maps to Alt and it's the same combination. If it were possible to replicate the entirety of the Apple keymap on Linux, I'd switch to using IntelliJ IDEA on my beefier linux machine in an instant. (Oh and if there's a terminal configurable such that I can set up iTerm's shortcuts, bliss!)
- "complex" shortcuts, like Cmd-Shift-Option-N; afraid to remap it to something (moreso, figuring out what'd be the best remap option), afraid to hurt my little-finger the more I use that.
No need for endless discussions on which style is best, as the IDE allows you to set the preferences on a per-project basis. It can also read editor config dotfiles so you can use code formatting consistently throughout a team.
And yes, there is no such thing as best style, so at the end of the day it boils down to personal preference. I find myself using the ctrl+alt+l often but before i commit any code i carefully go over everything and change it to my particular liking(which is often close enough to what the IDE has done so I rarely spend more than a minute or two on it). Also the reason why I haven't bothered to dig deep into the preferences.
Another one (not mentioned) is "Dobbel tap and hold Ctrl" to add multiple carets using the arrow keys (might need to enable in settings (Under smart keys)).
Another "smart keys" settings I recommend is "Surround selection on typing quote or brace" (not sure it's default or not)
This is why Ctrl+Shift+T is my favorite browser shortcut!
The issue on their public issue tracker has been open for something like 8 years.
Unfortunately for me this means that no keyboard shortcuts using the Cmd key work, despite me using a built-in macOS keyboard layout with no special customisation.
I also use a built-in macOS keyboard layout with no special customisation, and I regularly use shortcuts with Cmd. Perhaps you might want to change your Keymap in IntelliJ(this can be done by Double Shift -> Type Keymap -> Select new value.
Edit: For me, almost all the shortcuts detailed in this post work, just need to replace Ctrl with Cmd.
Funny you mention that. As a long-time Windows user, that is the first thing I remap when I set up any JetBrains IDE. F2 is the rename shortcut in File Explorer, so I set it to be the refactor variable name shortcut too.
Multi-cursor select is taken care of by vim's visual block. Basic editing/macros/navigation within a single file also done with vim.
For more IDE/multi-file specific tasks I use IntelliJ's shortcuts:
* cmd+shift+f for global search
* 2xshift for symbol search
* cmd+b to jump to method declaration
* cmd+shift+left/right is also useful to jump to previously navigated cursors
refactoring:
* cmd+alt+v/c/m for extracting variable/constants/methods (good for refactoring after prototyping)
* shift+f6 for renaming variables
* alt+enter for suggestions
EDIT: formatting
I have tried VS Code and the minute I couldn't ctrl + click navigate the code or get contextual ctrl + space bar method or input parameter suggestions I abandoned it.
I'm using VSC for a project the moment. You can definitely Cmd+Click on Mac to navigate, so I assume you could too, but perhaps it's not indexing your code for some reason?
I also see completions for method parameters, but I don't yet know the shortcut to redisplay it. Typing the opening brace, or a comma will display it, however.
What I miss the most in VSC is a decent VIM emulator. A number of the shortcuts in that list (and more) can be key combinations in Vim. But even crucial things like search with /, *, #, and ? (find symbol and regex search prev/next) aren't implemented properly, and undo/redo sometimes falls apart and corrupts your code. I believe the emulation in JetBrains products are actually made by the JB team themselves, so they can probably get all the necessary hooks in the extension API for Vim to function properly.
Luckily you can reassign the functions to different keys. For instance I have re-assigned "Show Breakpoints" to Ctrl-Break. Easy to remember right?
I re-assigned Ctrl-I to also Ctrl-E. Why? Because that Evaluates Expressions.
I've been using WebStorm for years now and I still discover useful stuff and keyboard shortcuts in it. That is both great but also a sign of how it is not completely obvious how to do things.
Recently I discovered what I think is the greatest shortcut of them all: Ctrl-Tab.
That pops up a widget from which I can choose which tool-window to make current. Keep the Ctrl down and you can use Tab or arrow-keys to navigate to the tool-window-name you want to activate.
You can add a parameter and specify a default value that will be added to every call site. You can also reorder parameters or delete one and all the call sites will be updated.
Of course fields aren't 'called' per se, so JetBrains didn't do this. I'd been promoting issue IDEA-160274 where ever I could and now you can cursor on a field and press Ctrl+Alt+H (macOS) and see references to that field, and then selectively expand those references in a caller tree.
Double Shift is also extremely helpful to navigate to a file if the project has a lot of nested subdirectories.
Ctrl-Q opens documentation, which you can pin as a tool window.
https://blog.jetbrains.com/phpstorm/2013/02/navigating-betwe...
There is also the `Reopen Closed Tab` action, which it seems doesn't have assigned shortcut by default, but you can assign it to whatever you feel comfortable with.
The menu key (windows and linux only)
Want to fix spelling of a word? Press menu key Want to refactor? Press menu key
You name it... press the menu key.
It's one of my favorites as well. It is really good when you need to quickly rename, reformat or tweak a handful of lines that isn't a viable refactor action.