In Sublime Text, it's easy to select the next instance of a word by pressing command + d and also place multiple cursors by pressing command & clicking. I know I'm not alone in saying this is an incredibly useful function in editors.
I haven't had any luck in finding any key mappings or Alcatraz plugins for this, so I was interested to see if either there is a way to do this in xcode 5 which I might have missed or if there are plans to implement this in xcode 6?
If there isn't, and any xcode developers see this, would love to see this as a feature and hear your opinions on it :)
It is possible starting from Xcode 10 Beta 3
ALT + ⌘ + E to select next occurence of currently selected
ALT + SHIFT + ⌘ + E to select previous occurence of currently selected
ALT + ⌘ + G to find and select next
ALT + SHIFT + ⌘ + G to find and select previous
You can also use the
Find
menu to find these actions. Of course, feel free to bind it to different hotkeys!Apple just released Xcode 10 beta with the following feature:
Highlight the word you'd like to get the next instance, then press:
⌘ + E
and
⌘ + G.
Continuing to press ⌘ + G will cycle through all instances of the word you pressed ⌘ + E on.
I have more xcode shortcuts on my site that I sometimes reference.
There's the Xcode-Multi-Edit-Plugin. It's still not quite like Sublime because the multiple cursors can't be used to edit beyond the selection you made when you started command-d-ing but it's close enough.
The plugin is not updated for Xcode 7.3 but this can be easily fixed by adding
to the list of similar UUIDs in
<key>DVTPlugInCompatibilityUUIDs</key>
in the plugin's Info.plist. (Found at~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/XcodeMultiEdit.xcplugin/Contents/Info.plist
)Another promising plug-in which currently lacks Xcode 7.3 support is Multiplex.
I just read on twitter that Xcode team has added multiple cursors feature for testing, but kept it hidden.To enable it use following command.
defaults write com.apple.dt.Xcode PegasusMultipleCursorsEnabled -bool true
Link for your reference. Multiple Cursor in Xcode
You can create cursors with
SHIFT + CTRL + click
wherever you need more cursorYou can either use
SHIFT + CTRL + DOWN ARROW
(or up arrow) if you want to create a new cursor on the following line.