- IntelliJ IDEA keyboard shortcuts
- Choose the right keymap
- Learn shortcuts as you work
- Use advanced features
- Configure keyboard shortcuts
- Add a keyboard shortcut
- Add a mouse shortcut
- Add an abbreviation
- Reset action shortcuts to default
- Location of user-defined keymaps
- Conflicts with global OS shortcuts
- Intellij idea hotkeys mac os
- 4. Find and Replace Shortcuts
- 5. Refactoring
- 6. Usage Shortcuts
- 7. VCS/Local History
- 8. Live Templates
- 9. Navigation Shortcuts
- Записки программиста
- Краткая шпаргалка по сочетаниям клавиш в IntelliJ IDEA
IntelliJ IDEA keyboard shortcuts
IntelliJ IDEA has keyboard shortcuts for most of its commands related to editing, navigation, refactoring, debugging, and other tasks. Memorizing these hotkeys can help you stay more productive by keeping your hands on the keyboard.
If your keyboard does not have an English layout, IntelliJ IDEA may not detect all of the shortcuts correctly.
The following table lists some of the most useful shortcuts to learn:
Shortcut | Action |
---|---|
Double Shift | |
Alt+1 | Focus the Project tool window |
Escape | Focus the editor |
If you are using one of the predefined keymaps for your OS, you can print the default keymap reference card and keep it on your desk to consult it if necessary. This cheat sheet is also available under Help | Keymap Reference .
Choose the right keymap
To view the keymap configuration, open the Settings/Preferences dialog Ctrl+Alt+S and select Keymap .
Enable function keys and check for possible conflicts with global OS shortcuts.
Use a predefined keymap
IntelliJ IDEA automatically suggests a predefined keymap based on your environment. Make sure that it matches the OS you are using or select the one that matches shortcuts from another IDE or editor you are used to (for example, Eclipse or NetBeans).
When consulting this page and other pages in IntelliJ IDEA documentation, you can see keyboard shortcuts for the keymap that you use in the IDE — choose it using the selector at the top of a page.
Tune your keymap
You can modify a copy of any predefined keymap to assign your own shortcuts for commands that you use frequently.
Import custom keymap
If you have a customized keymap that you are used to, you can transfer it to your installation.
Besides the default set of keymaps, you can add more as plugins (such as, keymaps for GNOME and KDE): open the Settings/Preferences dialog Ctrl+Alt+S , select Plugins and search for keymap in the Marketplace.
If your keymap stopped working after an update, it is likely that the keymap is not available by default in the new version of IntelliJ IDEA. Find this keymap as a plugin and install it on the Plugins page as described in Manage plugins.
Learn shortcuts as you work
IntelliJ IDEA provides several possibilities to learn shortcuts:
Find Action is the most important command that enables you to search for commands and settings across all menus and tools.
Press Ctrl+Shift+A and start typing to get a list of suggested actions. Then select the necessary action and press Enter to execute it.
Key Promoter X is a plugin that shows a popup notification with the corresponding keyboard shortcut whenever a command is executed using the mouse. It also suggests creating a shortcut for commands that are executed frequently.
If you are using one of the predefined keymaps for your OS, you can print the default keymap reference card and keep it on your desk to consult it if necessary. This cheat sheet is also available under Help | Keymap Reference .
To print a non-default or customized keymap, use the Keymap exporter plugin.
If an action has a keyboard shortcut associated with it, the shortcut is displayed near the name of the action. To add a shortcut for an action that you use frequently (or if you want to change an existing shortcut), select it and press Alt+Enter .
Use advanced features
You can further improve your productivity with the following useful features:
If there is a group of actions that you often use, create a quick list to access them using a custom shortcut. For example, you can try using the following predefined quick lists:
Refactor this Ctrl+Alt+Shift+T
VCS Operations Alt+`
IntelliJ IDEA provides a lot of typing assistance features , such as automatically adding paired tags and quotes, and detecting CamelHump words.
When the focus is on a tool window with a tree, list, or table, start typing to see matching items.
Many actions in IntelliJ IDEA provide more results when you execute them multiple times. For example, when you invoke basic code completion with Ctrl+Space on a part of a field, parameter, or variable declaration, it suggests names depending on the item type within the current scope. If you invoke it again, it will include classes available through module dependencies. When invoked for the third time in a row, the list of suggestions will include the whole project.
Resize tool windows
You can adjust the size of tool windows without a mouse:
To resize a vertical tool window, use Ctrl+Alt+Shift+Left and Ctrl+Alt+Shift+Right
To resize a horizontal tool window, use Ctrl+Alt+Shift+Up and Ctrl+Alt+Shift+Down
Источник
Configure keyboard shortcuts
IntelliJ IDEA includes several predefined keymaps and lets you customize frequently used shortcuts.
To view the keymap configuration, open the Settings/Preferences dialog Ctrl+Alt+S and select Keymap .
IntelliJ IDEA automatically suggests a predefined keymap based on your environment. Make sure that it matches the OS you are using or select the one that matches shortcuts from another IDE or editor you are used to (for example, Eclipse or NetBeans).
You cannot change predefined keymaps. When you modify any shortcut, IntelliJ IDEA creates a copy of the currently selected keymap, which you can configure. Click to duplicate the selected keymap, rename, remove, or restore it to default values.
A custom keymap is not a full copy of its parent keymap. It inherits unmodified shortcuts from the parent keymap and defines only those that were changed. For information about the keymap files, see Location of user-defined keymaps.
The keymap itself is a list of actions with corresponding keyboard and mouse shortcuts, and abbreviations. To find an action by name, type it in the search field. If you know the shortcut of an action, click and press the key combination in the Find Shortcut dialog.
When consulting this page and other pages in IntelliJ IDEA documentation, you can see keyboard shortcuts for the keymap that you use in the IDE — choose it using the selector at the top of a page.
To view the keymap reference as PDF, choose Help | Keymap Reference from the main menu.
Add a keyboard shortcut
On the Keymap page of the Settings/Preferences dialog Ctrl+Alt+S , right-click an action and select Add Keyboard Shortcut .
In the Keyboard Shortcut dialog, press the necessary key combination.
If you want to use Enter , Escape , or Tab , click and select the necessary key or combination. Pressing them in the Keyboard Shortcut dialog will result in the actual action, such as closing the dialog.
If necessary, select the Second stroke checkbox to define a complex shortcut with two sequential key combinations.
Click OK to save the shortcut.
The key combination that you press is displayed in the Keyboard Shortcut dialog, as well as a warning if it conflicts with existing shortcuts.
Add a mouse shortcut
On the Keymap page of the Settings/Preferences dialog Ctrl+Alt+S , right-click an action and select Add Mouse Shortcut .
In the Mouse Shortcut dialog, move the mouse pointer to the central area and click or scroll as necessary.
Click OK to save the shortcut.
The performed mouse manipulations are displayed in the Mouse Shortcut dialog, as well as a warning if it conflicts with existing shortcuts.
Add an abbreviation
An abbreviation can be used to quickly find an action without a shortcut. For example, you can press Ctrl+Shift+A and type the name of the Jump to Colors and Fonts action to quickly modify the color and font settings of the element under the current caret position. If you assign an abbreviation for this action (like JCF ), you can then type it instead of the full action name.
On the Keymap page of the Settings/Preferences dialog Ctrl+Alt+S , right-click an action and select Add Abbreviation .
In the Abbreviation dialog, type the desired abbreviation and click OK .
Reset action shortcuts to default
If you changed, added, or removed a shortcut for an action, you can reset it to the initial configuration.
On the Keymap page of the Settings/Preferences dialog Ctrl+Alt+S , right-click an action and select Reset Shortcuts .
Location of user-defined keymaps
All user-defined keymaps are stored in separate configuration files under the keymaps subdirectory in the IntelliJ IDEA configuration directory:
\keymaps Example C:\Users\JohnS\AppData\Roaming\JetBrains\IntelliJIdea2021.2\keymaps
By default, this directory contains only the default keymaps. When you modify one of them, IntelliJ IDEA actually creates a child keymap file that contains only the differences relative to the parent keymap. For example, if you modified the default Windows keymap, your custom keymap will be its child. The file will contain only the shortcuts that you added or modified, while all other shortcuts of your custom keymap will be the same as the default Windows keymap.
You can share your custom keymaps with team members or between your IDE instances. Copy the corresponding keymap file and put it in the keymaps directory on another IntelliJ IDEA installation. Then select the copied keymap on the Keymap settings page.
Conflicts with global OS shortcuts
Predefined keymaps do not cover every possible platform, version, and configuration. Some shortcuts can conflict with global system actions and shortcuts for third-party software. To fix these conflicts, you can reassign or disable the conflicting shortcut.
IntelliJ IDEA detects conflicts with system shortcuts and notifies you with a popup message:
Click Modify shortcuts to open the Keymap settings dialog where you can make the necessary adjustments:
Here are a few examples of possible system shortcut conflicts with the default keymap in IntelliJ IDEA. Make sure that function keys are enabled on your system.
Источник
Intellij idea hotkeys mac os
Basic Code Completion
Ctrl + Shift + Spacebar
Smart Code Completion
Quick Documentation Setup
Command + Shift + Enter
Command + Option + T
Comment/Uncomment with Line Comment
Comment/Uncomment with Block Comment
Option + Up Arrow
Option + Down Arrow
Show Intention Actions and Quick Fixes
Command + Option + L
Duplicate Current Line
Command + X / Command + C / Command + V
Cut/Copy/Paste Current line to Clipboard
Ctrl + Option + O
Ctrl + Option + I
Delete line at caret
Smart line join
Smart line split
Close Active Editor Tab
Expand/Collapse Code block
Delete to end word
Delete to word start
Select till code block end
Select till code block start
Command + Shift + U
Switch case for Word at Caret or Selected block
4. Find and Replace Shortcuts
Command + Shift + G
Command + Shift + F
Command + Shift + R
Replace in Path
Select Next Occurance
Command + Ctrl + G
Select All Occurance
5. Refactoring
Command + Option + N
Command + Option + M
Command + Option + F
Command + Option + P
Command + Option + C
Command + Option + V
6. Usage Shortcuts
Find Usage in File
Command + Shift + F7
Highlight Usage in File
Command + Option + F7
7. VCS/Local History
VCS Quick Popup
Commit Project to VCS
Update Project from VCS
Command + Shift + K
8. Live Templates
Insert Live Template
Command + Option + J
Surround with Live Template
9. Navigation Shortcuts
Command + Shift + O
Command + Option + O
Go back to Previous tool window
Hide Active/Last Active Window
Recent files Popup
Select current file/Symbol in any View
Ctrl + Left Arrow / Ctrl + Right Arrow
Go to Next/Previous Tab
Go to Type Declaration
Command + Option + Left Arrow / Command + Option + Right Arrow
Источник
Записки программиста
Краткая шпаргалка по сочетаниям клавиш в IntelliJ IDEA
Как ранее уже сообщалось, я начал активно изучать возможности IntelliJ IDEA. В частности, я стараюсь запомнить наиболее востребованные хоткеи, чтобы выполнять большую часть работы, не отрывая руки от клавиатуры, как это происходит при программировании в Vim. По моим наблюдениям, это реально экономит кучу времени. Я сделал для себя шпаргалку по хоткеям IDEA, которую вы найдете под катом. Полагаю, она также пригодится кому-то из посетителей данного блога.
Примечание: Те же сочетания клавиш работают и в других продуктах JetBrains, например, PyCharm и CLion.
Ниже не приводятся общеизвестные и очевидные сочетания вроде Ctr+C, Ctr+V или Ctr + S. В IntelliJ IDEA многие хоткеи имеют парный хоткей отличающийся только тем, что в нем дополнительно участвует клавиша Shift. Обычно она добавляет в том или ином виде выделение текста. Например, Ctr + End переводит курсор в конец файла, а Ctr + Shift + End выделяет код от текущей позиции до конца файла. Догадаться о существовании парных хоткеев несложно, поэтому далее они не приводятся. Наконец, если в любом диалоге IntelliJ IDEA вы видите подчернутые буквы, знайте, что сочетание Alt + буква равносильно использованию соответствующего контрола (обычно кнопок). Например, быстро запушить код в репозиторий можно путем нажатия Ctr + K, Alt + I, Alt + P, а затем снова Alt + P.
Итак, основные сочетания следующие.
Редактирование:
Ctr + Z | Undo, отменить последнее действие |
Ctr + Shift + Z | Redo, отменить последнюю отмену действия |
Ctr + Shift + V | Расширенная вставка из буфера обмена (с историей) |
Ctr (+ Shift) + W | Инкрементальное выделение выражения |
Ctr + влево/вправо | Перемещение между словами |
Ctr + вверх/вниз | Прокрутка кода без изменения позиции курсора |
Ctr + Home/End | Переход в начало/конец файла |
Shift + Del (Ctr + Y) | Удаление строки, отличие в том, где потом окажется курсор |
Ctr + Del | Удалить от текущей позиции до конца слова |
Ctr + Backspace | Удалить от текущей позиции до начала слова |
Ctr + D | Дублировать текущую строку |
Tab / Shift + Tab | Увеличить / уменьшить текущий отступ |
Ctr + Alt + I | Выравнивание отступов в коде |
Ctr + Alt + L | Приведение кода в соответствие code style |
Ctr + / | Закомментировать/раскомментировать текущую строку |
Ctr + Shift + / | Закомментировать/раскомментировать выделенный код |
Ctr + -/+ | Фолдинг, свернуть/развернуть |
Ctr + Shift + -/+ | Фолдинг, свернуть/развернуть все |
Ctr + Shift + . | Сделать текущий скоуп сворачиваемым и свернуть его |
Ctr + . | Сделать текущий скоуп несворачиваемым |
Ctr + R | Замена в тексте |
Ctr + Shift + R | Замена во всех файлах |
Окна, вкладки:
Alt + влево/вправо | Перемещение между вкладками |
Ctr + F4 | Закрыть вкладку |
Alt + циферка | Открытие/закрытие окон Project, Structure, Changes и тд |
Ctr + Tab | Switcher, переключение между вкладками и окнами |
Shift + Esc | Закрыть активное окно |
F12 | Открыть последнее закрытое окно |
Ctr + колесико | Zoom, если он был вами настроен |
Закладки:
F11 | Поставить или снять закладку |
Ctr + F11 | Аналогично с присвоением буквы или цифры |
Shift + F11 | Переход к закладке (удаление — клавишей Delete) |
Ctr + Число | Быстрый переход к закладке с присвоенным числом |
Подсказки и документация:
Ctr + Q | Документация к тому, на чем сейчас курсор |
Ctr + Shift + I | Показать реализацию метода или класса |
Alt + Q | Отобразить имя класса или метода, в котором мы находимся |
Ctr + P | Подсказка по аргументам метода |
Ctr + F1 | Показать описание ошибки или варнинга |
Alt + Enter | Показать, что нам предлагают «лампочки» |
Поиск:
Дважды Shift | Быстрый поиск по всему проекту |
Ctr + Shift + A | Быстрый поиск по настройкам, действиям и тд |
Alt + вниз/вверх | Перейти к следующему/предыдущему методу |
Ctr + [ и Ctr + ] | Перемещение к началу и концу текущего скоупа |
Ctr + F | Поиск в файле |
Ctr + Shift + F | Поиск по всем файлам (переход — F4) |
Ctr + F3 | Искать слово под курсором |
F3 / Shift + F3 | Искать вперед/назад |
Ctr + G | Переход к строке или строке:номеру_символа |
Ctr + F12 | Список методов с переходом к их объявлению |
Ctr + E | Список недавно открытых файлов с переходом к ним |
Ctr + Shift + E | Список недавно измененных файлов с переходом к ним |
Ctr + H | Иерархия наследования текущего класса и переход по ней |
Ctr + Alt + H | Иерархия вызовов выбранного метода |
Ctr + N | Поиска класса по имени и переход к нему |
Ctr + Shift + N | Поиск файла по имени и переход к нему |
Ctr + B | Перейти к объявлению переменной, класса, метода |
Ctr + Alt + B | Перейти к реализации |
Ctr + Shift + B | Определить тип и перейти к его реализации |
Shift + Alt + влево | Перемещение назад по стеку поиска |
Shift + Alt + вправо | Перемещение вперед по стеку поиска |
F2 / Shift + F2 | Переход к следующей / предыдущей ошибке |
Shift + Alt + 7 | Найти все места, где используется метод / переменная |
Ctr + Alt + 7 | Как предыдущий пункт, только во всплывающем окне |
Генерация кода и рефакторинг:
Ctr + Space | Полный автокомплит |
Ctr + Shift + Space | Автокомплит с фильтрацией по подходящему типу |
Alt + / | Простой автокомплит по словам, встречающимся в проекте |
Ctr + I | Реализовать интерфейс |
Ctr + O | Переопределить метод родительского класса |
Ctr + J | Генерация шаблонного кода (обход по итератору и тд) |
Ctr + Alt + J | Обернуть выделенный код в один из шаблонов |
Alt + Insert | Генератор кода — сеттеров, зависимостей в pom.xml и тд |
Shift + F6 | Переименование переменной, класса и тд во всем коде |
Ctr + F6 | Изменение сигнатуры метода во всем коде |
F6 | Перемещение метода, класса или пакета |
F5 | Создать копию класса, файла или каталога |
Shift + F5 | Создать копию класса в том же пакете |
Alt + Delete | Безопасное удаление класса, метода или атрибута |
Ctr + Alt + M | Выделение метода |
Ctr + Alt + V | Выделение переменной |
Ctr + Alt + F | Выделение атрибута |
Ctr + Alt + C | Выделение константы (public final static) |
Ctr + Alt + P | Выделение аргумента метода |
Ctr + Alt + N | Инлайнинг метода, переменной, аргумента или константы |
Ctr + Alt + O | Оптимизация импортов |
Прочее:
Понятное дело, в этой шпаргалке названы далеко не все возможности IntelliJ IDEA. Всем заинтересованным лицам я настоятельно рекомендую вот прямо брать и читать ее замечательную документацию, там очень много интересного. Жаль только, что документация не доступна в виде одного большого PDF файла.
Дополнение: В последних версиях IDEA можно использовать несколько курсоров, разместив их либо при помощи комбинации Alt+Shift+ЛКМ, либо вертикальным выделением при помощи клика средней клавишей мыши. Держа на вооружении сочетание Ctr + влево/вправо, осуществляющего переход между словами, а также другие, можно очень удобно редактировать сразу несколько строк кода.
Источник