diff --git a/nvim/config/coc-settings.json b/nvim/config/coc-settings.json index 48e1fa0..9912940 100644 --- a/nvim/config/coc-settings.json +++ b/nvim/config/coc-settings.json @@ -1,7 +1,6 @@ { - "npm.binPath": "yarn", + "npm.binPath": "yarnpkg", "python.linting.enable": true, "python.linting.flake8Enabled": true, - "explorer.icon.enableNerdfont": true, - "explorer.width": 30 + "python.linting.pylintEnabled": false } diff --git a/nvim/config/init.vim b/nvim/config/init.vim index a20e709..1509d1e 100644 --- a/nvim/config/init.vim +++ b/nvim/config/init.vim @@ -59,6 +59,7 @@ nnoremap w :w nnoremap :noh inoremap +nmap ss :syntax sync fromstart " trailing spaces @@ -92,11 +93,12 @@ Plug 'jiangmiao/auto-pairs' Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' } Plug 'posva/vim-vue', { 'for': 'vue' } Plug 'tpope/vim-repeat' -"Plug 'neoclide/coc.nvim', {'branch': 'release'} -"Plug 'neoclide/coc-json', {'do': 'yarnpkg install --frozen-lockfile'} -"Plug 'iamcco/coc-vimlsp', {'do': 'yarnpkg install --frozen-lockfile'} -"Plug 'neoclide/coc-python', {'do': 'yarnpkg install --frozen-lockfile'} -"Plug 'weirongxu/coc-explorer', {'do': 'yarnpkg install --frozen-lockfile'} +if $COC_ENABLED == 'yes' + Plug 'neoclide/coc.nvim', {'branch': 'release'} + Plug 'neoclide/coc-python', {'do': 'yarnpkg install --frozen-lockfile'} +else + Plug 'Vimjas/vim-python-pep8-indent', { 'for': 'python' } +endif Plug 'liuchengxu/eleline.vim' Plug 'tpope/vim-fugitive' " git 功能 Plug 'scrooloose/nerdcommenter' @@ -104,7 +106,6 @@ Plug 'scrooloose/nerdcommenter' Plug 'mhinz/vim-grepper', { 'on': ['Grepper', '(GrepperOperator)'] } Plug 'morhetz/gruvbox' Plug 'dag/vim-fish', { 'for': 'fish' } -Plug 'Vimjas/vim-python-pep8-indent', { 'for': 'python' } Plug 'chrisbra/Colorizer' Plug 'alvan/vim-closetag', { 'for': ['vue', 'html', 'xml'] } Plug 'airblade/vim-gitgutter' @@ -121,24 +122,25 @@ let g:closetag_filetypes = 'html,xhtml,phtml,vue' " ==== coc configuration ==== -"let g:coc_disable_startup_warning = 1 -"nmap gd (coc-definition) -"nmap gy (coc-type-definition) -"nmap gi (coc-implementation) -"nmap gr (coc-references) +if $COC_ENABLED == 'yes' + let g:coc_disable_startup_warning = 1 + set statusline^=%{coc#status()} + nmap gd (coc-definition) + nmap gy (coc-type-definition) + nmap gi (coc-implementation) + nmap gr (coc-references) -"xmap fs (coc-format-selected) -"nmap fs (coc-format-selected) -"nmap fb (coc-format) -"nmap rn (coc-rename) -"nmap ne (coc-diagnostic-next-error) -"nmap pe (coc-diagnostic-prev-error) -"nmap fe :CocCommand explorer --toggle -"nmap if :CocInfo -"nmap cl :CocList -"nmap sd :call CocAction('doHover') -"nmap ss :syntax sync fromstart -"nmap ol (coc-openlink) + xmap fs (coc-format-selected) + nmap fs (coc-format-selected) + nmap fb (coc-format) + nmap rn (coc-rename) + nmap ne (coc-diagnostic-next-error) + nmap pe (coc-diagnostic-prev-error) + nmap if :CocInfo + nmap cl :CocList + nmap sd :call CocAction('doHover') + nmap ol (coc-openlink) +endif " ==== auto-pairs configuration ==== nmap ap :call AutoPairsToggle() diff --git a/nvim/install.sh b/nvim/install.sh index 246dadc..17fba2c 100755 --- a/nvim/install.sh +++ b/nvim/install.sh @@ -20,4 +20,5 @@ esac # symlink configuration lnsf $DIR/config/init.vim $XDG_CONFIG_HOME/nvim/init.vim +lnsf $DIR/config/coc-settings.json $XDG_CONFIG_HOME/nvim/coc-settings.json lnsf $DIR/config/init.vim ~/.vimrc