public
Created

  • Download Gist
gistfile1.diff
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
diff --git a/autoload/quickrun.vim b/autoload/quickrun.vim
index 288cab6..1061470 100644
--- a/autoload/quickrun.vim
+++ b/autoload/quickrun.vim
@@ -142,9 +142,11 @@ let g:quickrun#default_config = {
\ },
\ 'go': {
\ 'type':
+\ executable('8g') || executable('6g') || executable('5g') ?
\ $GOARCH ==# '386' ? (s:is_win ? 'go/386/win' : 'go/386'):
\ $GOARCH ==# 'amd64' ? 'go/amd64':
-\ $GOARCH ==# 'arm' ? 'go/arm': '',
+\ $GOARCH ==# 'arm' ? 'go/arm': '' :
+\ executable('go') ? (s:is_win ? 'go/go/win' : 'go/go'): '',
\ },
\ 'go/386': {
\ 'exec': ['8g %o -o %s:p:r.8 %s', '8l -o %s:p:r %s:p:r.8',
@@ -170,6 +172,16 @@ let g:quickrun#default_config = {
\ 'tempfile': '%{tempname()}.go',
\ 'output_encode': 'utf-8',
\ },
+\ 'go/go': {
+\ 'exec': ['go build %s', '%s:p:r %a', 'rm -f %s:p:r'],
+\ 'tempfile': '%{tempname()}.go',
+\ 'output_encode': 'utf-8',
+\ },
+\ 'go/go/win': {
+\ 'exec': ['(cd %s:p:h ^\& go build %s:p:t)', '%s:p:r.exe %a', 'del /F %s:p:r.exe'],
+\ 'tempfile': '%{tempname()}.go',
+\ 'output_encode': 'utf-8',
+\ },
\ 'groovy': {
\ 'cmdopt': '-c %{&fenc==#""?&enc:&fenc}'
\ },
diff --git a/autoload/quickrun/runner/system.vim b/autoload/quickrun/runner/system.vim
index 64dc1a5..0db0c4c 100644
--- a/autoload/quickrun/runner/system.vim
+++ b/autoload/quickrun/runner/system.vim
@@ -35,7 +35,9 @@ function! s:execute(cmd, input)
try
if is_cmd_exe
let sxq = &shellxquote
- let &shellxquote = '"'
+ if a:cmd !~ '^(.*)$'
+ let &shellxquote = '"'
+ endif
endif
let cmd = a:cmd

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.