1
0
mirror of https://github.com/danbee/dotfiles-local synced 2025-03-04 08:49:07 +00:00

Add devicons

This commit is contained in:
Daniel Barber 2018-03-30 13:09:52 -04:00
parent 7da407088b
commit ad9a39820f
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8
3 changed files with 91 additions and 6 deletions

83
vim/vimrc.d/devicons.vim Normal file
View File

@ -0,0 +1,83 @@
let g:WebDevIconsUnicodeDecorateFolderNodes = 1
let g:sol = {
\"gui": {
\"base03": "#002b36",
\"base02": "#073642",
\"base01": "#586e75",
\"base00": "#657b83",
\"base0": "#839496",
\"base1": "#93a1a1",
\"base2": "#eee8d5",
\"base3": "#fdf6e3",
\"yellow": "#b58900",
\"orange": "#cb4b16",
\"red": "#dc322f",
\"magenta": "#d33682",
\"violet": "#6c71c4",
\"blue": "#268bd2",
\"cyan": "#2aa198",
\"green": "#719e07"
\},
\"cterm": {
\"base03": 8,
\"base02": 0,
\"base01": 10,
\"base00": 11,
\"base0": 12,
\"base1": 14,
\"base2": 7,
\"base3": 15,
\"yellow": 3,
\"orange": 9,
\"red": 1,
\"magenta": 5,
\"violet": 13,
\"blue": 4,
\"cyan": 6,
\"green": 2
\}
\}
function! DeviconsColors(config)
let colors = keys(a:config)
augroup devicons_colors
autocmd!
for color in colors
if color == 'normal'
exec 'autocmd FileType nerdtree,startify if &background == ''dark'' | '.
\ 'highlight devicons_'.color.' guifg='.g:sol.gui.base01.' ctermfg='.g:sol.cterm.base01.' | '.
\ 'else | '.
\ 'highlight devicons_'.color.' guifg='.g:sol.gui.base1.' ctermfg='.g:sol.cterm.base1.' | '.
\ 'endif'
elseif color == 'emphasize'
exec 'autocmd FileType nerdtree,startify if &background == ''dark'' | '.
\ 'highlight devicons_'.color.' guifg='.g:sol.gui.base1.' ctermfg='.g:sol.cterm.base1.' | '.
\ 'else | '.
\ 'highlight devicons_'.color.' guifg='.g:sol.gui.base01.' ctermfg='.g:sol.cterm.base01.' | '.
\ 'endif'
else
exec 'autocmd FileType nerdtree,startify highlight devicons_'.color.' guifg='.g:sol.gui[color].' ctermfg='.g:sol.cterm[color]
endif
exec 'autocmd FileType nerdtree,startify syntax match devicons_'.color.' /\v'.join(a:config[color], '|').'/ containedin=ALL'
endfor
augroup END
endfunction
let g:devicons_colors = {
\'normal': ['', '', '', '', ''],
\'emphasize': ['', '', '', '', '', '', '', '', '', '', ''],
\'yellow': ['', '', ''],
\'orange': ['', '', '', 'λ', '', ''],
\'red': ['', '', '', '', '', '', '', '', ''],
\'magenta': [''],
\'violet': ['', '', '', '', '●'],
\'blue': ['', '', '', '', '', '', '', '', '', '', '', '', ''],
\'cyan': ['', '', '', ''],
\'green': ['', '', '', '']
\}
call DeviconsColors(g:devicons_colors)

View File

@ -9,6 +9,8 @@ Plug 'ConradIrwin/vim-bracketed-paste'
Plug 'rizzatti/dash.vim'
Plug 'ryanoasis/vim-devicons'
" Language additions
Plug 'briancollins/vim-jst'
Plug 'elixir-lang/vim-elixir'

View File

@ -6,7 +6,7 @@ colorscheme Tomorrow-Night
if has("gui_running") || has("gui_vimr")
" Set GUI font according to OS
if has("gui_macvim")
set guifont=Source\ Code\ Pro\ for\ Powerline:h13
set guifont=Sauce\ Code\ Pro\ Nerd\ Font\ Complete\ Mono:h13
elseif has("gui_gtk2")
set guifont=DejaVu\ Sans\ Mono\ 15
endif
@ -22,11 +22,11 @@ if has("gui_running") || has("gui_vimr")
set guioptions-=l
endif
" Map ctrl-hjkl for easy window movement
map <c-h> <c-w>h
map <c-j> <c-w>j
map <c-k> <c-w>k
map <c-l> <c-w>l
" Display extra whitespace
set list listchars=tab:»·,trail:·
" Map ctrl-a to redraw
nnoremap <C-a> :redraw!<CR>
" Set Scroll off
set scrolloff=12