NPPEXEC NPE_CMDALIAS 保存自定义别名吗?

发布于 2024-10-08 22:27:20 字数 304 浏览 6 评论 0原文

我已经使用 cygwin mintty 一段时间了,它支持使用自定义别名,只需在我的用户属性的 bashRC 文件中定义它们即可。本质上,我可以输入“test”并让它执行一个可能类似于“C:\randomfolder\manySubfolders\someScript.pl”的脚本,因为它只是用脚本的长路径替换快捷方式别名。

notepad++ 插件 NPPExec 使用 npe_cmdalias alias = full 命令支持此行为。

这很好用,但是当 NPP 重新启动时,我的自定义别名会丢失。有没有办法让这些别名持续存在?

谢谢!

I've been using cygwin mintty for awhile now and it supports the use of custom alias's by simply defining them in the bashRC file of my user properties. Essentially I could type "test" and have it execute a script that may look something like "C:\randomfolder\manySubfolders\someScript.pl" as it simply replaces the shortcut alias with the long path to a script.

This behavior is supported in the notepad++ plugin NPPExec using npe_cmdalias alias = full command.

This works well, however my custom alias's are lost when NPP is restarted. Is there a way to make these alias's persist?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心凉 2024-10-15 22:27:20

NPPExec 有一种相当复杂的方法来做到这一点。以下是您需要执行的操作:

  1. 首先为命令创建一个文本文件。我将其命名为“NppStartScript.txt”并将其保存在“scripts”文件夹中。文件夹结构应如下所示:$(NPP_DIRECTORY)\scripts\NppStartScript.txt,其中 $(NPP_DIRECTORY) 代表您的 Notepad++ 应用程序文件夹。

  2. 找到“NppExec.ini”文件。它应该位于“$(NPP_DIRECTORY)\plugins\config”文件夹中。打开文件,在文件底部添加以下配置设置(用换行符与其余设置分开)并保存文件:

    <代码>[选项]

    ScriptNppStart=$(NPP_DIRECTORY)\scripts\NppStartScript.txt

  3. 创建“NppStartScript.txt”,键入命令并保存文件。在您的情况下,它将是: npe_cmdalias alias = Full command

  4. “完整命令”应该是指向文件的 npp_exec 指令,该文件将包含您要重复执行的命令。这是我的运行 python 命令的样子: npe_cmdalias rpy = npp_exec "$(NPP_DIRECTORY)\scripts\rpy.txt"

  5. “rpy.txt”包含调用 python 解释器的命令在当前 Notepad++ 选项卡中打开的文件。这是我写的: D:\Portable Apps\Python\python.exe "$(FULL_CURRENT_PATH)"

  6. 重新启动 Notepad++,打开 NPPExec 控制台并输入您的别名。它应该运行您指定的命令

希望这有帮助,如果您遇到任何错误,请告诉我。

NPPExec has a rather convulated way of doing this. Here's what you need to do:

  1. Start by creating a text file for the commands. I named mine 'NppStartScript.txt' and saved it in the 'scripts' folder. Here's what the folder structure should look like: $(NPP_DIRECTORY)\scripts\NppStartScript.txt where $(NPP_DIRECTORY) represents your Notepad++ application folder.

  2. Locate the 'NppExec.ini' file. It should be in the '$(NPP_DIRECTORY)\plugins\config' folder. Open the file, add the following configuration setting at the bottom of the file (separated from the rest of the settings with a line break) and save the file:

    [Options]

    ScriptNppStart=$(NPP_DIRECTORY)\scripts\NppStartScript.txt

  3. Create the 'NppStartScript.txt', type your command(s) and save the file. In your case it would be: npe_cmdalias alias = Full command

  4. "Full command" should be a npp_exec directive to a file which will contain the commands that you want to execute repeatedly. Here's what my run python command looks like: npe_cmdalias rpy = npp_exec "$(NPP_DIRECTORY)\scripts\rpy.txt"

  5. The "rpy.txt" contains the command to invoke the python interpreter on the file that is open in the current Notepad++ tab. Here's what I have written: D:\Portable Apps\Python\python.exe "$(FULL_CURRENT_PATH)"

  6. Restart Notepad++, open the NPPExec console and type your alias. It should run the command that you specified

Hope this helps, let me know if you encounter any errors.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文