diff --git a/vim/init.vim b/vim/init.vim index 52370df..b0a04ad 100644 --- a/vim/init.vim +++ b/vim/init.vim @@ -40,6 +40,12 @@ function! IsMac() \ system('uname') =~? '^darwin')) endfunction +function! IsGuiApp() + return has("gui_running") || exists("neovim_dot_app") + \ || has("gui_win32") || has("gui_macvim") + \ || has("gui_vimr") +endfunction + " Auto install vim-plug if empty(glob('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs diff --git a/vim/rc/ui.rc.vim b/vim/rc/ui.rc.vim index e23bb49..436cf65 100644 --- a/vim/rc/ui.rc.vim +++ b/vim/rc/ui.rc.vim @@ -13,18 +13,14 @@ syntax on " Enable search highlighting set hls - " Color Schemes {{ " Set theme based on $VIM_COLOR variable try if !empty($VIM_COLOR) colorscheme $VIM_COLOR else - if has("gui_running") || exists("neovim_dot_app") - colorscheme wombat256mod - else - colorscheme vividchalk - endif + " Prefered default colorscheme + colorscheme wombat256mod endif catch /^Vim\%((\a\+)\)\=:E185/ " Colorschemes not installed yet @@ -32,6 +28,11 @@ catch /^Vim\%((\a\+)\)\=:E185/ colorscheme default endtry +" Override gui colorscheme +if IsGuiApp() + colorscheme wombat256mod +endif + " Set Airline theme if g:colors_name == 'github' let g:airline_theme = 'solarized' @@ -39,10 +40,10 @@ endif " }} " Set gui fonts {{ -if has("gui_running") || exists("neovim_dot_app") - if has("gui_win32") +if IsGuiApp() + if IsWindows() set guifont=Consolas:h10:b - elseif IsMac() && (has("gui_macvim") || exists("neovim_dot_app")) + elseif IsMac() try set guifont=DejaVu\ Sans\ Mono\ for\ Powerline:h11 catch