18

Visual Studio 中的增量搜索 ( Ctrl + I) 和快速查找 ( ) 有什么区别?Ctrl + F

4

3 回答 3

9

as I said in the comment of mine , that's not the only reason and microsoft would not implement something like this for just being easier to use !

by the way you don't need F3 to navigate between the results in the normal find method . you can do that with hitting enter and hell yea , its easier than Ctrl+I.

You can press Ctrl-I and start to type and all occurrences of what you type get highlight throughout the document, and also added to the find buffer, so F3 then works on the typed text as-well as the normal find method.

Incremental search allows developers to search in document without blocking UI and allow to search as they type.

The very good reason to use Ctrl+I is it find the result as you type the term in the box and you don't need to hit enter or F3 to go to the first result .

How To :

To enable incremental search, just type “Ctrl + i” within the editor. This will subtly change your cursor, and cause your status bar at the bottom left of the IDE to change to “Incremental search: (search term)” – you can then type the search term you are searching for and the editor will search for it from the current source location you are on (no dialog required).

enter image description here

于 2015-03-19T06:43:24.283 回答
3

增量搜索允许您继续点击Ctrl+I,直到您点击文档的末尾。快速查找找到第一个命中,突出显示所有其他命中,但您需要一些额外的键才能进入下一个命中(F3使用标准键绑定)。

于 2015-03-16T14:26:47.210 回答
3

请注意,Visual Studio 的版本会影响 UI 差异。似乎在旧版本(例如 2010)中,查找对话框非常突兀,并且妨碍了事情,因此相比之下增量搜索更加精简。相反,在 Visual Studio 2015 上运行时,我发现查找对话框(至少是由 CTRL-F 启动的那个)非常不显眼,因为它嵌入在代码编辑器的左上角。按下 CTRL-I 实际上会启动一个类似的对话框,但选项更少。此外,我还发现,使用这个版本的 VS,编辑器会像增量搜索一样跳转到第一个匹配项,因此在精简/不显眼方面几乎没有任何区别。

假设一个人使用的是 Visual Studio 版本,其中 Find Dialog 嵌入角落,我认为使用增量搜索而不是标准查找的唯一原因是您可以使用 CTRL-SHIFT-I 进行反向搜索(替代将是 CRTL-F 转到下一个事件,然后 SHIFT-F3 后退)。

长话短说:看起来标准查找已经进行了现代化改造,使其更接近增量搜索。如果使用 VS2015(不确定 2017 年),除了快捷方式的差异之外,差异似乎可以忽略不计,因此实际上是一个偏好问题。就个人而言,在 VS2015 中,我发现增量搜索与标准查找相比几乎没有改进,所以我会坚持使用后者(除非我错过了一些东西,在这种情况下我会很高兴听到它!)

于 2018-10-02T15:27:49.310 回答