Notepad ++:为现有命令添加新的快捷方式 [英] Notepad++: Adding a new shortcut for an existing command

查看:170
本文介绍了Notepad ++:为现有命令添加新的快捷方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使"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.

因此,策略是:

  1. 安装npp_exec,您可以在插件管理器中找到它,然后重新启动记事本++
  2. 使用以下内容创建一个npp_exec脚本:NPP_SENDMSG WM_COMMAND IDM_SEARCH_FIND,将其保存,例如作为 OpenFindDlg ,您可以通过Plugins-> NppExec-> Execute ...创建这样的脚本,输入脚本并单击Save ...
  3. 转到插件-> NppExec->高级选项...
  1. install npp_exec, you find it in the plugin manager and restart notepad++
  2. 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...
  3. Go to Plugins -> NppExec -> Advanced Options ...
  1. 在关联脚本下选择 OpenFindDlg
  2. 在项目名称下给它一个菜单项,例如 OpenFindDlg
  3. 单击添加/修改",您想在左侧列表区域中获得一个新条目,请参见屏幕截图:
  1. Select OpenFindDlg under Associated script
  2. give it a menu entry under Item name: e.g, OpenFindDlg
  3. Click Add/Modify, you want to get a new entry in the list area on the left, see screenshot:

  • 重新启动Notepad ++,因此请激活此设置.
  • 添加其他快捷方式:转到设置"->快捷方式映射器":在插件"选项卡下的某个位置,您会找到保存脚本的名称,在此处 OpenFindDlg .现在,您可以分配快捷方式CTRL-G.
    请注意,您还删除了主菜单"选项卡下某处goto line命令的现有键绑定CTRL-G.
  • restart Notepad++, so get this setting activated.
  • add the additional shortcut: goto Settings -> Shortcut mapper: somewhere under the Plugins tab, you will find the Name that you have saved the script, here OpenFindDlg. Now you can assign your shortcut 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屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