From 7940274ad0764ce66d07e7421aae37d6dfaa26f3 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 5 Oct 2019 23:49:47 +0200 Subject: [PATCH] [ADD][VIM] ALE and linting lighline integration I changed the theme of lightline's statusline to wombat because the errors did not have any color using gruvbox. --- vim/.vimrc | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/vim/.vimrc b/vim/.vimrc index 35041b2..c2e04ea 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -122,6 +122,14 @@ Plug 'honza/vim-snippets' """""" Plug 'rust-lang/rust.vim' " }}} +" +" LSP {{{ +""""" +" Asynchronous Linting Engine +Plug 'dense-analysis/ale' +" Pre-made ALE integration with lightline +Plug 'maximbaz/lightline-ale' +" }}} call plug#end() " }}} @@ -201,7 +209,7 @@ colorscheme gruvbox """""""""""""""""""" let g:lightline={} " Use the gruvbox colorscheme -let g:lightline.colorscheme='gruvbox' +let g:lightline.colorscheme='wombat' let g:lightline.active={ \ 'left': [ \ [ 'mode', 'paste' ], @@ -212,6 +220,8 @@ let g:lightline.active={ \ [ 'lineinfo' ], \ [ 'percent' ], \ [ 'fileformat', 'fileencoding', 'filetype' ], + \ [ 'linter_check', 'linter_errors', 'linter_warn', 'linter_ok' ], + \ [ 'ctags_status' ], \ ] \ } let g:lightline.inactive={ @@ -228,6 +238,24 @@ let g:lightline.component_function={ \ 'modified': 'LightlineModified', \ 'gitbranch': 'LightlineFugitive', \ } +let g:lightline.component_expand={ + \ 'linter_check': 'lightline#ale#checking', + \ 'linter_warn': 'lightline#ale#warnings', + \ 'linter_errors': 'lightline#ale#errors', + \ 'linter_ok': 'lightline#ale#ok', + \ } +let g:lightline.component_type={ + \ 'readonly': 'error', + \ 'linter_checking': 'left', + \ 'linter_warnings': 'warning', + \ 'linter_errors': 'error', + \ 'linter_ok': 'left', + \ } +" Show pretty icons instead of text for linting status +let g:lightline#ale#indicator_checking='⏳' +let g:lightline#ale#indicator_warnings='◆' +let g:lightline#ale#indicator_errors='✗' +let g:lightline#ale#indicator_ok='✓' " Lightline function wrappers {{{ """""""""""""""""""""""""""""