Select all Occurrences in a File

Quickly select all occurrences of a piece of text in the current file

Do you want to select all the occurrences of a piece of code?

Press ⌘⌃G (macOS) / Ctrl+Alt+Shift+J (Windows/Linux).

After the selection is complete, you can start editing all the fragments as if they were all the same one.

If you plan to use this feature to rename something, then you should have a look at our Rename refactoring, which is designed to work safely across multiple packages, not just at the file level, with full preview and undo support.


Related Resources

Improve Code Readability and Navigation
Improve Code Readability and Navigation
Discover how to manage code visibility with code folding in Go
Create a Function in Another Package
Create a Function in Another Package
Type a non-existing function name and generate its implementation in a package of your choice.
Empower your `Printf`-like functions with coding assistance
Empower your `Printf`-like functions with coding assistance
Provide hints and highlights for message formats in custom `Printf`-like functions.