We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bottom:内置终端,不可以复用内部终端 每次运行都打开一个终端 vimrc配置: noremap :AsyncTask file-run noremap :AsyncTask file-build let g:asyncrun_open = 6 let g:asynctasks_term_pos = 'bottom' let g:asynctasks_term_rows = 5
tasks.ini配置: [file-build] command=gcc "$(VIM_FILEPATH)" -o "$(VIM_FILEDIR)/$(VIM_FILENOEXT)" command:go=go build -o "$(VIM_PATHNOEXT)" "$(VIM_FILEPATH)" cwd=$(VIM_FILEDIR) output=quickfix errorformat=%f:%l:%m save=2
[file-run] command="$(VIM_FILEPATH)" command:c,cpp="$(VIM_PATHNOEXT)" command:go=go run "$(VIM_FILEPATH)" command:python=python "$(VIM_FILENAME)" output=terminal cmd=$(VIM_FILEDIR) save=2
The text was updated successfully, but these errors were encountered:
我也遇到了这个问题,设置let g:asynctasks_term_reuse = 1后解决。
let g:asynctasks_term_reuse = 1
Sorry, something went wrong.
默认的内置终端必须在任务结束的情况下才能复用,如果老任务没有结束,则会创建新的窗口。
可以考虑使用 vim-terminal-help 提供的交互式终端,每次运行的时候只是发送命令过去,不会创建新的终端窗口,搭配 asyncrun.extra,可以让 asyncrun/asynctasks 具备调用 terminal-help 的能力,然后设置:
let g:asynctasks_term_pos = 'termhelp'
你基本就得到了一个和 vscode 一样的可复用终端了:
我好像理解错了,asynctasks_term_pos在设置为top、bottom、left或right时(且设置output=terminal)终端窗口复用是默认选项嘛?如果不是的话此章节的说明可能会有些歧义(从章节开始至如下引用间未提及需要声明asynctasks_term_reuse=1才会开启终端复用)。
top
bottom
left
right
output=terminal
asynctasks_term_reuse=1
终端窗口会复用,如果上一个任务结束了,再次运行时不会新建终端窗口,会先尝试复用老的已结束的终端窗口,找不到才会新建。
BTW: vim-terminal-help很方便,我改为使用vim-terminal-help了。
No branches or pull requests
bottom:内置终端,不可以复用内部终端
每次运行都打开一个终端
vimrc配置:
noremap :AsyncTask file-run
noremap :AsyncTask file-build
let g:asyncrun_open = 6
let g:asynctasks_term_pos = 'bottom'
let g:asynctasks_term_rows = 5
tasks.ini配置:
[file-build]
command=gcc "$(VIM_FILEPATH)" -o "$(VIM_FILEDIR)/$(VIM_FILENOEXT)"
command:go=go build -o "$(VIM_PATHNOEXT)" "$(VIM_FILEPATH)"
cwd=$(VIM_FILEDIR)
output=quickfix
errorformat=%f:%l:%m
save=2
[file-run]
command="$(VIM_FILEPATH)"
command:c,cpp="$(VIM_PATHNOEXT)"
command:go=go run "$(VIM_FILEPATH)"
command:python=python "$(VIM_FILENAME)"
output=terminal
cmd=$(VIM_FILEDIR)
save=2
The text was updated successfully, but these errors were encountered: