Skip to content

Instantly share code, notes, and snippets.

@cawhitworth
Created February 8, 2016 10:06
Show Gist options
  • Save cawhitworth/9a8cc507e58cd6a1250d to your computer and use it in GitHub Desktop.
Save cawhitworth/9a8cc507e58cd6a1250d to your computer and use it in GitHub Desktop.
CSC in vimrc
function! BuildOutput(output)
let winnum = bufwinnr('BUILD')
if winnum != -1
if winnr() != winnum
exec winnum . "wincmd w"
endif
else
belowright split BUILD
setlocal buftype=nofile
resize 15
endif
normal! ggdG
call append(0, split(a:output, '\v\n'))
endfunction
function! CSC(file)
let command = "csc " . a:file
let results = system(command)
call BuildOutput(command . "\r\n" . results)
endfunction
nnoremap <leader>bc :w!<CR>:call CSC(expand("%"))<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment