mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins, also experimenting with a new font
The font is IBM Plex Mono: https://ibm.github.io/type/
This commit is contained in:
@ -162,6 +162,18 @@ function! go#tool#FilterValids(items) abort
|
||||
endfunction
|
||||
|
||||
function! go#tool#ExecuteInDir(cmd) abort
|
||||
" Verify that the directory actually exists. If the directory does not
|
||||
" exist, then assume that the a:cmd should not be executed. Callers expect
|
||||
" to check v:shell_error (via go#util#ShellError()), so execute a command
|
||||
" that will return an error as if a:cmd was run and exited with an error.
|
||||
" This helps avoid errors when working with plugins that use virtual files
|
||||
" that don't actually exist on the file system (e.g. vim-fugitive's
|
||||
" GitDiff).
|
||||
if !isdirectory(expand("%:p:h"))
|
||||
let [out, err] = go#util#Exec(["false"])
|
||||
return ''
|
||||
endif
|
||||
|
||||
let old_gopath = $GOPATH
|
||||
let old_goroot = $GOROOT
|
||||
let $GOPATH = go#path#Detect()
|
||||
@ -194,7 +206,6 @@ function! go#tool#Exists(importpath) abort
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
|
||||
" following two functions are from: https://github.com/mattn/gist-vim
|
||||
" thanks @mattn
|
||||
function! s:get_browser_command() abort
|
||||
@ -202,12 +213,14 @@ function! s:get_browser_command() abort
|
||||
if go_play_browser_command == ''
|
||||
if go#util#IsWin()
|
||||
let go_play_browser_command = '!start rundll32 url.dll,FileProtocolHandler %URL%'
|
||||
elseif has('mac') || has('macunix') || has('gui_macvim') || go#util#System('uname') =~? '^darwin'
|
||||
elseif go#util#IsMac()
|
||||
let go_play_browser_command = 'open %URL%'
|
||||
elseif executable('xdg-open')
|
||||
let go_play_browser_command = 'xdg-open %URL%'
|
||||
elseif executable('firefox')
|
||||
let go_play_browser_command = 'firefox %URL% &'
|
||||
elseif executable('chromium')
|
||||
let go_play_browser_command = 'chromium %URL% &'
|
||||
else
|
||||
let go_play_browser_command = ''
|
||||
endif
|
||||
|
Reference in New Issue
Block a user