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. The java editor allows users to place break points. The debug perspective offers additional views that can be used to troubleshoot an application. When a java program is started in the debug mode, users are prompted to switch to the debug perspective. The shortcut key to launch the previously launched Java application in the debug mode is F11.3: CommandOptionXJ works for me. Alt + EnterAnd debug : Cmd+F11. To scan using the SonarScanner Docker image, use the following command:There’s a video of all these shortcuts in action on the IntelliJ IDEA YouTube channel. If you visit using Windows or Linux, you will see the keys for that platform.If you need more debug information, you can add one of the following to your. Note: If you visit this page on a Mac, you will see the key bindings for the Mac. This page lists out the default bindings (keyboard shortcuts) and describes how you can update them.
![]() Short Cut Keys To Debug Java Application Code From WithinLike any window in IntelliJ IDEA we can search for something specific in here by typing.We often want to navigate the code from within the code. 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). In fact, escape is useful for closing any popup without applying changes.See Editor Basics for more tips on navigating to and from the editor.The project window may not be the best way to navigate to the file we want. Alt+F7 will show us all the places something is used. If we press ⌥⌘B (MacOS) or Ctrl+Alt+B (Windows/Linux), we can navigate to an implementation instead.See Source Code Navigation for more tips like these last two shortcuts.Instead of finding the declaration, often we want to find where something is used. Pressing it on a class name will take us to the class file. For example, pressing this on a field will take the cursor to the field declaration. ⌥↓ (MacOS) or Ctrl+Shift+W (Windows/Linux), will decrease the selection again all the way back to the cursor.Pressing ⌘/ (MacOS) or Ctrl+/ (Windows/Linux) anywhere on a line will comment out this line of code with a line comment. When extending the selection, IntelliJ IDEA automatically selects the next valid expression in increasing sections. But we can also type the name of something to run to search for other run configurations.We can select increasing or decreasing sections of code near the cursor with ⌥ and Up or Down arrows (MacOS) and Ctrl+W or Ctrl+Shift+W (Windows/Linux). By default, this shows a list of recently run configurations. No matter where we are in the IDE or which file is open, if we double tap Ctrl the Run Anything window opens. Office for mac database index is missing time machine restoreBut it works for more complex code, for example if you press it while you’re writing a “for” loop, IntelliJ IDEA will add the curly braces and place your cursor inside the block. If we’re in the habit of using complete current statement while you’re coding, most of the time it will simply add a semi-colon to the end of the code. Pressing this shortcut again with the cursor anywhere inside the code block will remove the block comment.Complete Current Statement, ⇧⌘⏎ (MacOS) or Shift+Ctrl+Enter (Windows/Linux), is one of the most useful shortcuts while coding. Formatting can even add curly braces if this is required by our standards. This can be set to either just format the lines that have changed in the file, or the whole file. Even if the IDE doesn’t need to add any more code to finish your statement, it’s useful to use this shortcut to put the cursor where you next need it.We can easily format the current file to the project’s standards using ⌥⌘L (MacOS), or Ctrl+Alt+L (Windows/Linux). The dialog also shows us the keyboard shortcut for this specific refactoring if it exists so we can use it directly next time.We don’t have to remember all of these shortcuts. We can select one with the arrow keys and enter, or we can use the number to the left of the refactoring to select it. When we press this shortcut on a symbol or selection we are shown the refactoring options available. Like find action, we can use it for changing settings. Double pressing the shift key opens a search box that lets us look for anything. We can also search for and open tool windows.The ultimate shortcut is search everywhere. Find action will let us search for actions of course, but also settings so we can change settings directly from here. The drop down will show not only the actions, but also the shortcut so that we can learn this shortcut and practice it. When you use the mouse to do something, it flashes up the keyboard shortcut for that action – this is a great reminder to learn that shortcut!Knowing the main keyboard shortcuts for IntelliJ IDEA will help you to be a more productive developer by helping you to stay in the zone. Ubuntu users in particular should check out the very helpful section on conflicts with operating system shortcuts.One final tip: in order to train yourself on using the keyboard instead of the mouse, try out the Key Promoter X plugin. You can also download and print the default keymap so you can put it somewhere that’s always visible while you’re coding.It’s also useful to create abbreviations to quickly find something you use frequently. Remember you can check (and change) your Keymap, which is another place to find useful keyboard shortcuts and to create your own. Search everywhere also supports commands, so for example we can search for settings for the editor.Check out the section on Mastering Keyboard Shortcuts for these and more tips. If we type something to look for, we can see results from classes, files, symbols, and actions.
0 Comments
Leave a Reply. |
AuthorJasmine ArchivesCategories |