mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2025-01-06 18:07:35 +00:00
Improve colorscheme and gui detection
This commit is contained in:
parent
8f93dd590d
commit
b899f3f379
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user