From d4803b6c3166f1709b27afe87b2cc3c462d5ae77 Mon Sep 17 00:00:00 2001 From: Bazaah Date: Thu, 1 Oct 2020 13:23:04 +0000 Subject: [PATCH] initial integration with neomake --- vimrc | 66 ++++++++++++++++++++++++++++++++++++++--------------------- zshrc | 2 +- 2 files changed, 44 insertions(+), 24 deletions(-) diff --git a/vimrc b/vimrc index 74c324d..c990420 100644 --- a/vimrc +++ b/vimrc @@ -85,7 +85,13 @@ endif exec "set rtp=$VIMHOME," . &rtp -" (Optional) Multi-entry selection UI. +function! LoadIf(check, ...) + let opts = get(a:000, 0, {}) + " Use opts, or default to not loading plugin + return a:check ? opts : extend(opts, { 'on': [], 'for': [] }) +endfunction + +let useNeomake = has('nvim') || v:version > 800 call SourceIfExists(g:rc_files['pre']) call plug#begin("$VIMHOME/plugged") @@ -94,7 +100,6 @@ call plug#begin("$VIMHOME/plugged") Plug 'tpope/vim-fugitive' Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'Xuyuanp/nerdtree-git-plugin', { 'on': 'NERDTreeToggle' } - Plug 'scrooloose/syntastic' Plug 'scrooloose/nerdcommenter' Plug 'scrooloose/vim-statline' Plug 'vim-perl/vim-perl', { 'for': 'perl', 'do': 'make clean carp dancer highlight-all-pragmas moose test-more try-tiny' } @@ -104,7 +109,7 @@ call plug#begin("$VIMHOME/plugged") Plug 'kevinoid/vim-jsonc' Plug 'jremmen/vim-ripgrep', { 'on': ['Rg', 'RgRoot'] } Plug 'junegunn/fzf', { 'on': ['FZF', 'fzf#run', 'fzf#wrap'] } - Plug 'junegunn/fzf.vim' + Plug 'junegunn/fzf.vim', Plug 'sheerun/vim-polyglot' Plug 'adelarsq/vim-matchit' Plug 'vim-airline/vim-airline' @@ -112,16 +117,17 @@ call plug#begin("$VIMHOME/plugged") Plug 'airblade/vim-gitgutter' Plug 'rakr/vim-one' Plug 'mox-mox/vim-localsearch' - Plug 'neoclide/coc.nvim', { 'branch': 'release' } Plug 'romainl/vim-cool' Plug 'christoomey/vim-tmux-navigator', { 'on': ['TmuxNavigateLeft', 'TmuxNavigateDown', 'TmuxNavigateUp', 'TmuxNavigateRight', 'TmuxNavigatePrevious'] } - call SourceIfExists(g:rc_files['plug']) - if has('nvim') - Plug 'roxma/nvim-yarp' - Plug 'roxma/vim-hug-neovim-rpc' - endif -call plug#end() + Plug 'neoclide/coc.nvim', { 'branch': 'release' } + Plug 'scrooloose/syntastic', LoadIf(!useNeomake) + Plug 'neomake/neomake', LoadIf(useNeomake) + + Plug 'roxma/nvim-yarp', LoadIf(has('nvim')) + Plug 'roxma/vim-hug-neovim-rpc', LoadIf(has('nvim')) + call SourceIfExists(g:rc_files['plug']) +call plug#end() call SourceIfExists(g:rc_files['post']) execute ':silent !mkdir -p ~/.vimbackup' @@ -161,17 +167,34 @@ augroup PsoxNERDTree autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif augroup END +if useNeomake + let g:neomake_open_list = 2 + let g:neomake_serialize = 1 + let g:neomake_serialize_abort_on_error = 1 + " Run on write (instant) + read (800ms) buffers + call neomake#configure#automake('rw', 800) -" Syntastic Settings -" Note that airline automatically configures these -let g:syntastic_always_populate_loc_list = 1 -let g:syntastic_enable_signs = 1 -let g:syntastic_auto_loc_list = 1 -let g:syntastic_check_on_open = 1 -let g:syntastic_check_on_wq = 0 -" Syntastic enable specific checkers -let g:syntastic_enable_zsh_checker = 1 -let g:syntastic_enable_bash_checker = 1 + if has_key(plugs, 'syntastic') + " Disable inherited syntastic + let g:syntastic_mode_map = { + \ "mode": "passive", + \ "active_filetypes": [], + \ "passive_filetypes": [] } + endif +endif + +if !useNeomake + " Syntastic Settings + " Note that airline automatically configures these + let g:syntastic_always_populate_loc_list = 1 + let g:syntastic_enable_signs = 1 + let g:syntastic_auto_loc_list = 1 + let g:syntastic_check_on_open = 1 + let g:syntastic_check_on_wq = 0 + " Syntastic enable specific checkers + let g:syntastic_enable_zsh_checker = 1 + let g:syntastic_enable_bash_checker = 1 +endif " ripgrep settings let g:rg_highlight = 'true' @@ -271,9 +294,6 @@ endif " NERDTree Toggle nnoremap :NERDTreeToggle -" NERDComment settings -" nnoremap :call NERDComment('n', 'toggle') - " Workaround for writing readonly files cnoremap w!! w !sudo tee % > /dev/null diff --git a/zshrc b/zshrc index 2a99fc8..cd105fc 100755 --- a/zshrc +++ b/zshrc @@ -114,7 +114,7 @@ plugins=( common-aliases colored-man-pages ) -( which git &>/dev/null ) && plugins+=( git git-extras git-flow-avh ) && [[ "$ZSH_THEME" == "stemmet" ]] && plugins+=( git-prompt ) +( which git &>/dev/null ) && plugins+=( git git-extras git-flow-avh ) #&& [[ "$ZSH_THEME" == "stemmet" ]] && plugins+=( git-prompt ) ( which perl &>/dev/null ) && plugins+=( perl ) ( which go &>/dev/null ) && plugins+=( golang ) ( which oc &>/dev/null ) && plugins+=( oc )