mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2025-01-08 01:47: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'))
|
\ system('uname') =~? '^darwin'))
|
||||||
endfunction
|
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
|
" Auto install vim-plug
|
||||||
if empty(glob('~/.vim/autoload/plug.vim'))
|
if empty(glob('~/.vim/autoload/plug.vim'))
|
||||||
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
|
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
|
||||||
|
@ -13,18 +13,14 @@ syntax on
|
|||||||
" Enable search highlighting
|
" Enable search highlighting
|
||||||
set hls
|
set hls
|
||||||
|
|
||||||
|
|
||||||
" Color Schemes {{
|
" Color Schemes {{
|
||||||
" Set theme based on $VIM_COLOR variable
|
" Set theme based on $VIM_COLOR variable
|
||||||
try
|
try
|
||||||
if !empty($VIM_COLOR)
|
if !empty($VIM_COLOR)
|
||||||
colorscheme $VIM_COLOR
|
colorscheme $VIM_COLOR
|
||||||
else
|
else
|
||||||
if has("gui_running") || exists("neovim_dot_app")
|
" Prefered default colorscheme
|
||||||
colorscheme wombat256mod
|
colorscheme wombat256mod
|
||||||
else
|
|
||||||
colorscheme vividchalk
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
catch /^Vim\%((\a\+)\)\=:E185/
|
catch /^Vim\%((\a\+)\)\=:E185/
|
||||||
" Colorschemes not installed yet
|
" Colorschemes not installed yet
|
||||||
@ -32,6 +28,11 @@ catch /^Vim\%((\a\+)\)\=:E185/
|
|||||||
colorscheme default
|
colorscheme default
|
||||||
endtry
|
endtry
|
||||||
|
|
||||||
|
" Override gui colorscheme
|
||||||
|
if IsGuiApp()
|
||||||
|
colorscheme wombat256mod
|
||||||
|
endif
|
||||||
|
|
||||||
" Set Airline theme
|
" Set Airline theme
|
||||||
if g:colors_name == 'github'
|
if g:colors_name == 'github'
|
||||||
let g:airline_theme = 'solarized'
|
let g:airline_theme = 'solarized'
|
||||||
@ -39,10 +40,10 @@ endif
|
|||||||
" }}
|
" }}
|
||||||
|
|
||||||
" Set gui fonts {{
|
" Set gui fonts {{
|
||||||
if has("gui_running") || exists("neovim_dot_app")
|
if IsGuiApp()
|
||||||
if has("gui_win32")
|
if IsWindows()
|
||||||
set guifont=Consolas:h10:b
|
set guifont=Consolas:h10:b
|
||||||
elseif IsMac() && (has("gui_macvim") || exists("neovim_dot_app"))
|
elseif IsMac()
|
||||||
try
|
try
|
||||||
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline:h11
|
set guifont=DejaVu\ Sans\ Mono\ for\ Powerline:h11
|
||||||
catch
|
catch
|
||||||
|
Loading…
Reference in New Issue
Block a user