notepad++ - 如何使用 NppExec 插件执行最左边的选项卡打开? (Npp 中的上下文)

标签 notepad++ tex nppexec

问题在标题中:我在 Npp 中打开了很多文件,并且只想通过 Alt+F6 编译最左边的文件(NppExec-Plugin),我正在用 ConTeXt 编译 tex 文件。

目前我的命令是:

cd $(CURRENT_DIRECTORY)
taskkill /im SumatraPDF.exe
context.exe "filename.tex" --synctex=1
C:...\sumatra.bat "$(CURRENT_DIRECTORY)\filename.pdf"

如何更改它们,这样不是文件名,而是一些环境变量,s.t.只执行最左边选项卡中的文件?

谢谢!

最佳答案

这是 NppExec 支持的所有环境变量的列表,如文档中所述:

 *   6) All Notepad++ environment variables are supported:
 *        $(FULL_CURRENT_PATH)  : E:\my Web\main\welcome.html 
 *        $(CURRENT_DIRECTORY)  : E:\my Web\main
 *        $(FILE_NAME)          : welcome.html 
 *        $(NAME_PART)          : welcome 
 *        $(EXT_PART)           : .html
 *        $(NPP_DIRECTORY)      : the full path of notepad++'s directory
 *        $(CURRENT_WORD)       : word(s) you selected in Notepad++
 *        $(CURRENT_LINE)       : current line number
 *        $(CURRENT_COLUMN)     : current column number
 *   7) Additional environment variables:
 *        $(#0)                 : C:\Program Files\Notepad++\notepad++.exe
 *        $(#N), N=1,2,3...     : full path of the Nth opened document
 *        $(LEFT_VIEW_FILE)     : current file path-name in primary (left) view
 *        $(RIGHT_VIEW_FILE)    : current file path-name in second (right) view
 *        $(PLUGINS_CONFIG_DIR) : full path of the plugins configuration directory
 *        $(CWD)                : current working directory of NppExec (use "cd" to change it)
 *        $(ARGC)               : number of arguments passed to the NPP_EXEC command
 *        $(ARGV)               : all arguments passed to the NPP_EXEC command after the script name
 *        $(ARGV[0])            : script name - first parameter of the NPP_EXEC command
 *        $(ARGV[N])            : Nth argument (N=1,2,3...)
 *        $(RARGV)              : all arguments in reverse order (except the script name)
 *        $(RARGV[N])           : Nth argument in reverse order (N=1,2,3...)
 *        $(INPUT)              : this value is set by the 'inputbox' command
 *        $(INPUT[N])           : Nth field of the $(INPUT) value (N=1,2,3...)
 *        $(OUTPUT)             : this value can be set by the child process, see npe_console v+
 *        $(OUTPUT1)            : first line in $(OUTPUT)
 *        $(OUTPUTL)            : last line in $(OUTPUT)
 *        $(EXITCODE)           : exit code of the last executed child process
 *        $(MSG_RESULT)         : result of 'npp_sendmsg[ex]' or 'sci_sendmsg'
 *        $(MSG_WPARAM)         : wParam (output) of 'npp_sendmsg[ex]' or 'sci_sendmsg'
 *        $(MSG_LPARAM)         : lParam (output) of 'npp_sendmsg[ex]' or 'sci_sendmsg'
 *        $(SYS.<var>)          : system's environment variable, e.g. $(SYS.PATH)

因此,似乎无法选择最左边 文件。不过,您可以做的是使用 $(NAME_PART) 变量更改命令中两次出现的 filename,并在执行前选择最左边的文件,因此 $(NAME_PART) 将设置为 filename

关于notepad++ - 如何使用 NppExec 插件执行最左边的选项卡打开? (Npp 中的上下文),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19636923/

相关文章:

正则表达式环绕引号

syntax-highlighting - 在 Notepad++ 中扩展语言定义(用于代码突出显示)

regex - Notepad++ 正则表达式搜索和替换异常

c++ - Notepad++、NppExec、CreateProcess() 失败,错误代码为 2,Windows 8.1

正则表达式 : Keep text between 2 keywords but only if another keyword exists inside them

matlab - 如何在Matlab中使标题仅解释标题字符串的一部分

flutter - flutter 的数学表达式和波兰语字符

matlab - "pdfLatex has stopped working"Matlab调用时提示

java - 如何从 Notepad++ 运行 JavaFX 应用程序? (仅作为 .jar 文件运行)