quickrun の最終的なコマンドを出力する

quickrun が構築した最終的なコマンドを確認したい事がたまにあるので、サクッと quickrun-hook で実装。

[ソース]

let s:hook = {
\   "name" : "output_command",
\   "kind" : "hook",
\   "config" : {
\       "enable" : 1,
\       "log" : 0
\   }
\}

function! s:hook.on_ready(session, context)
    for command in a:session.commands
        execute self.config.log ? "echom command" : "echo command"
    endfor
endfunction

call quickrun#module#register(s:hook, 1)
unlet s:hook

[コマンド]

" :messages にも log を残したい場合は -hook/output_command/log 1
QuickRun -hook/output_command/enable 1 -hook/output_command/log 1


常に出力すると C++ の場合とか大変な事になるのでデフォルトでは enable 0 で。