Notepad++ 如何在打开最左边的选项卡时使用NppExec插件执行?(核电站中的上下文)

Notepad++ 如何在打开最左边的选项卡时使用NppExec插件执行?(核电站中的上下文),notepad++,tex,nppexec,Notepad++,Tex,Nppexec,问题在标题中:我在Npp中有许多打开的文件,只想通过Alt+F6(NppExec插件)编译最左边的一个,我正在使用上下文编译tex文件 目前我的命令是: cd $(CURRENT_DIRECTORY) taskkill /im SumatraPDF.exe context.exe "filename.tex" --synctex=1 C:...\sumatra.bat "$(CURRENT_DIRECTORY)\filename.pdf" 如何更改它们,这样就不会有文件名,而只会有一些环境变量

问题在标题中:我在Npp中有许多打开的文件,只想通过Alt+F6(NppExec插件)编译最左边的一个,我正在使用上下文编译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)
*6)支持所有Notepad++环境变量:
*$(完整当前路径):E:\my Web\main\welcome.html
*$(当前目录):E:\my Web\main
*$(文件名):welcome.html
*$(姓名/部分):欢迎
*$(外部部分):.html
*$(NPP_目录):记事本++目录的完整路径
*$(当前单词):您在记事本中选择的单词++
*$(当前行):当前行号
*$(当前列):当前列编号
*7)其他环境变量:
*$(#0):C:\Program Files\Notepad++\Notepad++.exe
*$(N),N=1,2,3…:第n个打开文档的完整路径
*$(左视图\文件):主(左)视图中的当前文件路径名
*$(右视图\文件):第二(右)视图中的当前文件路径名
*$(插件配置目录):插件配置目录的完整路径
*$(CWD):NppExec的当前工作目录(使用“cd”更改)
*$(ARGC):传递给NPP_EXEC命令的参数数
*$(ARGV):在脚本名称之后传递给NPP_EXEC命令的所有参数
*$(ARGV[0]):脚本名称-NPP_EXEC命令的第一个参数
*$(ARGV[N]):第N个参数(N=1,2,3…)
*$(RARGV):按相反顺序排列的所有参数(脚本名称除外)
*$(RARGV[N]):按相反顺序排列的第N个参数(N=1,2,3…)
*$(输入):此值由“inputbox”命令设置
*$(输入[N]):$(输入)值的第N个字段(N=1,2,3…)
*$(输出):此值可由子进程设置,请参阅npe_控制台v+
*$(输出1):$(输出)中的第一行
*$(OUTPUTL):$(输出)中的最后一行
*$(EXITCODE):上次执行的子进程的退出代码
*$(MSG_RESULT):npp_sendmsg[ex]或sci_sendmsg的结果
*$(MSG_WPARAM)“‘核电站’sendmsg[ex]”或“sci_sendmsg”的WPARAM(输出)
*$(MSG_LPARAM):“npp_sendmsg[ex]”或“sci_sendmsg”的LPARAM(输出)
*$(SYS.):系统的环境变量,例如$(SYS.PATH)

因此,似乎无法选择最左边的文件。不过,您可以使用
$(NAME\u PART)
变量更改命令中出现的两个
filename
,并在执行之前选择最左边的文件,这样
$(NAME\u PART)
将设置为
filename

谢谢。您的解决方案的补充:是否有一种方法可以在执行之前自动选择最左边的文件(通过任何宏或某种方式),最好将其也包含在ALT+F6中。您不能使用宏来执行此操作。我不知道还有别的办法。您是否考虑过将此
filename.tex
(我假设它是您最左边的文件)移动到另一个视图中以便于访问?您可以通过右键单击选项卡名称并选择
移动到其他视图
来完成此操作。或者您可以使用CTRL+Tab或CTRL+PgUp/PgDn快速切换选项卡。谢谢,这并不是那么容易,我多么希望它,但这是正确的一步:)哇。。。你能看看我的问题吗?