VS代码生成工具ReSharper配置快捷键

本文详细介绍了VS代码生成工具ReSharper中的快捷键配置方法,包括如何配置单个键盘快捷键、在键盘快捷方式间切换以及使用ReSharper的完整快捷键列表。涵盖了从代码分析、编码援助、导航和搜索到重构、单元测试和工具窗口等多个方面的快捷键,旨在提高开发者的工作效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

VS代码生成工具ReSharper提供了丰富的快捷键,可以极大地提高你的开发效率。安装ReSharper后首次启动Visual Studio时,会出现一个名为ReSharper Keyboard Scheme的对话框,如下图所示:

VS代码生成工具ReSharper使用手册:配置快捷键

选择对话框提供的三个选项之一后的任何时候,您可以配置单独的键盘快捷键。

配置单个键盘快捷键

1、在主菜单上,选择Tools | Options

2、在导航视图中选择Environment | Keyboard

3、在命令列表中,选择启动ReSharper的命令名称。浏览列表以查看或者编辑ReSharper的特定操作的键盘快捷方式。

在键盘快捷方式间切换或者恢复到当前选定方案的默认状态

1、在主菜单上,选择ReSharper | Options

2、选择Environment | Keyboard and Menus

3、在Keyboard and Menus选项卡上,选择 Visual Studio, ReSharper 2.x 或 IntelliJ IDEA或 None,点击Apply Scheme。如果你选择None,你可以在Visual Studio的本地选项菜单中定义任意一组自定义快捷键(Tools | Options | Environment | Keyboard) 。

完整的快捷键列表

代码分析(Code analysis)

CommandShortcut
(Visual Studio)
Shortcut
(IntelliJ IDEA/ReSharper 2.x)
Toggle code analysis in the current fileCtrl+Shift+Alt+8Ctrl+Shift+Alt+8
Go to next code issue (error, warning or suggestion)Alt+PgDnF12
Go to previous code issue (error, warning or suggestion)Alt+PgUpShift+F12
Go to next errorShift+Alt+PgDnAlt+F12
Go to next error in solutionShift+Alt+PgDnAlt+F12
Go to previous errorShift+Alt+PgUpShift+Alt+F12
Go to previous error in solutionShift+Alt+PgUpShift+Alt+F12
Inspect thisCtrl+Shift+Alt+ACtrl+Shift+Alt+A
View type hierarchyCtrl+E,HCtrl+Alt+H
Inspection Results windowCtrl+Alt+VCtrl+Alt+V

编码援助(Coding assistance)

