Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. function! BuildOutput(output)
  2. let winnum = bufwinnr('BUILD')
  3. if winnum != -1
  4. if winnr() != winnum
  5. exec winnum . "wincmd w"
  6. endif
  7. else
  8. belowright split BUILD
  9. setlocal buftype=nofile
  10. resize 15
  11. endif
  12.  
  13. normal! ggdG
  14. call append(0, split(a:output, '\v\n'))
  15. endfunction
  16.  
  17. function! CSC(file)
  18. let command = "csc " . a:file
  19. let results = system(command)
  20. call BuildOutput(command . "\r\n" . results)
  21. endfunction
  22.  
  23. nnoremap <leader>bc :w!<CR>:call CSC(expand("%"))<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement