Skip to content

Commit 54d24d1

Browse files
committed
Add an option to autoclose the runner
1 parent 5b17916 commit 54d24d1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

plugin/vimux.vim

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ let g:VimuxRunnerType = get(g:, 'VimuxRunnerType', 'pane')
1515
let g:VimuxTmuxCommand = get(g:, 'VimuxTmuxCommand', 'tmux')
1616
let g:VimuxUseNearest = get(g:, 'VimuxUseNearest', v:true)
1717
let g:VimuxExpandCommand = get(g:, 'VimuxExpandCommand', v:false)
18+
let g:VimuxCloseOnExit = get(g:, 'VimuxCloseOnExit', v:false)
1819

1920
function! VimuxOption(name) abort
2021
return get(b:, a:name, get(g:, a:name))
@@ -39,6 +40,13 @@ command -bar VimuxClearTerminalScreen :call VimuxClearTerminalScreen()
3940
command -bar VimuxClearRunnerHistory :call VimuxClearRunnerHistory()
4041
command -bar VimuxTogglePane :call VimuxTogglePane()
4142

43+
if VimuxOption('VimuxCloseOnExit')
44+
augroup VimuxAutocloseCommands
45+
au!
46+
autocmd VimLeave * call VimuxCloseRunner()
47+
augroup END
48+
endif
49+
4250
function! VimuxRunCommandInDir(command, useFile)
4351
let l:file = ''
4452
if a:useFile ==# 1

0 commit comments

Comments
 (0)