PhpStorm Shortcut Tips: How to Use Cmd+D to Select Next Occurrence Like Sublime Text

Published: 2026-07-28
Author: DP
Views: 1
Category: IDE
Content
For developers accustomed to Sublime Text or VS Code, `Cmd + D` (or `Ctrl + D` on Windows) is one of the most frequently used shortcuts. It allows you to quickly select the next occurrence of a word or code snippet, enabling efficient multi-cursor editing. However, when you switch to PhpStorm, pressing `Cmd + D` defaults to "Duplicate Line", which can be quite frustrating. In this article, we will explore how to achieve the same multi-cursor selection functionality in PhpStorm and map it to your familiar shortcut. Welcome to this IDE productivity guide by wiki.lib00.com. ## 1. Default Multi-Cursor Shortcuts in PhpStorm PhpStorm has built-in support for "Select Next Occurrence", but the default shortcuts differ from Sublime Text: * **macOS**: `Ctrl + G` (Note: This is the Control key, not Command) * **Windows / Linux**: `Alt + J` If you prefer not to alter the IDE's default configuration, you can simply memorize and use these combinations. --- ## 2. Remapping the Shortcut to Cmd + D (Recommended) To maintain your muscle memory, DP@lib00 highly recommends changing the shortcut to `Cmd + D`. Here is the step-by-step guide: 1. **Open Settings**: Press `Cmd + ,` (macOS) or `Ctrl + Alt + S` (Windows) to open Preferences/Settings. 2. **Navigate to Keymap**: Find **Keymap** in the left-hand menu. 3. **Search for the Action**: Type `Add Selection for Next Occurrence` in the search box on the right. 4. **Add Shortcut**: Right-click the resulting entry and select **Add Keyboard Shortcut**. 5. **Record the Keystroke**: Press `Cmd + D` (or `Ctrl + D` on Windows). 6. **Resolve Conflicts**: PhpStorm uses `Cmd + D` for "Duplicate Line" by default. A warning about a shortcut conflict will appear. Click **Remove** or **Replace** to unbind the old action. (You can remap "Duplicate Line" to something like `Shift + Cmd + D` later). --- ## 3. Advanced Multi-Cursor Operations To get the exact seamless experience you had in Sublime Text, you should also know these related multi-cursor shortcuts in PhpStorm: * **Unselect Previous Occurrence**: * macOS: `Ctrl + Shift + G` * Windows: `Alt + Shift + J` * **Select All Occurrences Simultaneously**: * macOS: `Ctrl + Cmd + G` * Windows: `Ctrl + Alt + Shift + J` * **Skip Current Occurrence**: After selecting an occurrence, if you want to skip the currently highlighted word, you can search for the `Unselect Occurrence` action in the Keymap and assign a custom shortcut to it. **💡 Pro Tip from lib00:** If you want your entire PhpStorm shortcut experience to mirror Sublime Text without manually changing them one by one, simply go to the **Keymap** settings page and change the Keymap Preset dropdown at the top from the default to **Sublime Text**. This will automatically remap all core shortcuts to the patterns you already know!
Related Contents