A feature of Visual Studio which I’ve always missed in Xcode is the ability to quickly search for the selected text in the editor. Currently, after selecting the text I want to find, I have to hit cmd+c, cmd+f, cmd+v, then enter. Am I missing a shortcut? I would like to be able to select the text I’m looking for, then use a shortcut that would immediately search for the selected text in the current editor.
Find selected text
I would like to be able to select the text I’m looking for, then use a shortcut that would immediately search for the selected text in the current editor.
If you can get by on two shortcuts:
- ⌘ E (menu command Find → Use Selection for Find), then
- ⌘ G (menu command Find → Find Next)
That is helpful, thank you, but not exactly what I was hoping for. With cmd+c, cmd+f, cmd+v I see how many matches were found and can then hit enter to cycle through them, so I was hopeful there was an existing key combination (or the ability to create one) which would mimic those 3 shortcuts but do it in one. i.e. (this is totally made up) cmd+j would magically open the find window, automatically paste the selected text in there, and perform the find for me.
For me, Xcode 16 is showing the match count in the find bar when I hit ⌘E when the find bar is already open, or when I hit ⌘F to open the find bar after ⌘E. Still need to hit ⌘F either way to get keyboard focus into the find bar, however.
But note a huge advantage of ⌘E over ⌘C ⌘F ⌘V is that it puts your search text in the system’s find pasteboard, which is separate from the general pasteboard. So it won’t clobber regular code or text that you are editing via copy and paste.