Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select additional occurrences of a word in TextMate 2

How can I select additional occurrences of a word in TextMate 2? I do this in Sublime Text 2/3 by pressing Ctrl+D (Windows, Linux) or Cmd+D (macOS).

like image 674
azio Avatar asked Sep 22 '12 20:09

azio


1 Answers

Updated answer

As indicated below, ⌃W (Select Word) is the shortcut in the current build.

Previous answer

Taken from the release notes for r9302:


Add two new action methods:

findNextAndModifySelection:
findPreviousAndModifySelection:

These find the next/previous occurrence of what’s on the find clipboard and selects that, but preserves the existing selection. One could e.g. add this to Keybindings.dict:

"@d" = ( "copySelectionToFindPboard:", "findNextAndModifySelection:" );

This binding will likely be default in an upcoming build, but bound to ⌃W (Select Word) and scoped to dyn.selection (so only when a word is already selected).


You can learn more about key binding files at:

  • http://www.hcs.harvard.edu/~jrus/site/cocoa-text.html
  • http://blog.macromates.com/2006/multi-stroke-key-bindings/
like image 51
Michael Sheets Avatar answered Oct 21 '22 20:10

Michael Sheets