51 ms·
My Favorite Shortcuts for JetBrains' IDEs
- koalaman 6y agoOne of my favorites, which I didn't think to look for for years, is 'Ctrl + Shift + Enter'. This completes your statement for you. Very convenient and lots of wasted punctuation characters skipped.
- i_dursun 6y agoMy favorite too. I always remap that to shift+enter though.
- bronlund 6y agoOne of my absolute favorites is multi-cursor editing. I first stumbled upon this in Sublime Text, but now I can´t live without it.
- olejorgenb 6y ago`Ctrl+W` is awesome, but after it has been ingrained in the fingers it's easy to close browser tabs by accident :D 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)
- Stratoscope 6y ago> Ctrl+W is awesome, but after it has been ingrained in the fingers it's easy to close browser tabs by accident :D This is why Ctrl+Shift+T is my favorite browser shortcut!
- albertzeyer 6y agoWhile we talk about JetBrains, I think they really should push some priority on their remote development support. Take the VS Code Remote SSH extension as a good example of how it could work, which is extremely seamlessly, and it just works. E.g. even the embedded terminal provides a shell on the remote host, and if you e.g. open a file in there via `code somefile.txt`, it will open in your VS Code. It's basically this feature request: https://youtrack.jetbrains.com/issue/IDEA-226455 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.
- LeonM 6y agoFWIW: In the 2020.1 updates that have been rolled out in the last week the SSH support is now much better. But serious question though: what workflow do you have that remote code editing is necessary?
- o10449366 6y agoMany companies build/execute code on cloud desktops.
- albertzeyer 6y agoI do research on speech recognition and machine learning, i.e. I run lots of TF code, on lots of big data, and it runs for a long time (days, weeks). All the data, user files, everything in our lab is accessible via NFS, and every node in the cluster has the same FS. From the outside, I only have SSH access. 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.
- mtlynch 6y agoNot the parent, but I do all my development with VS Code's remote editing. I generally don't run anything on my main desktop. Instead, I have a local VM server that runs a dedicated VM for each of my projects. Dedicated VMs are great because I never run into a situation where project A relies on node.js version X and starts clashing with project B that relies on node.js version Y. And I just manage everything with Ansible so it's easy to blow away a VM and rebuild it if I ever need to. I wrote a bit more about my setup here: https://mtlynch.io/building-a-vm-homelab/ https://mtlynch.io/building-a-vm-homelab/
- 101101001010 6y ago
- LeonM 6y agoCtrl-alt-L (cmd-alt-L) is my all-time favorite. It reformats the code consistently. It's the first thing I do when I start work on a new codebase, and the last thing I do before a commit. 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.
- GiorgioG 6y agoThank you! I've been using Resharper and IntelliJ (Rider, etc) forever and I somehow I managed to miss that shortcut.
- axegon_ 6y ago+1 on this one. 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.
- wmfiv 6y agoA potential next step if it fits your workflow is to create a macro triggered by save. I have one that optimizes imports, reformats code and do silent code cleanup.
- _josh_ 6y agoI recently installed the "Key Promoter X" plugin, which tells me the keyboard shortcuts for things I do frequently with the mouse. Pretty handy.
- ungawatkt 6y agoAlt-shift-arrow up/down for creating more cursors above/below. Easy multi-line editing (I may have set that up manually, but I do it in every ide now if it's not by default) Ctrl-Q opens documentation, which you can pin as a tool window.
- caseyw 6y agoCtrl+J to select multiple occurrences for editing. That works for me on Linux. I think it’s different on Windows/Mac.
- narcindin 6y agoCtrl + G is select multiple occurrences on Mac. 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.
- galaxyLogic 6y agoI think WebStorm has the problem that the keyboard shortcuts are more or less meaningless key-combinations, it's difficult to remember them unless you use them frequently. 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.
- fakeSocialMedia 6y agoOkay so another jetbrains advertisment? Unethical company, they are on my avoid list because of their marketing alone.
- danpalmer 6y agoThe JetBrains IDEs implement their own raw keyboard event handling, which means that if you have your system set up with a non-standard keyboard layout and JetBrains hasn't implemented their own support, it just won't work. 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.
- enitihas 6y ago> 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.
- danpalmer 6y agoI'm using the Dvorak Cmd-QWERTY layout in macOS. This changes the layout to QWERTY whilst the Cmd key is held so that keyboard shortcuts are mostly in the same physical place (because most are about easy hand movements rather than letter). JetBrains does not match this behaviour.
- Splognosticus 6y agoHuh, never realized that was a thing. Do the shortcuts in the menu show the QWERTY key or the Dvorak one? I'm curious how you learn the shortcuts if it still shows the QWERTY keys.
- danpalmer 6y agoShortcuts all show the correct letter value. So for Ctrl+T, I'd press what is the K key on a QWERTY keyboard. For Cmd+T, I'd press what is the T key on a QWERTY keyboard. This can get a little confusing, but most common shortcuts contain the Cmd modifier on a Mac, so it's only really Terminal/iTerm where things are different. My keyboard is still physically a QWERTY keyboard which makes knowing where Cmd shortcuts are very easy, I can just look. I switched to Dvorak when I was 18, but learnt with a Dvorak keyboard so I didn't learn it well enough and when I got to uni and had to use shared lab machines I couldn't manage and had to switch back. Then just over 3 years ago I had 3 weeks off work so switched at the beginning with no physically different keyboards and learnt it all by position and I'm still using it today. Less hand pain, and I can touch type where before I was proficient but not entirely by touch.
- deleted 6y ago[deleted]
- enitihas 6y agoThe best thing about this is the consistency across languages. Whether I am writing Java,C++,Rust, Go,Javascript, the shortcuts are the same with similar behaviour as much as possible. Shift F6 refactors the variable name. Cmd Alt M refactors a method from a chunk of code. Being able to use this muscle memory across languages is fantastic.
- Stratoscope 6y ago> Shift F6 refactors the variable name. 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.
- GGfpc 6y agoOne of the best things I did now that I work on a Mac was use the force touch trackpad to ctrl-click whenever I push harder and a custom gesture for forwards and backwards.
- thewisenerd 6y agoA couple of "problems" I've had with Jetbrains' (more specifically IntelliJ IDEA's) shortcuts are: - 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.
- MasterScrat 6y agoFYI you can export your shortcuts (and other settings): https://www.jetbrains.com/help/idea/sharing-your-ide-settings.html https://www.jetbrains.com/help/idea/sharing-your-ide-setting...
- Splognosticus 6y agoPersonally I just use Shift-Shift for practically everything. Saves me learning someone else's keymap or dealing with platform-specific bindings, and there are quite a few useful commands that aren't bound to keys anyway.
- karmakaze 6y agoI've switched so many times between my own machines and using others' (on both Mac and Windows) that I can tolerate most of the standard keymaps. I just keep banging until stuff starts to click and my brain can slowly switch over.
- cryptos 6y agoWhile we are at it: Does anyone know how to hide the new commit view? I haven't found a related action I could assign a shortcut to.
- marmalar 6y agoctrl+Up: selects increasingly larger scopes, great for selecting the content of a string literal (either with or without the quotes) or grabbing chunks of call chain
- plumbus420 6y agoI use the vim plugin and various jetbrains commands in IntelliJ. 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
- canterburry 6y agoI've asked this before in other conversations but, what makes VS Code so popular compared to more mature IDEs with a more full fledged set of features like IntelliJ? 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.
- h0l0cube 6y ago> 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.
- hiq 6y agoLast I heard, they were embedding neovim in VS Code, have you tried this? Or did they give up on this?
- h0l0cube 6y agoLooks like it's a thing: https://marketplace.visualstudio.com/items?itemName=asvetliakov.vscode-neovim https://marketplace.visualstudio.com/items?itemName=asvetlia... When my annoyance at the vanilla Vim plugin exceeds my laziness to install and configure Neovim, I'll have a look at it :) Thank you.
- karmakaze 6y agoYou forgot a huge timesaver. I can't remember the shortcut (maybe Ctrl+F6) change method signature. 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.
- ravedave5 6y agoI really wish they had ctrl-shift-t - reopen tab. I use it in chrome so much and it kills me when I accidentally close a file and I can't just reopen.
- tekseven 6y agoThey have a "Reopen Closed Tab" action you can map in Settings -> Keymap. You can also use "Recent Locations" Ctrl-Shift-E to see recently touched files, the first one will be the one you just closed.
- vldx 6y agoYou can use Ctrl+E / Cmd E to invoke the `Recent Files` dialog -- the first file in the list will be the last closed tab. https://blog.jetbrains.com/phpstorm/2013/02/navigating-between-files-in-the-ide-best-practices/ 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.
- avisser 6y agoTo accomplish similar I use "Back" from the Navigate menu regularly and have it bound to cmd+opt+left arrow. Works pretty well - also puts your cursor back to where it was in that file.
- karmakaze 6y agoAnother favourite that I'd been missing since switching from Eclipse (back around Eclipse 3.6/4.2 days) is Field Call Hierarchy. Cursor on a data element and get the 'call hierarchy' from it. 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. [0] https://youtrack.jetbrains.com/issue/IDEA-160274 https://youtrack.jetbrains.com/issue/IDEA-160274
- atulatul 6y agoHere's a video showing top 15 IntelliJ shortcuts by Trisha Gee. I know it's like watching top 15 Federer shots. Some of your favorites may not be there. Still it's quite good. https://www.youtube.com/watch?v=QYO5_riePOQ https://www.youtube.com/watch?v=QYO5_riePOQ
- urineaut 6y agoCtrl + Shift + A is my favourite shortcut in JetBrain IDEs. Having all editor commands in one go without the need to click through menus is a bliss. Especially so because I don't use IDEs as regular as Neovim and thus keep forgetting some shortcuts. Double Shift is also extremely helpful to navigate to a file if the project has a lot of nested subdirectories.
- jakobov 6y agoYou know what the best shortcut is? 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.