CommandShortcut
(Visual Studio)
Shortcut
(IntelliJ IDEA/ReSharper 2.x)
Show action listCtrl+R,WCtrl+R,W
Paste multiple Ctrl+Shift+V 
Code cleanupCtrl+E,CCtrl+Alt+F 
Silent code cleanupCtrl+E,FCtrl+Shift+Alt+F
Symbol code completionCtrl+SpaceCtrl+Space
Smart code completionCtrl+Alt+SpaceCtrl+Shift+Space
Import symbol completionShift+Alt+SpaceCtrl+Alt+Space
Complete statementCtrl+Shift+EnterCtrl+Shift+Enter
Parameter informationCtrl+Shift+SpaceCtrl+P
Quick documentationCtrl+Shift+F1Ctrl+Q
Insert live templateCtrl+E,LCtrl+J
Surround with templateCtrl+E,UCtrl+Alt+J
Create file from templateCtrl+Alt+InsertCtrl+Alt+Insert
Generate codeAlt+InsertAlt+Insert
Move code upCtrl+Shift+Alt+UpCtrl+Shift+Alt+Up
Move code downCtrl+Shift+Alt+DownCtrl+Shift+Alt+Down
Move code leftCtrl+Shift+Alt+LeftCtrl+Shift+Alt+Left
Move code rightCtrl+Shift+Alt+RightCtrl+Shift+Alt+Right
Extend selectionCtrl+Alt+RightCtrl+W
Shrink selectionCtrl+Alt+LeftCtrl+Shift+W
Select containing declarationCtrl+Shift+[Ctrl+Shift+[
Duplicate a line or selectionCtrl+DCtrl+D
Comment with line commentCtrl+Alt+/Ctrl+/
Comment with block commentCtrl+Shift+/Ctrl+Shift+/

导航和搜索(Navigation and search

CommandShortcut
(Visual Studio)
Shortcut
(IntelliJ IDEA/ReSharper 2.x)
Go to typeCtrl+TCtrl+N
Go To FileCtrl+Shift+TCtrl+Shift+N
Go to file memberAlt+\Ctrl+F12
Go to symbolShift+Alt+TCtrl+Shift+Alt+N
Navigate ToAlt+`Ctrl+Shift+G
Go to type of symbolCtrl+Shift+F11Ctrl+Shift+T
Go to declarationF12Ctrl+B
Go to implementationCtrl+F12Ctrl+Shift+Alt+B
Go to base symbolsAlt+HomeCtrl+U
Go to derived symbolsAlt+EndCtrl+Alt+B
Go to usageShift+Alt+F12Ctrl+Alt+F7
Go to containing declarationCtrl+[Ctrl+[
Go to next member/tagAlt+DownAlt+Down
Go to previous member/tagAlt+UpAlt+Up
Find usagesShift+F12Alt+F7
Find usages (advanced)Ctrl+Shift+Alt+F12Shift+Alt+F7
Highlight usages in fileShift+Alt+F11Ctrl+Shift+F7
Go to previous usageCtrl+Alt+PgUpCtrl+Alt+Up
Go to next usageCtrl+Alt+PgDnCtrl+Alt+Down
Remove highlighting of usagesEscEsc
View recent filesCtrl+,Ctrl+E
View recent editsCtrl+Shift+,Ctrl+Shift+Alt+Backspace
Go to previous editCtrl+Shift+BackspaceCtrl+Shift+Backspace
Go to related filesCtrl+Alt+F7Ctrl+Shift+Alt+G
View bookmarksCtrl+`Ctrl+`
Go to a numbered bookmarkCtrl+[numeric key]Ctrl+[numeric key]
Set/remove a numbered bookmarkCtrl+Shift+[numeric key]Ctrl+Shift+[numeric key]
Find Results windowCtrl+Alt+F12Ctrl+Alt+U
File structureCtrl+Alt+FCtrl+F11
To-do itemsCtrl+Alt+D 
Stack Trace ExplorerCtrl+E,TCtrl+Shift+E
Locate in Solution ExplorerShift+Alt+LShift+Alt+L
Analyze referencesShift+Alt+YShift+Alt+Y

重构(Refactorings)

CommandShortcut
(Visual Studio)
Shortcut
(IntelliJ IDEA/ReSharper 2.x)
Refactor thisCtrl+Shift+RCtrl+Shift+R
RenameCtrl+R,RF2 or Shift+F6
MoveCtrl+R,OF6
Safe deleteCtrl+R,D or Alt+DelAlt+Del
Extract methodCtrl+R,MCtrl+Alt+M
Introduce variableCtrl+R,VCtrl+Alt+V
Introduce fieldCtrl+R,FCtrl+Alt+D
Introduce parameterCtrl+R,PCtrl+Alt+P
Inline variable/method/fieldCtrl+R,ICtrl+Alt+N
Encapsulate fieldCtrl+R,ECtrl+R,E
Change signatureCtrl+R,SCtrl+F6

单元测试(Unit testing)

CommandShortcut
(Visual Studio)
Shortcut
(IntelliJ IDEA/ReSharper 2.x)
Run unit testsCtrl+U,RCtrl+T,R
Debug unit testsCtrl+U,DCtrl+T,D
Run all tests in solutionCtrl+U,LCtrl+T,L
Run current test sessionCtrl+U,YCtrl+T,Y
Repeat previous test runCtrl+U,YCtrl+T,Y
Append to test sessionCtrl+U,ACtrl+T,A
Create new test sessionCtrl+U,NCtrl+T,N
Unit Test ExplorerCtrl+Alt+UCtrl+Alt+T
Unit Test SessionsCtrl+Alt+TCtrl+Alt+R

工具窗口(Tool windows)

CommandShortcut
(Visual Studio)
Shortcut
(IntelliJ IDEA/ReSharper 2.x)
File structureCtrl+Alt+FCtrl+F11
Find Results windowCtrl+Alt+F12Ctrl+Alt+U
Hierarchies windowCtrl+Alt+H 
Inspection Results windowCtrl+Alt+VCtrl+Alt+V
Stack Trace ExplorerCtrl+E,TCtrl+Shift+E
Templates Explorer windowAlt+R,PAlt+R,P
To-do itemsCtrl+Alt+D 
Unit Test ExplorerCtrl+Alt+UCtrl+Alt+T
Unit Test SessionsCtrl+Alt+TCtrl+Alt+R
Close recent toolCtrl+Shift+F4Ctrl+Shift+F4
Activate recent toolCtrl+Alt+BackspaceCtrl+Alt+Backspace

 

<think>好的,用户想查找Visual Studio 2017的快捷键列表或设置方法。首先,我需要回顾一下系统提供的引用资料,看看有哪些相关信息。 根据引用1,提到了常用快捷键,比如代码注释和测试相关的快捷键,比如Ctrl + /用于注释,Ctrl + Shift + /用于取消注释。引用3详细说明了如何设置批量注释和取消注释的步骤,这可能对用户有帮助。引用2和引用3都提到了自定义快捷键的方法,用户可能对如何自定义感兴趣。引用4列出了一些测试相关的快捷键,比如Ctrl + R组合键执行测试。 用户的问题分为两部分:快捷键列表和设置方法。我需要将这两个部分分开回答,结构要清晰。首先列出常用的快捷键,包括代码编辑、导航、调试和测试相关的,然后详细说明如何设置和自定义快捷键,特别是用户提到的注释和取消注释的配置步骤。 需要注意的是,用户提供的引用中有一些是重复的,比如引用2和引用3都涉及注释快捷键设置,需要整合这些信息。同时,用户可能希望了解如何分配其他功能的快捷键,比如重构或代码格式化,但引用中没有提到,可能需要根据经验补充常见操作,但必须确保准确性。 另外,用户可能在开发过程中常用注释和测试功能,所以需要重点强调这些部分。在设置方法中,分步骤说明,并引用对应的引用来源,例如引用3的步骤。同时提醒用户注意快捷键冲突的问题,这在自定义时很重要。 最后,生成相关问题,可能涉及性能优化、自定义其他快捷键或与其他IDE的比较,但根据引用内容,问题应围绕已有的信息,比如设置方法、常用快捷键分类或冲突解决。</think>### Visual Studio 2017 快捷键设置与常用列表 #### 一、常用快捷键分类整理 1. **代码编辑相关** - `Ctrl + /`:批量注释选中代码 [^3] - `Ctrl + Shift + /`:批量取消注释选中代码 [^3] - `Ctrl + K + C`:注释当前行(默认快捷键) - `Ctrl + K + U`:取消注释当前行(默认快捷键) - `Ctrl + D`:复制当前行 - `Ctrl + Shift + L`:删除当前行 2. **导航与调试** - `F5`:启动调试 - `F9`:设置/取消断点 - `F10`:逐过程调试 - `F11`:逐语句调试 - `Ctrl + Tab`:切换编辑器标签页 3. **测试相关** - `Ctrl + R, A`:执行所有测试 [^4] - `Ctrl + R, T`:执行当前测试方法 [^4] - `Ctrl + R, D`:重新执行最后一次测试 [^4] #### 二、自定义快捷键方法 1. **设置注释快捷键** - **步骤**: 1. 打开菜单栏 `工具 > 选项 > 环境 > 键盘` 2. 在 **显示命令包含** 输入框中输入“注释” 3. 选择 `编辑.注释选定内容`,输入自定义快捷键(如 `Ctrl + /`),点击 **分配** [^3] 4. 同理设置 `编辑.取消注释选定内容`(如 `Ctrl + Shift + /`)[^3] 2. **解决快捷键冲突** - 若快捷键被占用,需在 **键盘设置** 中移除原有绑定(参考引用[2]的步骤5)[^2] 3. **恢复默认设置** - 在 **键盘设置** 页面点击 **重置** 按钮即可恢复默认配置。 #### 三、注意事项 - 不同编程语言(如C#、Python)可能有特定快捷键差异 - 安装扩展插件(如ReSharper)可能覆盖默认快捷键
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值