VisualStudio2017 & 2019突出显示滚动条中出现的选定单词

当我标记一个单词(任何类型)时,我希望该单词的所有出现(在该特定文件中)都在右边的滚动条中高亮显示。

这是 VS2015和 VS2013的一个特性。我无法想象他们移除了它,我只是不知道如何打开它。在工具-> 选项(图片)中没有明显的可能性帮助我。 enter image description here

我正在使用 VisualStudio17专业版。 谢谢你。

42464 次浏览

This was a feature in VS15 and VS13.

Actually it was not.

It is a feature of the Productivity Power Tools extension. That extension is now just an installer for separate single feature extensions. I think you'll be wanting Match Margin.

For Visual Studio 2022 Match Margin is also available.

There's another extension which does exactly this, with options to customize colors and more. it called Word Highlight With Margin.

The extension created by Trung Kien Phan

Screenshots

VS2017/VS2019/2022 Version

Download link from Visual Studio market place - VS2017, VS2019, VS2022

Previous versions:

VS2015

VS2010, VS2012, VS2013

Right now, the only way I know (without installing new extensions) is to select (double click) the word and hit ctrl-f (find). Scroll map should highlight all occurences (mine are orange)

MultiWordHighlight can highlight different words with different color

https://github.com/jendelel/MultiWordHighlight

update

  1. How to install

    Install via Visual Studio Marketplace (https://marketplace.visualstudio.com/items?itemName=jendelel.MultiWordHighlight).

  2. How to use

    Right click on any word under the caret and select Toggle highlight of current word in the MultiWordHighlight menu.