Skip to content

Commit af98fa1

Browse files
committed
Add RunShow command
1 parent 34ede3e commit af98fa1

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

autoload/run.vim

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,13 @@ function! run#RunKillAll() abort
361361
endfor
362362
endfunction
363363

364+
function! run#RunShow() abort
365+
let cmd = "find " . g:rundir . " -type f | sort -r" .
366+
\ " | head -n 1"
367+
let lastfile = trim(system(cmd))
368+
exec 'split '.lastfile
369+
endfunction
370+
364371
function! run#RunListToggle() abort
365372
if run#is_qf_open()
366373
silent call run#closelist()

doc/vim-run.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ COMMANDS *vim-run-commands*
104104
:RunKillAll *:RunKillAll*
105105
Sends a SIGKILL signal to all running jobs.
106106

107+
:RunShow *:RunShow*
108+
Opens the output file of the last |Run| job in a split buffer.
109+
107110
:RunListToggle *:RunListToggle*
108111
Opens or closes the |RunList| - a |quickfix| menu that shows all jobs,
109112
their status, and their log files. The list is updated every time jobs

plugin/run.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ command -nargs=* -complete=file RunSendKeys :call run#RunSendKeys(<q-args>)
6262
command -nargs=? -complete=custom,run#list_running_jobs RunKill :call run#RunKill(<q-args>)
6363
command RunKillAll :call run#RunKillAll()
6464

65+
command RunShow :call run#RunShow()
6566
command RunListToggle :call run#RunListToggle()
6667
command RunClear :call run#RunClear(['DONE', 'FAILED', 'KILLED'])
6768
command RunClearDone :call run#RunClear(['DONE'])

0 commit comments

Comments
 (0)