quickrun の設定晒し

やりたい事はだいたいできたので晒します。
だいぶ量が多いですが、これでも quickrun-hook のお陰でかなりすっきりとしました。
特に解説とかはしない。

function! s:quickrun_config()
    return
\       extend(copy(g:quickrun#default_config), get(g:, "quickrun_config", {}))
endfunction



" unite-quickrun {{{
let s:action = {
      \ 'description' : 'quickrun compile command',
      \ 'is_selectable' : 1,
      \ }

function! s:action.func(candidates)
    for val in a:candidates
        let g:quickrun_compile_command[&filetype] = val.word
    endfor
endfunction
call unite#custom_action('common', 'quickrun_compile_command', s:action)
unlet s:action
" }}}


" quickrun-config {{{
let s:source = {
\   "name" : "quickrun-select",
\   'description' : 'quickrun select filetype config',
\   "default_action" : "quickrun_compile_command"
\}

function! s:source.gather_candidates(args, context)
    let cmds = filter(deepcopy(g:quickrun_config), "exists('v:val.type') ? v:val.type == &filetype : 0")

    return sort(values(map(cmds, "{
\       'word'   : v:key,
\       'source' : 'quickrun-select',
\       'kind'   : 'common',
\   }")))
endfunction

call unite#define_source(s:source)
unlet s:source

nnoremap <silent> <silent> <Space>qr :Unite quickrun-select -quick-match<CR>

" }}}


" unite-quickrun-config {{{
let s:source = {
\   "name" : "quickrun-config",
\   'description' : 'quickrun select filetype config',
\   "default_action" : "quickrun_compile_command",
\   "action_table" : {
\       "set_global_quickrun_config" : {
\           "description" : "let g:quickrun_config.{filetype}.type =",
\           "is_selectable" : 0,
\       },
\       "set_local_quickrun_config" : {
\           "description" : "let b:quickrun_config.{filetype}.type =",
\           "is_selectable" : 0,
\       },
\   },
\}


function! s:source.action_table.set_global_quickrun_config.func(candidates)
    if !exists("g:quickrun_config")
        let g:quickrun_config = {}
    endif
    if !exists("g:quickrun_config.".&filetype)
        let g:quickrun_config[&filetype] = {}
    endif

    let g:quickrun_config[&filetype].type = a:candidates.action__config
endfunction

function! s:source.action_table.set_local_quickrun_config.func(candidates)
    echom &filetype
    if !exists("b:quickrun_config")
        let b:quickrun_config = {}
    endif
    if !exists("b:quickrun_config.".&filetype)
        let b:quickrun_config[&filetype] = {}
    endif

    let b:quickrun_config[&filetype].type = a:candidates.action__config
endfunction


function! s:source.gather_candidates(args, context)
    let cmds = filter(copy(s:quickrun_config()), "v:key =~# ('^'.&filetype).'/'")

    return sort(values(map(cmds, '{
\       "word"           : v:key,
\       "action__config" : v:key,
\   }')))
endfunction

call unite#define_source(s:source)
unlet s:source

nnoremap <silent> <Space>qr :Unite quickrun-config -default-action=set_global_quickrun_config<CR>
" }}}


" unite-quickfix {{{
function! g:unite_quickfix_formatter(val)
    let fname = a:val.bufnr == 0 ? "" : bufname(a:val.bufnr)
    let line  = fname == "" ? "" : a:val.lnum
    let text  = a:val.text
    let fname_env = pathshorten(fname)
    let error = a:val.type == "e" ? "|error ":""
    return fname_env."|".line.error."| ".text
endfunction


let s:source = {
\   "name" : "quickfix",
\}


function! s:qflist_to_unite(val)
    let fname = a:val.bufnr == 0 ? "" : bufname(a:val.bufnr)
    let line  = fname == "" ? "" : a:val.lnum

    return {
    \ "word": g:unite_quickfix_formatter(a:val),
    \ "source": "quickfix",
    \ "kind": "jump_list",
    \ "action__path": fname,
    \ "action__line": line,
    \ "action__pattern": a:val.pattern,
    \ "is_multiline" : 1,
    \ }
endfunction

function! s:source.gather_candidates(args, context)
    return map(getqflist(), "s:qflist_to_unite(v:val)")
endfunction

call unite#define_source(s:source)
unlet s:source
" }}}


" unite-location-list {{{
function! g:unite_location_list_formatter(val)
    let fname = a:val.bufnr == 0 ? "" : bufname(a:val.bufnr)
    let line  = fname == "" ? "" : a:val.lnum
    let text  = a:val.text
    let fname_env = pathshorten(fname)
    let error = a:val.type == "e" ? "|error ":""
    return fname_env."|".line.error."| ".text
endfunction


let s:source = {
\   "name" : "location-list",
\   "source__location_list" : [],
\}

function! s:location_list_to_unite(val)
    let fname = a:val.bufnr == 0 ? "" : bufname(a:val.bufnr)
    let line  = fname == "" ? "" : a:val.lnum

    return {
    \ "word": g:unite_location_list_formatter(a:val),
    \ "source": "location-list",
    \ "kind": "jump_list",
    \ "action__path": fname,
    \ "action__line": line,
    \ "action__pattern": a:val.pattern,
    \ "is_multiline" : 1,
    \ }
endfunction

function! s:source.gather_candidates(args, context)
    return map(getloclist("%"), "s:location_list_to_unite(v:val)")
endfunction

call unite#define_source(s:source)
unlet s:source
" }}}


" quickrun-outputter {{{

" location-list {{{
let s:outputter = quickrun#outputter#buffered#new()
let s:outputter.name = "location_list"
let s:outputter.kind = "outputter"
let s:outputter.config = {
\   'errorformat': '',
\ }

function! s:outputter.init(session)
    call call(quickrun#outputter#buffered#new().init, [a:session], self)
    let self.config.errorformat = empty(self.config.errorformat) ? &g:errorformat : self.config.errorformat
endfunction

function! s:outputter.finish(session)
    try
        let errorformat = &g:errorformat
        let &g:errorformat = self.config.errorformat

        lgetexpr self._result
        lwindow
        for winnr in range(1, winnr('$'))
            if getwinvar(winnr, '&buftype') ==# 'quickfix'
                call setwinvar(winnr, 'quickfix_title', 'quickrun: ' .
                \    join(a:session.commands, ' && '))
                break
            endif
        endfor
    finally
        let &g:errorformat = errorformat
    endtry
endfunction

call quickrun#module#register(s:outputter, 1)
unlet s:outputter
" }}}


" quickfix {{{
let s:outputter = quickrun#outputter#buffered#new()
let s:outputter.name = "quickfix"
let s:outputter.kind = "outputter"
let s:outputter.config = {
\   'errorformat': '',
\ }

function! s:outputter.init(session)
    call call(quickrun#outputter#buffered#new().init, [a:session], self)
    let self.config.errorformat = empty(self.config.errorformat) ? &g:errorformat : self.config.errorformat
endfunction

function! s:outputter.finish(session)
    try
        let errorformat = &g:errorformat
        let &g:errorformat = self.config.errorformat

        cgetexpr self._result
        cwindow
        for winnr in range(1, winnr('$'))
            if getwinvar(winnr, '&buftype') ==# 'quickfix'
                call setwinvar(winnr, 'quickfix_title', 'quickrun: ' .
                \    join(a:session.commands, ' && '))
                break
            endif
        endfor
    finally
        let &g:errorformat = errorformat
    endtry
endfunction
call quickrun#module#register(s:outputter, 1)
unlet s:outputter
" }}}


" }}}


" quickrun-hook {{{


" make_hook_points_module{{{
function! s:make_hook_points_module(base)
    let hook = copy(a:base)
    if !has_key(hook, "config")
        let hook.config = {}
    endif

    let points = [
\       "hook_loaded",
\       "normalized",
\       "module_loaded",
\       "ready",
\       "output",
\       "success",
\       "failure",
\       "finish",
\       "exit",
\   ]

    for point in points
        let hook.config["enable_".point] = get(hook.config, "enable_".point, 0)

        execute ''
\."            function! hook.on_".point."(...)\n"
\."                if self.config.enable_".point." && has_key(self, 'hook_apply')\n"
\."                    call self.hook_apply({ 'point' : '".point."', 'args' : a:000 })\n"
\."                endif\n"
\."            endfunction\n"
    endfor
    
    return hook
endfunction
" }}}


" quickrun-hook-make_hook_command {{{
function! s:make_hook_command(base)
    let hook = s:make_hook_points_module(a:base)
    let hook.config.hook_command = get(hook.config, "hook_command", "")

    function! hook.hook_apply(...)
        execute self.config.hook_command
    endfunction

    return hook
endfunction
" }}}


" quickrun-hook-output {{{
let s:hook = s:make_hook_points_module({
\   "name" : "output",
\   "kind" : "hook",
\   "config" : {
\       "enable" : 1,
\       "log" : 1
\   }
\})

function! s:hook.hook_apply(context)
    execute (self.config.log ? "echom" : "echo")." 'output ".a:context.point."'"
endfunction


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


" quickrun-hook-close_buffer {{{
let s:hook = s:make_hook_points_module({
\   "name" : "close_buffer",
\   "kind" : "hook",
\   "is_empty_data" : 1,
\   "config" : {
\       "enable_empty_data" : 0
\   }
\})

function! s:hook.hook_apply(context)
    try
        bwipeout! [quickrun
    catch
    endtry
endfunction

function! s:hook.on_output(session, context)
    if self.config.enable_empty_data
        let self.is_empty_data = self.is_empty_data ? empty(a:context.data) : 0
    endif
endfunction

function! s:hook.on_success(...)
    if self.config.enable_success
        let self.config.enable_exit = self.config.enable_success
    endif
endfunction

function! s:hook.on_failure(...)
    if self.config.enable_failure
        let self.config.enable_exit = 1
    endif
endfunction

function! s:hook.on_exit(...)
    if self.config.enable_exit || (self.config.enable_empty_data && self.is_empty_data)
        call self.hook_apply({ "point" : "exit", "args" : a:000 })
    endif
endfunction

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


" quickrun-hook-unite-quickfix {{{
let s:hook = s:make_hook_points_module({
\   "name" : "unite_quickfix",
\   "kind" : "hook",
\   "config" : {
\       "enable_full_data" : 0
\   }
\})


function! s:hook.on_output(session, context)
    if self.config.enable_full_data && !empty(a:context.data)
        let self.config.enable_exit = 1
    endif
endfunction


function! s:hook.on_success(...)
    if self.config.enable_success
        let self.config.enable_exit = self.config.enable_success
    endif
endfunction


function! s:hook.on_failure(...)
    if self.config.enable_failure
        let self.config.enable_exit = 1
    endif
endfunction


function! s:hook.hook_apply(context)
    execute "silent :Unite -buffer-name=quickrun-hook-unite-quickfix -no-quit -direction=botright -winheight=12 -max-multi-lines=32 quickfix"
endfunction


function! s:hook.priority(...)
    return 999
endfunction


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


"quickrun-hook-close_unite_quickfix {{{
let s:hook = s:make_hook_command({
\   "name" : "close_unite_quickfix",
\   "kind" : "hook",
\   "config" : {
\       "enable_exit" : 1,
\       "hook_command" : ":UniteClose quickrun-hook-unite-quickfix"
\   }
\})

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


" quickrun-hook-close_quickfix {{{
let s:hook = s:make_hook_points_module({
\   "name" : "close_quickfix",
\   "kind" : "hook",
\   "config" : {
\       "enable_exit" : 1
\   }
\})

function! s:hook.priority(point)
    return a:point == "exit"
\       ? -999
\       : 0
endfunction

function! s:hook.hook_apply(context)
    :cclose
endfunction

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


" quickrun-hook-close_location-list {{{
let s:hook = s:make_hook_points_module({
\   "name" : "close_location_list",
\   "kind" : "hook",
\   "config" : {
\       "enable_exit" : 1
\   }
\})

function! s:hook.priority(point)
    return a:point == "exit"
\       ? -999
\       : 0
endfunction

function! s:hook.hook_apply(context)
    :lclose
endfunction

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


" quickrun-hook-hier_update {{{
let s:hook = s:make_hook_command({
\   "name" : "hier_update",
\   "kind" : "hook",
\   "config" : {
\       "enable_exit" : 1,
\       "hook_command" : ":HierUpdate"
\   }
\})

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


" quickrun-hook-quickfix_stateus_enable {{{
let s:hook = s:make_hook_command({
\   "name" : "quickfix_stateus_enable",
\   "kind" : "hook",
\   "config" : {
\       "enable_exit" : 1,
\       "hook_command" : ":QuickfixStatusEnable"
\   }
\})

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


" quickrun-output-command {{{
let s:hook = {
\   "name" : "output_command",
\   "kind" : "hook",
\   "config" : {
\       "enable" : 0,
\       "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
" }}}


" quickrun-extend_condig {{{
let s:hook = {
\   "name" : "extend_config",
\   "kind" : "hook",
\   "config" : {
\       "enable" : 0,
\       "target" : "&filetype/_",
\       "override" : 0,
\   }
\}


function! s:hook.init(session)
    if self.config.enable
        let quickrun_config = s:quickrun_config()
        if has_key(quickrun_config, self.config.target)
            call extend(a:session.config, quickrun_config[self.config.target], self.config.override ? "force" : "keep")
        endif
    endif
endfunction


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


" quickrun-hook-banban {{{
let s:hook = {
\   "name" : "banban",
\   "kind" : "hook",
\   "index_counter" : 0,
\   "config" : {
\       "enable" : 0
\}
\}

function! s:hook.on_ready(session, context)
    let self.index_counter = -2
endfunction

function! s:hook.on_output(session, context)
    let self.index_counter += 1
    if self.index_counter < 0
        return
    endif
    let aa_list = [
    \   'バン(∩`・ω・)バンバン',
    \   'バン(⊃`・ω・)バンバン',
    \   'バン(∩`・ω・)バンバンバン',
    \   'バン(⊃`・ω・)バンバンバン',
    \   'バン(∩`・ω・)バンバンバンバン',
    \   'バン(⊃`・ω・)バンバンバンバン',
    \   'バン(∩`・ω・)バンバンバンバンバン',
    \   'バン(⊃`・ω・)バンバンバンバンバン',
    \   'バン(∩`・ω・)バンバンバンバンバンバン',
    \   'バン(⊃`・ω・)バンバンバンバンバンバン',
    \   'バン(∩`・ω・)バンバンバンバンバンバンバン',
    \   'バン(⊃`・ω・)バンバンバンバンバンバンバン',
    \   'バン(∩`・ω・)バンバンバンバンバンバンバンバン',
    \   'バン(⊃`・ω・)バンバンバンバンバンバンバンバン',
    \   'バン(∩`・ω・)バンバンバンバンバンバンバンバンバン',
    \   'バン(⊃`・ω・)バンバンバンバンバンバンバンバンバン',
    \   'バン(∩`・ω・)バンバンバンバンバンバンバンバンバンバン',
    \   'バン(⊃`・ω・)バンバンバンバンバンバンバンバンバンバン',
    \   'バン(∩`・ω・)バンバンバンバンバンバンバンバンバンバンバン',
    \   'バン(⊃`・ω・)バンバンバンバンバンバンバンバンバンバンバン',
    \   'バン(∩`・ω・)バンバンバンバンバンバンバンバンバンバンバンバン',
    \   'バン(⊃`・ω・)バンバンバンバンバンバンバンバンバンバンバンバン',
    \   'バン(∩`・ω・)バンバンバンバンバンバンバンバンバンバンバンバンバン',
    \   'バン(⊃`・ω・)バンバンバンバンバンバンバンバンバンバンバンバンバン',
    \]
    echo aa_list[ self.index_counter / 5 % len(aa_list)  ]
endfunction

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


" make_quickrun_hook_anim {{{
function! s:make_quickrun_hook_anim(name, aa_list, wait)

    let hook = {
    \   "name" : a:name,
    \   "kind" : "hook",
    \   "index_counter" : 0,
    \   "wait" : a:wait,
    \   "aa_list" : a:aa_list,
    \   "config" : {
    \       "enable" : 0
    \}
    \}

    function! hook.on_ready(session, context)
        let self.index_counter = -2
    endfunction

    function! hook.on_output(session, context)
        let self.index_counter += 1
        if self.index_counter < 0
            return
        endif
        echo self.aa_list[ self.index_counter / self.wait % len(self.aa_list)  ]
    endfunction
    return hook
endfunction
" }}}


" quickrun-hook-neco1 {{{
" let s:hook
call quickrun#module#register(s:make_quickrun_hook_anim(
\   "neco1",
\   [
\       "   A A\n~(-'_'-)",
\       "        A A\n     ~(-'_'-)",
\       "           A A\n        ~(-'_'-)",
\       "              A A\n           ~(-'_'-)",
\       "                 A A\n              ~(-'_'-)",
\   ],
\   10
\), 1)
" }}}


" }}}


" quickrun-config {{{

" g:quickrun_config の初期化
if !exists("g:quickrun_config")
    let g:quickrun_config={}
endif


function! g:set_quickrun_config(name, base, config)
    let base = type(a:base) == type("") ? g:quickrun_config[a:base] : a:base
    let result = deepcopy(base)
    call extend(result, a:config, "force")
    let g:quickrun_config[a:name] = deepcopy(result)
endfunction


" デフォルトの設定
let g:quickrun_config["_"] = {
    \ "outputter/buffer/split" : ":botright 8sp",
    \ "outputter" : "multi:buffer:quickfix:location_list",
    \ "outputter/buffer/running_mark" : "バン(∩`・ω・)バンバンバンバン゙ン",
    \ "runner" : "vimproc",
    \ "runner/vimproc/updatetime" : 40,
    \ "runner/vimproc/sleep" : 0,
    \ "hook/u_nya_/enable" : 1,
    \ "hook/sweep/enable" : 0,
    \ "hook/close_buffer/enable_failure" : 1,
    \ "hook/close_buffer/enable_empty_data" : 1,
    \ "hook/unite_quickfix/enable_failure" : 1,
    \ "hook/close_unite_quickfix/enable_hook_loaded" : 1,
\ }


" 実行
let g:quickrun_config["run/vimproc"] = {
    \ "exec": "%s:p:r %a",
    \ "hook/output_encode/encoding" : "utf-8",
    \ "runner" : "vimproc",
    \ "outputter" : "buffer",
    \ "hook/unite_quickfix/enable" : 0,
    \ "hook/failure_close_buffer/enable" : 0,
    \ "hook/close_buffer/enable_empty_data" : 1,
\ }


let g:quickrun_config["run/system"] = {
    \ "exec": "%s:p:r %a",
    \ "hook/" : "utf-8",
    \ "runner" : "system",
    \ "outputter" : "buffer"
\ }

let g:quickrun_config["run/vimproc/pause"] = {
    \ "exec": "%s:p:r %a && pause",
    \ "output_encode" : "utf-8",
    \ "runner" : "shell",
    \ "outputter" : "buffer"
\ }

" QuickRun の呼び出しを行うキーバインド
" とりあえず、ビルドと実行を分けて設定
let g:quickrun_compile_command = {"_" : {} }
let g:quickrun_run_command= { "_" : "run/vimproc"}
let g:prev_compile_file = ""


" 1つ前にコンパイルしたファイルでコンパイル
nnoremap <C-F8> :execute ":QuickRun -src ".join(readfile(g:prev_compile_file, 'b'), "\n").
    \ <SID>quickrun_compile_command(
    \   get(g:quickrun_compile_command, &filetype, g:quickrun_compile_command._))<CR>

" コンパイル
nnoremap <silent> <C-F7> :QuickRun<CR>

" 実行
nnoremap <C-F5> :execute ":QuickRun ".
    \ <SID>quickrun_run_command(
    \   get(g:quickrun_run_command, &filetype, g:quickrun_run_command._))<CR>
function! s:quickrun_run_command(command)
    if empty(a:command)
        return ""
    endif
        return a:command
endfunction

nnoremap <C-F6> :call openbrowser#open("file:/".expand("%:p:r").".exe")<CR>
" }}}



" quickrun-hook-add-include-option {{{
let s:hook = {
\   "name" : "add_include_option",
\   "kind" : "hook",
\   "config" : {
\       "enable" : 0,
\   },
\}

function! s:hook.on_normalized(context, session)
    let paths = filter(split(&path, ","), "len(v:val) && v:val !='.' && v:val !~ 'mingw'")
    if len(paths)
        let a:context.config.cmdopt .= " -I".join(paths, " -I")
    endif
endfunction


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




" interpreter {{{

" :QuickHaskell {{{
let g:quickrun_config["haskell/interpreter"] = {
\   "outputter" : "message",
\   "hook/u_nya_/enable" : 0,
\   "hook/eval/enable" : 1,
\   "hook/eval/template" : 'main = putStrLn(show(%s))',
\}
" \   "hook/eval/template" : 'main = putStrLn $ show $ %s',
call extend(g:quickrun_config["haskell/interpreter"], g:quickrun#default_config["haskell"])

command! -nargs=1 QuickHaskell execute ":QuickRun haskell/interpreter -src '".<f-args>."'"
" }}}


" }}}


" set quickrun_config {{{

" cpp {{{
let s:msvc_debug_option =
    \"/nologo /W3 /WX- /Od /Ob1 /Oy- /DWIN32 ".
    \"/D_DEBUG /D_CONSOLE /D_UNICODE /DUNICODE ".
    \"/Gm /Zi /EHsc /RTC1 /MTd /GS "

let s:msvc_release_option = 
    \" /DWIN32 /D_CONCOLE /DNDEBUG ".
    \"/nologo /MT /EHsc /GR "

let s:msvc_release_link_option=
    \" /link -LIBPATH:".$BOOST_LATEST_ROOT."/stage/lib ".
    \" 'kernel32.lib' 'user32.lib' 'gdi32.lib' ".
    \"'comdlg32.lib' 'advapi32.lib' 'shell32.lib' 'ole32.lib' ".
    \"'oleaut32.lib' 'uuid.lib' 'odbc32.lib' 'odbccp32.lib' "

let s:msvc_debug_link_option = s:msvc_release_link_option."/DEBUG "

let s:gcc_option = " -Wall"
let s:clang_option = s:gcc_option

let s:config = {
\
\   "cpp" : {
\       "type" : "cpp/msvc2010-debug",
\       "hook/extend_config/enable" : 1,
\   },
\
\   "cpp/_" : {
\       "hook/add_include_option/enable" : 1,
\       "hook/unite_quickfix/enable_full_data" : 1,
\       "hook/close_buffer/enable_success" : 1
\   },
\
\   "cpp/msvc2010-debug" : {
\       "command" : "cl",
\       "exec"    : "%c %o %s:p".s:msvc_debug_link_option,
\       "cmdopt"  : s:msvc_debug_option,
\       "hook/output_encode/encoding" : "sjis"
\   },
\
\   "cpp/msvc2010-release" : {
\       "command" : "cl",
\       "exec"    : "%c %o %s:p".s:msvc_release_link_option,
\       "cmdopt"  : s:msvc_release_option,
\       "hook/output_encode/encoding" : "sjis"
\   },
\
\   "cpp/clang++2.9" : {
\       "command"   : $LLMV_WORK_ROOT."/BUILD_2_9/bin/clang++",
\       "exec" : "%c %o %s -o %s:p:r ",
\       "cmdopt"    : "-std=gnu++0x ".s:clang_option,
\   },
\
\   "cpp/clang++3.0" : {
\       "command"   : $LLMV_WORK_ROOT."/BUILD_3_0/bin/clang++",
\       "exec" : "%c %o %s -o %s:p:r ",
\       "cmdopt"    : "-std=gnu++0x ".s:clang_option,
\   },
\
\   "cpp/clang++3.1" : {
\       "command"   : $LLMV_WORK_ROOT."/BUILD_3_1/bin/clang++",
\       "exec" : "%c %o %s -o %s:p:r ",
\       "cmdopt"    : "-std=gnu++0x ".s:clang_option,
\   },
\
\   "cpp/clang++03" : {
\       "command"   : "clang++",
\       "exec" : "%c %o %s -o %s:p:r ",
\       "cmdopt"    : s:clang_option,
\   },
\
\   "cpp/clang++-pedantic" : {
\       "command"   : "clang++",
\       "exec" : "%c %o %s -o %s:p:r ",
\       "cmdopt"    : "-std=gnu++0x -pedantic -pedantic-errors".s:clang_option,
\   },
\
\   "cpp/clang++" : {
\       "command"   : "clang++",
\       "exec" : "%c %o %s -o %s:p:r ",
\       "cmdopt"    : "-std=gnu++0x ".s:clang_option,
\   },
\
\   "cpp/g++03" : {
\       "command"   : "g++",
\       "exec" : "%c %o %s -o %s:p:r ",
\       "cmdopt"    : s:gcc_option,
\   },
\
\   "cpp/g++" : {
\       "command"   : "g++",
\       "exec" : "%c %o %s -o %s:p:r ",
\       "cmdopt"    : s:gcc_option." -std=gnu++0x",
\   },
\
\   "cpp/g++4.6.3" : {
\       "command"   : $GCCS_ROOT."/gcc4_6_1/bin/g++",
\       "exec" : "%c %o %s -o %s:p:r ",
\       "cmdopt"    : s:gcc_option." -std=gnu++0x",
\   },
\
\   "cpp/g++4.7" : {
\       "command"   : $GCCS_ROOT."/gcc4_7/bin/g++",
\       "exec" : "%c %o %s -o %s:p:r ",
\       "cmdopt"    : s:gcc_option." -std=gnu++0x",
\   },
\
\   "cpp/g++4.8" : {
\       "command"   : $GCCS_ROOT."/gcc4_8/bin/g++.exe",
\       "exec" : "%c %o %s -o %s:p:r ",
\       "cmdopt"    : s:gcc_option." -std=gnu++0x",
\   },
\
\   "cpp/g++4.8-OpenGL" : {
\       "command"   : $GCCS_ROOT."/gcc4_8/bin/g++.exe",
\       "exec" : "%c %o %s -o %s:p:r -lglut32 -lglu32 -lopengl32 -lglew32 ",
\       "cmdopt"    : s:gcc_option." -std=gnu++0x",
\   },
\
\   "cpp/g++4.8-pedantic" : {
\       "command"   : $GCCS_ROOT."/gcc4_8/bin/g++.exe",
\       "exec" : "%c %o %s -o %s:p:r ",
\       "cmdopt"    : s:gcc_option." -std=gnu++0x -pedantic -pedantic-errors",
\   },
\
\   "cpp/g++4.8-preprocessor" : {
\       "command"   : $GCCS_ROOT."/gcc4_8/bin/g++.exe",
\       "exec" : "%c %o %s:p  ",
\       "cmdopt"    : s:gcc_option." -P -E -std=gnu++0x",
\       "outputter" : "buffer",
\       "hook/close_buffer/enable_empty_data" : 1,
\       "hook/close_buffer/enable_success" : 0,
\       "hook/close_buffer/enable_failure" : 0,
\       "hook/unite_quickfix/enable" : 0,
\   },
\
\   "cpp/syntax_check" : {
\       "command"   : $GCCS_ROOT."/gcc4_8/bin/g++.exe",
\       "exec"      : "%c %o %s:p ",
\       "outputter" : "multi:quickfix:location_list",
\       "cmdopt"    : "-fsyntax-only -std=gnu++0x -fconstexpr-depth=4096 -Wall ",
\       "runner"    : "vimproc",
\       "vimproc/sleep"    : 0,
\       "hook/unite_quickfix/enable" : 0,
\       "hook/add_include_option/enable" : "1",
\       "hook/close_unite_quickfix/enable" : 0,
\       "hook/close_buffer/enable_exit" : 1,
\       "hook/u_nya_/enable" : 0,
\   },
\
\   "cpp/bjam" : {
\       "command"   : $BOOST_ROOT."/bjam",
\       "exec" : "%c %o",
\       "hook/output_encode/encoding" : "sjis",
\       "hook/add_include_option/enable" : 0,
\   },
\
\}
call extend(g:quickrun_config, s:config)
unlet s:config
" }}}


" jsx {{{
let s:config = {
\   "jsx" : {
\       "type" : "jsx/run",
\   },
\   "jsx/run" : {
\       "command"   : "jsx",
\       "exec"      : "%c --run %s:p",
\       "quickfix/errorformat" : '[%f:%l] %m',
\   },
\}


call extend(g:quickrun_config, s:config)
unlet s:config
"}}}

" }}}


" vim:set foldmethod=marker: