From 7e541518bf6760c28a11594a4642b416634710f0 Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Sat, 21 Mar 2020 14:59:04 +0100 Subject: [PATCH] Add support for vim-devicons --- gvimrc | 2 +- init.vim | 3 +++ install.sh | 13 ++++++++++++- plugins.vim | 7 +++++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/gvimrc b/gvimrc index d99a44f..1956f8b 100644 --- a/gvimrc +++ b/gvimrc @@ -1,6 +1,6 @@ set columns=100 set lines=53 -set guifont=Hack\ 9,Liberation\ Mono\ for\ Powerline\ 10,DejaVu\ Sans\ Mono\ 10,Monospace\ 10 +set guifont=Hack\ NF\ 9,Hack\ 9,Liberation\ Mono\ for\ Powerline\ 10,DejaVu\ Sans\ Mono\ 10,Monospace\ 10 set mousehide diff --git a/init.vim b/init.vim index fd7e77d..e4ed9a1 100644 --- a/init.vim +++ b/init.vim @@ -43,6 +43,9 @@ syntax on """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Some global plugin settings +" Enable loading of devicons +let g:enable_plugin_devicons = 1 + runtime plugsetup.vim " Attention: Must be run after plugsetup.vim diff --git a/install.sh b/install.sh index b6ce4d7..4a5ee5a 100755 --- a/install.sh +++ b/install.sh @@ -25,13 +25,23 @@ check_py3() check_prog() { if which "$1" > /dev/null; then - echo "$1 found" + echo "$1 found." else echo "$1 not found. Aborting." exit fi } +check_font() +{ + if fc-list | grep -q "$1"; then + echo "Font $1 found." + else + echo "Font $1 not found. Either install it or clear g:enable_plugin_devicons." + exit + fi +} + check_requirements() { check_prog aspell @@ -39,6 +49,7 @@ check_requirements() check_prog git check_vim +python3 check_py3 neovim + check_font "Hack NF" } backup() { diff --git a/plugins.vim b/plugins.vim index 2b36d0a..0e25290 100644 --- a/plugins.vim +++ b/plugins.vim @@ -1,3 +1,8 @@ +function! Cond(cond, ...) + let opts = get(a:000, 0, {}) + return a:cond ? opts : extend(opts, { 'on': [], 'for': [] }) +endfunction + Plug 'mhinz/vim-startify' Plug 'vim-airline/vim-airline' @@ -15,6 +20,8 @@ Plug 'scrooloose/nerdcommenter' Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'} Plug 'Xuyuanp/nerdtree-git-plugin', {'on': 'NERDTreeToggle'} +Plug 'ryanoasis/vim-devicons', Cond(g:enable_plugin_devicons) + Plug 'neomake/neomake' Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'} -- 2.30.2