Visual Studio 个人常用优化设置

一、关闭单击文件进行预览的功能
工具->选项->环境->选项卡和窗口->预览选项卡->取消"允许在预览选项卡中打开新文件"

二、在多行中显示选项卡
工具->选项->环境->选项卡和窗口->在多行中显示选项卡

三、直接到反编译的源码
工具->选项->文本编辑器->C#->高级->分析->勾选"支持导航到反编译源"
 
四、编译时始终停留在生成界面(不自动跳转错误列表)
工具->选项->项目和解决方案->常规->取消"若生成完成时有错误,则始终显示错误列表"
 
五、修改最近使用的项目和解决方案数量(及最近使用过的文件)
工具->选项->环境->常规->修改"要在窗口菜单中显示的项"
工具->选项->环境->常规->修改"要在最近使用的文件列表中显示的项"
 
六、隐藏Copilot菜单
工具->选项->环境->常规->勾选"隐藏Copilot菜单徽章(需要重启)"

七、解决方案资源管理器 搜索框右侧 下拉 勾选上:
1、在文件内容中搜索
2、在外部项中搜索

八、粘贴时添加缺少的 using 指令
工具->选项->文本编辑器->C#->高级->Using 指令->勾选"粘贴时添加缺少的 using 指令"
 
九、使用垂直滚动条的缩略图模式
工具->选项->文本编辑器->C#->滚动条->行为->勾选"使用垂直滚动条的缩略图模式"
滚动条->右键->滚动条选项->行为->勾选"使用垂直滚动条的缩略图模式"
 
十、清理最近文件、最近使用的项目、解决方案
1、彻底退出所有vs,注册表编辑器->选择HKEY_USERS-->文件-->加载配置单元,选择下面的文件,名字输入xxx:
C:\Users\xxx\AppData\Local\Microsoft\VisualStudio\16.0_xxxxxx\privateregistry.bin
2、展开HKEY_USERS\xxx\Software\Microsoft\VisualStudio\16.0_xxxxxx\MRUItems\,依次点开每个项目,直到找到打开文件历史,删除
3、编辑上面privateregistry.bin同目录的ApplicationPrivateSettings.xml,找到解决方案名称,删除整个{}内内容,删除该xml也可以。
rem VisualStudio2019
reg load "HKU\VisualStudio2019" "%LOCALAPPDATA%\Microsoft\VisualStudio\16.0_864bc21e\privateregistry.bin"
reg delete "HKU\VisualStudio2019\Software\Microsoft\VisualStudio\16.0_864bc21e\MRUItems" /f
reg delete "HKU\VisualStudio2019\Software\Microsoft\VisualStudio\16.0_864bc21e\Find" /v "Find" /f
reg delete "HKU\VisualStudio2019\Software\Microsoft\VisualStudio\16.0_864bc21e\Find" /v "Replace" /f
for /l %%i in (0,1,20) do (
    reg delete "HKU\VisualStudio2019\Software\Microsoft\VisualStudio\16.0_864bc21e\Find" /v "Find %%i" /f
    reg delete "HKU\VisualStudio2019\Software\Microsoft\VisualStudio\16.0_864bc21e\Find" /v "Replace %%i" /f
)
reg unload "HKU\VisualStudio2019"

rem VisualStudio2022
reg load "HKU\VisualStudio2022" "%LOCALAPPDATA%\Microsoft\VisualStudio\17.0_f4c07a62\privateregistry.bin"
reg delete "HKU\VisualStudio2022\Software\Microsoft\VisualStudio\17.0_f4c07a62\MRUItems" /f
for /l %%i in (0,1,20) do (
    reg delete "HKU\VisualStudio2022\Software\Microsoft\VisualStudio\17.0_f4c07a62\Find" /v "FindWhat %%i" /f
    reg delete "HKU\VisualStudio2022\Software\Microsoft\VisualStudio\17.0_f4c07a62\Find" /v "ReplaceWith %%i" /f
)
reg unload "HKU\VisualStudio2022"

rem SQLServerManagementStudio
reg delete "HKCU\SOFTWARE\Microsoft\Microsoft SQL Server\150\Tools\SQLServerProfiler\Client\Search" /f
reg delete "HKCU\SOFTWARE\Microsoft\SQL Server Management Studio\18.0_IsoShell\MRUItems" /f
reg delete "HKCU\SOFTWARE\Microsoft\SQL Server Management Studio\18.0_IsoShell\Find" /v "Find" /f
reg delete "HKCU\SOFTWARE\Microsoft\SQL Server Management Studio\18.0_IsoShell\Find" /v "Replace" /f
for /l %%i in (0,1,20) do (
    reg delete "HKCU\SOFTWARE\Microsoft\SQL Server Management Studio\18.0_IsoShell\Find" /v "Find %%i" /f
    reg delete "HKCU\SOFTWARE\Microsoft\SQL Server Management Studio\18.0_IsoShell\Find" /v "Replace %%i" /f
)
posted @ 2021-12-08 15:55  狼王爷  阅读(520)  评论(0编辑  收藏  举报