Notepad ++:为现有命令添加新的快捷方式 [英] Notepad++: Adding a new shortcut for an existing command
问题描述
我想使"Ctrl + G"打开查找对话框,就像Ctrl + F一样(所以两个快捷方式都打开相同的查找对话框").
I want to make "Ctrl+G" to open the find dialogue, just as Ctrl+F" (so both shortcuts open the same "find dialogue").
我知道我可以通过宏>修改快捷方式"修改命令的现有快捷方式,但是它仅允许更改快捷方式,而不能更改命令的名称"(阴影).
I know I can modify the existing shortcuts of commands through "macro > modify shortcut", but it allows changing the shortcut only, not the "Name" of the command (shaded).
推荐答案
这里是如何向查找对话框添加第二个键绑定的方法. Notepad ++没有开箱即用的功能.我们只能分配一个键绑定.
我们需要一种添加第二个查找对话框的方法.我能想到的一种方法是非常有用的npp_exec插件.它提供了创建小型自动化脚本的功能,我们可以将这些脚本添加到菜单中.它还提供了一种(很少隐藏的)方式来为这些脚本分配快捷方式.
Here is how you can add a second keybinding to the find dialog. Notepad++ does not offers this out of the box. We can only assign one keybinding.
We need a way to add a second find dialog. One way I can think of is by the very useful npp_exec plugin. It offers to create small automation-scripts and we can add these scripts to the menu. It also offers a (little hidden) way for assigning shortcuts for these scripts.
因此,策略是:
- 安装npp_exec,您可以在插件管理器中找到它,然后重新启动记事本++
- 使用以下内容创建一个npp_exec脚本:
NPP_SENDMSG WM_COMMAND IDM_SEARCH_FIND
,将其保存,例如作为 OpenFindDlg ,您可以通过Plugins-> NppExec-> Execute ...创建这样的脚本,输入脚本并单击Save ... - 转到插件-> NppExec->高级选项...
- install npp_exec, you find it in the plugin manager and restart notepad++
- create a npp_exec script with this content:
NPP_SENDMSG WM_COMMAND IDM_SEARCH_FIND
, save it, e.g. as OpenFindDlg, you create such a script by Plugins -> NppExec -> Execute..., enter the script and click Save... - Go to Plugins -> NppExec -> Advanced Options ...
- 在关联脚本下选择 OpenFindDlg
- 在项目名称下给它一个菜单项,例如 OpenFindDlg
- 单击添加/修改",您想在左侧列表区域中获得一个新条目,请参见屏幕截图:
- Select OpenFindDlg under Associated script
- give it a menu entry under Item name: e.g, OpenFindDlg
- Click Add/Modify, you want to get a new entry in the list area on the left, see screenshot:
CTRL-G
.请注意,您还删除了主菜单"选项卡下某处goto line命令的现有键绑定
CTRL-G
.
CTRL-G
.Take care that you have also deleted the existing keybinding
CTRL-G
for the goto line command somewhere under the Main menu Tab.这篇关于Notepad ++:为现有命令添加新的快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!