WebStorm keyboard shortcutsWebStorm键盘快捷键
WebStorm has keyboard shortcuts for most of its commands related to editing, navigation, refactoring, debugging, and other tasks. WebStorm的大多数与编辑、导航、重构、调试和其他任务相关的命令都有键盘快捷键。Memorizing these hotkeys can help you stay more productive by keeping your hands on the keyboard.记住这些热键可以让你的手保持在键盘上,从而提高工作效率。
Predefined keymaps do not cover every possible platform, version, and configuration. 预定义的密钥映射并不涵盖所有可能的平台、版本和配置。Some shortcuts can conflict with global system actions and shortcuts for third-party software. 某些快捷方式可能与全局系统操作和第三方软件的快捷方式冲突。WebStorm detects the conflicts and notifies you with a popup message. WebStorm检测到冲突并用弹出消息通知您。To fix these conflicts, you can reassign or disable the conflicting shortcut as described in Conflicts with global OS shortcuts.要修复这些冲突,可以按照与全局操作系统快捷方式的冲突中的说明重新分配或禁用冲突的快捷方式。
The following table lists some of the most useful shortcuts to learn:下表列出了一些最有用的学习快捷方式:
| |
Ctrl+Shift+A |
|
| |
Alt+Enter |
|
F2 Shift+F2 |
|
Ctrl+E |
|
Ctrl+W Ctrl+Shift+W |
|
Ctrl+/ Ctrl+Shift+/ |
|
Alt+F7 |
|
If you are using one of the predefined keymaps for your OS, you can print the default keymap reference card and keep it on your desk to consult it if necessary. 如果您正在为您的操作系统使用一个预定义的键图,您可以打印默认的键图参考卡,并将其放在桌上,以便在必要时查阅。This cheat sheet is also available under 本备忘单也可在“帮助”|“键舯映射参考”下获得。 .
Choose the right keymap选择正确的键映射
To view the keymap configuration, open the Settings/Preferences dialog Ctrl+Alt+S and select Keymap.要查看键映射配置,请打开“设置/首选项”对话框Ctrl+Alt+S并选择键映射。
-
Use a predefined keymap使用预定义的键映射WebStorm automatically suggests a predefined keymap based on your environment.WebStorm会根据您的环境自动建议预定义的密钥映射。Make sure that it matches the OS you are using or select the one that matches shortcuts from another IDE or editor you are used to (for example, Eclipse or NetBeans).确保它与您正在使用的操作系统相匹配,或者选择与您使用的另一个IDE或编辑器(例如Eclipse或NetBeans)的快捷方式相匹配的操作系统。When consulting this page and other pages in WebStorm documentation, you can see keyboard shortcuts for the keymap that you use in the IDE — choose it using the selector at the top of a page.查阅此页面和WebStorm文档中的其他页面时,可以看到IDE中使用的键映射的键盘快捷键-使用页面顶部的选择器选择它。 -
Tune your keymap调整你的键映射You can modify a copy of any predefined keymap to assign your own shortcuts for commands that you use frequently.您可以修改任何预定义键映射的副本,以便为经常使用的命令指定自己的快捷方式。 -
Import custom keymap导入自定义键映射If you have a customized keymap that you are used to, you can transfer it to your installation.如果您有一个习惯使用的自定义密钥映射,则可以将其转移到安装中。
Besides the default set of keymaps, you can add more as plugins (such as, keymaps for GNOME and KDE): open the Settings/Preferences dialog Ctrl+Alt+S, select Plugins and search for keymap in the Marketplace.除了默认的键映射集,您还可以添加更多的插件(例如GNOME和KDE的键映射):打开“设置/首选项”对话框Ctrl+Alt+S,选择“插件”并在市场中搜索“keymap”。
Print your keymap打印您的键映射
If you prefer a hard copy, download the default WebStorm keymap reference and print it out as a card:如果您喜欢硬拷贝,请下载默认的WebStorm keymap参考并将其打印为卡片:
Learn shortcuts as you work在工作中学习快捷键
WebStorm provides several possibilities to learn shortcuts:WebStorm提供了几种学习快捷方式的可能性:
-
Find Action is the most important command that enables you to search for commands and settings across all menus and tools.查找操作是最重要的命令,它使您能够在所有菜单和工具中搜索命令和设置。Press Ctrl+Shift+A and start typing to get a list of suggested actions.按Ctrl+Shift+A并开始键入以获取建议操作的列表。Then select the necessary action and press Enter to execute it.然后选择必要的操作并按Enter键执行。 -
Key Promoter X is a plugin that shows a popup notification with the corresponding keyboard shortcut whenever a command is executed using the mouse.Key Promotor X是一个插件,每当使用鼠标执行命令时,它都会显示带有相应键盘快捷键的弹出通知。It also suggests creating a shortcut for commands that are executed frequently.它还建议为频繁执行的命令创建快捷方式。 -
If you are using one of the predefined keymaps for your OS, you can print the default keymap reference card and keep it on your desk to consult it if necessary.如果您正在为您的操作系统使用一个预定义的键图,您可以打印默认的键盘映射参考卡,并将其放在桌上,以便在必要时查阅。This cheat sheet is also available under本备忘单也可在“帮助”|“关盘映射参考”下获得。 . -
To print a non-default or customized keymap, use the Keymap exporter plugin.要打印非默认或自定义的keymap,请使用键盘映射导出器插件。
Use advanced features使用高级功能
You can further improve your productivity with the following useful features:您可以通过以下有用的功能进一步提高生产率:
-
Quick Lists快速列表If there is a group of actions that you often use, create a quick list to access them using a custom shortcut.如果您经常使用一组操作,请创建一个快速列表,使用自定义快捷方式访问这些操作。For example, you can try using the following predefined quick lists:例如,您可以尝试使用以下预定义的快速列表:-
Refactor this重构这个 Ctrl+Alt+Shift+T -
VCS Operations版本控制操作 Alt+`
-
-
WebStorm provides a lot of typing assistance features, such as automatically adding paired tags and quotes, and detecting CamelHump words.WebStorm提供了许多打字辅助功能,例如自动添加成对的标记和引号,以及检测驼峰词。 -
Speed search
When the focus is on a tool window with a tree, list, or table, start typing to see matching items.当焦点位于具有树、列表或表的工具窗口上时,开始键入以查看匹配项。 -
Press twice按两下Many actions in WebStorm provide more results when you execute them multiple times.WebStorm中的许多操作在多次执行时提供更多结果。For example, when you invoke basic code completion with Ctrl+Space on a part of a field, parameter, or variable declaration, it suggests names depending on the item type within the current scope.例如,当您在字段、参数或变量声明的一部分上使用Ctrl+Space调用基本代码补全时,它会根据当前范围内的项类型建议名称。If you invoke it again, it will include classes available through module dependencies.如果您再次调用它,它将包括通过模块依赖关系可用的类。When invoked for the third time in a row, the list of suggestions will include the whole project.当连续第三次调用时,建议列表将包括整个项目。 -
Resize tool windows调整工具窗口的大小You can adjust the size of tool windows without a mouse:您可以在不使用鼠标的情况下调整工具窗口的大小:-
To resize a vertical tool window, use Ctrl+Shift+Left and Ctrl+Shift+Right要调整垂直工具窗口的大小,请使用Ctrl+Shift+Left和Ctrl+Shift+Right -
To resize a horizontal tool window, use Ctrl+Shift+Up and Ctrl+Shift+Down要调整水平工具窗口的大小,请使用Ctrl+Shift+Up和Ctrl+Shift+Down
-