Created
February 8, 2016 10:06
-
-
Save cawhitworth/9a8cc507e58cd6a1250d to your computer and use it in GitHub Desktop.
CSC in vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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