Find and replace in project
You can search for occurrences and usages of targets within a project, and narrow your search by using different scopes and excluding certain items.
Find the search string in a project

- Go to Edit | Find | Find in Files Control+Shift+F .
- In the search field, type your search string. Alternatively, in the editor, highlight the string you want to find and press Control+Shift+F . CLion places the highlighted string into the search field. To see a list of your previous searches, press Alt+ArrowDown . To do a multi-line search, click the icon to enter a new line, and press Control+Alt+ArrowDown / Control+Alt+ArrowUp to browse through occurrences.
- Check the results in the preview area of the dialog where you can replace the search string or select another string, press Control+Shift+F again and start a new search.
- To see the list of occurrences in a separate tool window, click Open in Find Window . Use this window and its options to group the results, preview them, and work with them further. If you want to see each new search result in a separate tab in the Find tool window, click on the bottom of the Find in Files dialog and select the Open Results in New Tab checkbox.
Copy paths or references of the found files
- In the list of search results, right-click the result for which you want to copy a path and click Copy/Reference .
- In the Copy window, select the path or reference you need.
Replace the search string in a project
- Press Control+Shift+R to open the Replace in Path dialog.
- In the top field, enter your search string. In the bottom field, enter your replacement string. For example, if you want to replace a variable name with a new name for a large project, use Replace in Path instead of Rename refactoring since your variable can appear in config files as well.
- Click one of the available Replace commands.
Narrow your search
You can use different options in the Find in Files dialog to adjust your search process.
- Select options such as Words () or Match case () to find the exact word in a project or match the letter case.
- With selected, CLion automatically escapes special regex symbols with backslash \ when you search for a text string that contains them. Keep in mind that if you copy ( Control+C ) the string first and then paste ( Control+V ) it in the search field, the regex symbols will not be taken into account. For more information about regex , refer to the search with regex documentation.
- Click the icon to filter your search. For example, you can filter the search to omit comments or search only in comments instead.
- Select Directory to limit your search to a specific folder. Moreover, you can select the Scope option that offers you a list of predefined scopes for your search. For example, you can limit your search only to the open files in your project. If you work without tabs, the scope Recently Viewed Files or Recently Changed Files option might become quite useful. You can also create your own custom scope, click the Browse icon () to open the Scopes dialog.
Search in the specific file types
Use the File Mask option to narrow your search to a specific file type. You can select the existing file type from the list, add a new file type, or add an additional file mask syntax to search for file types with certain patterns.
- In the Find in Files dialog, select the File Mask checkbox and from the list of file types, select the one you need. CLion limits its search to the specified type.
- If you don’t find the file type you need in the list, enter your file type in the File Mask field. For example, use the following syntax to search only in cpp files: *.cpp . Besides * , other wildcards are supported. If necessary, specify several file types using commas as separators.
Find and replace in project
You can search for a text string within a project, use different scopes to narrow your search process, exclude certain items from your search, find usages and occurrences.
Find the search string in a project

- Go to Edit | Find | Find in Files Control+Shift+F .
- In the search field, type your search string. Alternatively, in the editor, highlight the string you want to find and press Control+Shift+F . PyCharm places the highlighted string into the search field. To see a list of your previous searches, press Alt+ArrowDown . If you need, specify the additional options. PyCharm lists the search strings and the files that contain them. If the search string is found several times on the same line of code, PyCharm merges the results in one line. To do a multi-line search, click the icon to enter a new line, and press Control+Alt+ArrowDown / Control+Alt+ArrowUp to browse through occurrences.
- Check the results in the preview area of the dialog where you can replace the search string or select another string, press Control+Shift+F again and start a new search.
- To see the list of occurrences in a separate tool window, click Open in Find Window . Use this window and its options to group the results, preview them, and work with them further. If you want to see each new search result in a separate tab in the Find tool window, click on the bottom of the Find in Files dialog and select the Open Results in New Tab checkbox.
Copy paths or references of the found files
- In the list of search results, right-click the result for which you want to copy a path and click Copy/Reference .
- In the Copy window, select the path or reference you need.
Narrow your search
You can use different options in the Find in Files dialog to adjust your search process.

- Select options such as Words () or Match case () to find the exact word in a project or match the letter case.
- With selected, PyCharm automatically escapes special regex symbols with backslash \ when you search for a text string that contains them. Keep in mind that if you copy ( Control+C ) the string first and then paste ( Control+V ) it in the search field, the regex symbols will not be taken into account. For more information about regex , refer to the search with regex documentation.
- Click the icon to filter your search. For example, you can filter the search to omit comments or search only in comments instead.
- Select one of the displayed options such as Module or Directory to limit your search. Moreover, you can select the Scope option that offers you a list of predefined scopes for your search. For example, you can limit your search only to the open files in your project. If you work without tabs, the scope Recently Viewed Files or Recently Changed Files option might become quite useful. You can also create your own custom scope, click the Browse icon () to open the Scopes dialog.
Search in the specific file types
Use the File Mask option to narrow your search to a specific file type. You can select the existing file type from the list, add a new file type, or add an additional file mask syntax to search for file types with certain patterns.

- Go to Edit | Find | Find in Files Control+Shift+F .
- In the Find in Files dialog, select the File Mask checkbox and from the list of file types, select the one you need. PyCharm limits its search to the specified type.
- If you don’t find the file type you need in the list, enter your file type in the File Mask field. Besides * , other wildcards are supported. If necessary, specify several file types using commas as separators. You can manually add a file mask in the search field. If necessary, specify several file types separating them with commas.
Search for usages in a project
You can search for usages of a symbol in your whole project or in a scope that you set.
Click to open the Find Usages dialog.
- Go to Edit | Find | Find in Files Control+Shift+F .
- Select the symbol for which you want to find usages. Note that you can extend your search to file usages as well.
- In the main menu, go to Edit | Find | Find Usages Alt+F7 . To see usages of the selected symbol within a file, right-click the context menu in your file and select Find Usages Control+F7 .
- Check the results in the Find tool window. Click to open the Find Usages dialog.
You can also pull out the results from the previous Find Usages actions. Go to Edit | Find | Recent Find Usages and the usage query. While in the Find tool window, you can use the Preview area to check the places where the usages were found, to see a call hierarchy for methods, data flow for fields, and so on.
If PyCharm doesn’t return any results, it will display a message suggesting to opt for more options. You can follow the link or press Control+Alt+Shift+F7 to open the Find Usages dialog where you can set a new scope for your search.
For example, you can set your search scope to production files only or to only open files. To set a custom scope, click . - When you are done setting a new scope, click Find .
If you want PyCharm to show you usages of the selected symbol in the separate window, press Control+Alt+F7 . You can use this window for quick navigation.

Press the same shortcut again to see the usages in the default scope.
To view the results of previous Find Usages actions, go to Edit | Find | Recent Find Usages in the main menu, and then select the usage query.
Disable automatic highlighting of usages
When you place the caret at a symbol, the IDE highlights all usages of this symbol in the current file. Use the F3 and Shift+F3 shortcuts to navigate between highlighted symbols.
In the Power Save Mode, highlighting of usages is disabled.
If necessary, you can disable the automatic highlighting.
- In the Settings dialog ( Control+Alt+S ), go to Editor | General , and clear the Highlight usages of element at caret checkbox.
When the automatic highlighting is disabled, place the caret at the necessary symbol and press Control+Shift+F7 . This will highlight all usages of the symbol in the current file.
Replace the search string in a project

- Press Control+Shift+R ( Edit | Find | Replace in Path ) to open the Replace in Path dialog.
- In the top field, enter your search string. In the bottom field, enter your replacement string. For example, if you want to replace a variable name with a new name for a large project, use the Replace in path instead of the Rename refactoring since your variable can appear in the config files as well.
- Click one of the available Replace commands.
Шпаргалка: Горячие (hotkeys) клавиши PhpStorm и PyCharm

Горячих клавиш в IDE PhpStorm и PyCharm гораздо больше, чем в приведенном ниже списке. Здесь я привел только те, которыми пользуюсь сам (* звездочкой выделил наиболее используемые мною сочетания).
Шпаргалка будет обновляться, если начну использовать новые сочетания.
Для настройки горячих клавиш или добавление собственных сочетаний клавиш перейдите File > Settings > Keymap.
Редактирование
*Ctrl + W — выделение текущего блока. Если нажимать W несколько раз, то будут выделяться родительские блоки по иерархии.
Ctrl + Shift + W — проделывает обратное действие от предыдущего
Ctrl + Y — удаляет строку
*Ctrl + D — дублирует строку
Ctrl + Shift + U — делает выделенный текст или заглавными, или строчными буквами
Ctrl + Delete — удаляет часть от курсора до конца слова
*Ctrl + Alt + L — форматирование кода соответствии с настройками code style.
Ctrl + Shift + V — вставка из истории буфера. Сейчас я пользуюсь *Win + V , стандартным буфером Windows 10 с историей.
*Ctrl + / — закомментировать/раскомментировать текущую строку.
Ctrl + Shift + / — закомментировать/раскомментировать выделенные строки кода.
Ctrl + Shift + J — к текущей строке присоединяет нижнюю.
Ctrl + [ или ] — перемещает курсор в начало или конец блока с кодом, в теле фукции, в теле цикла и т.д.
Ctrl + Shift + ] или [ — выделить код код до конца или до начала блока
*Tab — сделать отступ (табуляцию)
*SHIFT + Tab — убрать отступ
*Ctrl + Alt + Стрелка вверх — перемещает текущую строку вверх.
*Ctrl + Alt + Стрелка вниз — перемещает текущую строку вниз.
Ctrl + Shift + Стрелка вверх — перемещает текущий логический блок вверх (блок if , for и т.д.).
Ctrl + Shift + Стрелка вниз — перемещает текущий логический блок вниз
*Ctrl + Space — выводит возможные варианты автодополнения
Ctrl + курсор мыши над кодом — краткая информация
*Ctrl + клик по названию переменной или метода, или CTRL+B когда курсор установлен на названии, приведет туда, где метод или переменная определены.
*Ctrl + G — перейти к строке по номеру
*Alt + Клик левой кнопкой мышки — мультикурсор, если нужно одновременно несколько курсоров, кликаем мышкой в нужные места, куда нужно их добавить.
*Ctrl + Alt + J — обрамление выделенного текста тегом (нужно выбрать первый пункт из всплывающего окошка)
Поиск / замена
Двойной Shift — поиск по проекту
*Ctrl + F — поиск в текущем файле
*Ctrl + R — поиск и замена
*Ctrl+Shift+E — вызовет всплывающее окно, в котором показаны последние куски кода в разных файлах, с которыми вы работали
Ctrl + Shift + F — поиск в группе файлов (например в проекте или папке)
Ctrl + Shift + R — поиск и замена в группе файлов
Ctrl + N — найти в каком файле находится класс
*Ctrl + Shift + N — поиск файла по названию
Разное
Ctrl + Alt + S — быстрый доступ к настройкам
*Shift + F6 — переименование файла (выделите в блоке с файлами проекта нужный файл).
Ctrl + Insert — создать новый файл
Категории
Свежие записи
- Таблицы в админке WordPress (часть 1)
- Импорт/экспорт Linux WSL
- Не печатаются заглавные буквы в PowerShell
- 1С-Битрикс: Ошибка авторизации! Срок действия пароля истек, необходимо сменить пароль.
- Несколько конфигураций для проекта Django
- Django inclusion_tag с разными шаблонами
Подборка самых полезных горячих клавиш для различных IDE и редакторов кода
Программист должен хорошо знать свой инструмент. Собрали для вас подборку горячих клавиш, повышающих эффективность разработки в различных IDE.
Хорошему программисту нужны хорошие инструменты для работы. Однако самих инструментов мало — нужно ещё владеть ими на должном уровне. Комбинация клавиш Ctrl+C Ctrl+V — незаменимый спутник каждого разработчика, однако в средах разработки есть гораздо больше полезных горячих клавиш, существенно повышающих продуктивность. Мы собрали для вас подборку полезных горячих клавиш для некоторых популярных IDE, чтобы вы могли похвастаться перед коллегами своими мега-скиллами разработки.
IntelliJ IDEA
IntelliJ IDEA — известная IDE от JetBrains для JVM-языков вроде Java, Scala и Kotlin. Укомплектована уникальными инструментами и позволяет без проблем ориентироваться в программе. Есть и другие IDE от тех же разработчиков, например, PyCharm для Python, WebStorm для JavaScript и не только. Они во многом схожи между собой, поэтому большинство из нижеуказанных горячих клавиш должно работать и в других IDE от JetBrains.
- Ctrl + Space — стандартное автодополнение кода;
- Ctrl + Shift + Space — умное автодополнение кода;
- Двойной Shift — искать везде;
- Alt + Enter — показать возможные варианты исправления;
- Alt + Ins — генерация кода (геттеры, сеттеры, конструктор и т.д.);
- Ctrl + P — информация о параметре (применяется на аргументе метода при вызове);
- Ctrl + W — расширить область выделения;
- Ctrl + Shift + W — уменьшить область выделения;
- Ctrl + E — список недавних файлов;
- Shift + F6 — переименовать (переменную, функцию и т.д.);
- Ctrl + R — сделать замену;
- Ctrl + Q — быстрый просмотр документации;
- Ctrl + / — закомментировать/раскомментировать строку;
- Ctrl + Shift + / — закомментировать/раскомментировать блок кода;
- Ctrl + Alt + I — автоматически добавить нужные отступы для строки/строк;
- Ctrl + Shift + A — найти действие;
- Shift + Alt + ↑ — переместить выбранные строки вверх;
- Shift + Alt + ↓ — переместить выбранные строки вниз;
- Ctrl + Shift + F7 — показать все упоминания в файле;
- Ctrl + Alt + L — реформатировать код.
Eclipse
Если вы близки с open-source сообществом, то вы наверняка слышали об Eclipse. Будучи доступным для Linux, Windows и OS X, Eclipse де-факто является open-source IDE для разработки на Java. Существует множество расширений и аддонов, которые делают Eclipse полезным для разного рода задач и разработки на отличных от Java языках программирования вроде Python.
- Ctrl + 1 — быстрое исправление;
- Ctrl + Alt + R — переименовать;
- Ctrl + / — закомментировать/раскомментировать строку;
- Ctrl + Shift + / — закомментировать/раскомментировать блок кода;
- Alt + ↑ — переместить выбранные строки вверх;
- Alt + ↓ — переместить выбранные строки вниз;
- Ctrl + I — исправить отступы;
- Ctrl + Alt + U — показать все упоминания в файле;
- Ctrl + Q — перейти к последнему месту редактирования;
- Shift + Ctrl + X — привести текст к верхнему регистру;
- Shift + Ctrl + Y — привести текст к нижнему регистру;
- Ctrl + Shift + F — реформатировать код;
- Ctrl + Shift + O — автоматически вставить нужные импорты.
Visual Studio 2017
Visual Studio — полнофункциональная IDE от Microsoft, которая во многом сопоставима с Eclipse. Доступная на Windows и Mac OS, Visual Studio представлена как в бесплатном (Community), так и в платном (Professional и Enterprise) вариантах. Visual Studio позволяет разрабатывать приложения для разных платформ и предоставляет свой собственный набор расширений.
- F12 — перейти к определению(класса,метода и т.д.);
- Ctrl + Shift + L — поставить закладку;
- Ctrl + K Ctrl + W — открыть окно закладок;
- Ctrl + Shift + U — привести текст к верхнему регистру;
- Ctrl + U — привести текст к нижнему регистру;
- Ctrl + Shift + V или Ctrl + Shift + Ins — вставить один из 10 последних фрагментов текста, скопированных в буфер обмена;
- Ctrl + K Ctrl + C — закомментировать блок кода;
- Ctrl + K Ctrl + U — раскомментировать блок кода;
- Ctrl + K Ctrl + D — отформатировать весь документ;
- Ctrl + K Ctrl + F — отформатировать выбранный текст;
- Ctrl + K Ctrl + S — обернуть в конструкцию (if-else, цикл for и т.д.);
- Ctrl + ] — когда курсор установлен на скобку, регион, многострочный комментарий или строку, эта комбинация позволит увидеть начало и конец этого блока;
- Ctrl + M Ctrl + O — свернуть все функции;
Atom
Доступный на всех платформах Atom называют «хакабельным текстовым редактором 21 века». Atom написан с использованием Electron — фреймворка для создания кроссплатформенных приложений для десктопа средствами JavaScript, HTML и CSS — и имеет множество расширений.
- Ctrl + Shift + L — выбрать язык файла;
- Ctrl + Shift + D — копирует строку, на которой находится курсор, под неё же;
- Ctrl + Shift + K — удалить строку;
- Ctrl + ↑ — переместить выбранные строки вверх;
- Ctrl + ↓ — переместить выбранные строки вниз;
- Ctrl + R — открывает список со всеми символами (функциями) в текущем файле для быстрого перехода;
- Alt + F3 — выбрать все одинаковые слова;
- Ctrl + ЛКМ — множественные курсоры;
- Ctrl + J — соединить строки;
- Ctrl + [ — убрать отступы для выделенных строк;
- Ctrl +] — добавить отступы для выделенных строк.
Visual Studio Code
Visual Studio Code (не путать с Visual Studio) — полнофункциональный редактор кода, доступный на Windows, Linux и Mac OS X. VS Code является расширяемым open-source редактором, который можно настроить под любую задачу. Как и Atom, VS Code построен на Electron, поэтому у него есть те же преимущества и недостатки.
- F2 — переименовать символ (функцию, переменную и т.д.);
- Ctrl + Shift + O — перейти к символу;
- Ctrl + K Z — перейти в режим Дзен, в котором вас не отвлекают лишние детали;
- Ctrl + / — закомментировать/раскомментировать строку;
- Shift + Alt + A — закомментировать/раскомментировать блок кода;
- Ctrl + Shift + [ — свернуть область;
- Ctrl + Shift + ] — развернуть область;
- Ctrl + H — заменить;
- Shift + F12 — показать все упоминания;
- F12 — открыть определение (функции, класса и т.д.);
- Ctrl + K F12 — открыть определение в другой части экрана;
- Ctrl + K M — изменить язык файла;
- Ctrl + P — быстро открыть файл;
- Ctrl + \ — разделить экран;
- Ctrl + ` — открыть встроенный терминал;
- Ctrl + K Ctrl + S — показать список всех горячих клавиш.
Sublime Text
Sublime Text, написанный инженером из Google с мечтой о лучшем текстовом редакторе, является весьма популярным редактором кода. Доступный на всех платформах, Sublime Text имеет встроенную поддержку редактирования кода на разных языках, а также богатый набор расширений, называемых пакетами, которые расширяют возможности синтаксиса и редактирования.
- Ctrl + K Ctrl + C — переместить экран к курсору;
- Ctrl + Shift + ↑ — переместить выбранные строки вверх;
- Ctrl + Shift + ↓ — переместить выбранные строки вниз;
- Ctrl + Y — повторить действие последней использованной горячей клавиши;
- Ctrl + Shift + V — вставить с правильными отступами;
- Ctrl + F2 — поставить закладку;
- F2 — перейти к следующей закладке;
- Shift + F2 — перейти к предыдущей закладке;
- Ctrl + K Ctrl + U — привести текст к верхнему регистру;
- Ctrl + K Ctrl + L — привести текст к нижнему регистру;
- Alt + Shift + — разделить экран на (в пределах от 1 до 4) колонок;
- Alt + Shift + 5 — разделить экран в виде сетки 2х2;
- Alt + Shift + 8 — разделить экран на две строки;
- Ctrl + Shift + F — поиск и замена в файлах;
- Ввести lorem и нажать Tab — вставляет текст Lorem ipsum…;
- F9 — отсортировать выделенные строки.