From f093ef8b6b23a11a86c96fdae273c107c4909ff1 Mon Sep 17 00:00:00 2001 From: Edward Litherland-Smith Date: Fri, 18 Dec 2020 10:38:50 +0000 Subject: [PATCH] Add various plugins, configure lightline Add ALE (Asynchronous Lint Engine), fugitive for git and configure lightline to work better with both of these --- .gitmodules | 9 +++++++++ pack/plugins/start/ale | 1 + pack/plugins/start/lightline-ale | 1 + pack/plugins/start/vim-fugitive | 1 + vimrc | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 44 insertions(+) create mode 160000 pack/plugins/start/ale create mode 160000 pack/plugins/start/lightline-ale create mode 160000 pack/plugins/start/vim-fugitive diff --git a/.gitmodules b/.gitmodules index 3b8993e6..91ce2c6b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,12 @@ [submodule "pack/plugins/start/auto-pairs"] path = pack/plugins/start/auto-pairs url = https://github.com/jiangmiao/auto-pairs.git +[submodule "pack/plugins/start/ale"] + path = pack/plugins/start/ale + url = https://github.com/dense-analysis/ale.git +[submodule "pack/plugins/start/lightline-ale"] + path = pack/plugins/start/lightline-ale + url = https://github.com/maximbaz/lightline-ale.git +[submodule "pack/plugins/start/vim-fugitive"] + path = pack/plugins/start/vim-fugitive + url = https://github.com/tpope/vim-fugitive.git diff --git a/pack/plugins/start/ale b/pack/plugins/start/ale new file mode 160000 index 00000000..f996ede5 --- /dev/null +++ b/pack/plugins/start/ale @@ -0,0 +1 @@ +Subproject commit f996ede5999c99b1b3e3cecc02dbd06cb286d3ff diff --git a/pack/plugins/start/lightline-ale b/pack/plugins/start/lightline-ale new file mode 160000 index 00000000..23352556 --- /dev/null +++ b/pack/plugins/start/lightline-ale @@ -0,0 +1 @@ +Subproject commit 23352556fdaa067209fa22df424f1b88ab370f6a diff --git a/pack/plugins/start/vim-fugitive b/pack/plugins/start/vim-fugitive new file mode 160000 index 00000000..bebe504e --- /dev/null +++ b/pack/plugins/start/vim-fugitive @@ -0,0 +1 @@ +Subproject commit bebe504e38d0a20c30d6dd666c4c793b3cc66104 diff --git a/vimrc b/vimrc index 61005092..99867e1b 100644 --- a/vimrc +++ b/vimrc @@ -26,3 +26,35 @@ noremap set splitbelow set splitright + +let g:lightline = {} + +let g:lightline.component_expand = { + \ 'linter_checking': 'lightline#ale#checking', + \ 'linter_infos': 'lightline#ale#infos', + \ 'linter_warnings': 'lightline#ale#warnings', + \ 'linter_errors': 'lightline#ale#errors', + \ 'linter_ok': 'lightline#ale#ok', + \ } + +let g:lightline.component_type = { + \ 'linter_checking': 'right', + \ 'linter_infos': 'right', + \ 'linter_warnings': 'warning', + \ 'linter_errors': 'error', + \ 'linter_ok': 'right', + \ } + +let g:lightline.component_function = { + \ 'gitbranch': 'FugitiveHead' + \ } + + +let g:lightline.active = { + \ 'left': [ [ 'mode', 'paste' ], + \ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ], + \ 'right': [ [ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_infos', 'linter_ok', 'lineinfo' ], + \ [ 'percent' ], + \ [ 'fileformat', 'fileencoding', 'filetype' ] ] + \ } +set noshowmode