kartmopa.blogg.se

Better intellij key
Better intellij key







We often want to navigate the code from within the code. Like any window in IntelliJ IDEA we can search for something specific in here by typing. We can also open tool windows from here, including ones that don’t have keyboard shortcuts. This pops up the recent files box which you can navigate using arrow keys. We can view the most recently opened files using ⌘E (MacOS) or Ctrl+E (Windows/Linux). The project window may not be the best way to navigate to the file we want. See Editor Basics for more tips on navigating to and from the editor. In fact, escape is useful for closing any popup without applying changes. Whatever tool window is open, this will put you back in the editor so you can carrying on working with the code. To put the focus back on the editor, press escape. You can navigate the tree using the arrow keys and search by typing. ⌘1 (MacOS) or Alt+1 (Windows/Linux) opens the project window and puts the focus in there. We don’t need the mouse to open tool windows either. Combine this with either Alt+Enter, to see all suggestions and pick one, or Shift+Alt+Enter to apply the first suggestion. We don’t want to use the mouse when navigating between errors and warnings in the editor, so use F2 to jump to the next error, warning or suggestion. We can even use Alt+Enter on code that doesn’t have an error, warning or suggestion: it will show us Intention Actions (one of my personal favourites is to add static imports) and Inspections that are enabled but not set to warn us.

better intellij key

We can also use Alt and Enter where we see warnings and suggestions and we can choose to accept one of these suggestions. When we see an error in our code, if we place the cursor on the error and press Alt+Enter we get a list of suggested fixes for the problem. This keyboard shortcut can be used to fix just about anything by showing us actions for the current context.

better intellij key

There’s a video of all these shortcuts in action on the IntelliJ IDEA YouTube channel. Learning and practicing these shortcuts so they get loaded into our muscle memory can help us to stay in the state of flow. IntelliJ IDEA has keyboard shortcuts for most of its commands related to editing, navigation, refactoring, debugging, and pretty much everything else we might want to do regularly.









Better intellij key