首页 > 代码库 > sublime搜索和替换-单文件搜索

sublime搜索和替换-单文件搜索

Searching

To open the search panel for the active file, press Ctrl + F. Someoptions and actions available through this panel can be controlled from thekeyboard:

Toggle Regular ExpressionsAlt +R
Toggle Case SensitivityAlt +C
Toggle Exact MatchAlt +W
Find NextEnter
Find PreviousShift + Enter
Find AllAlt +Enter

Incremental Search

The incremental search panel is bound to Ctrl + I. The only differencewith the regular search panel lies in the behavior of theEnter key: inincremental searches, it will select the next match in the file and dismissthe search panel for you. Choosing between this panel or the regular searchpanel is mainly a matter of preference.

Replacing Text

To open the replace planel, press Ctrl+ H. Some actions available throughthis panel can be controlled from the keyboard.

Replace AllCtrl + Alt + Enter

Tips

Other Ways of Searching in Files

Goto Anything provides the # operator to search in the active file. Thesearch term will be the text following the operator.

Other Search-Related Key Bindings

These key bindings work when the search panel is hidden.

Search Forward Using Most Recent PatternF3
Search Backwards Using Most Recent PatternShift + F3
Select All Matches Using Most Recent PatternAlt +F3

Multiline Search

You can type in multiline search patterns into search panels. To enter newlinecharacters, pressCtrl +Enter. Note that search panels are resizable.