From 8880cf355b6c0a8888f8a22ae00afeae00153f3c Mon Sep 17 00:00:00 2001 From: tracyone Date: Sun, 3 Dec 2017 20:47:47 +0800 Subject: [PATCH] zsh:support autocomplete 1. autotrigger in YCM and deoplete. 2. press ^x^o in other case --- autoload/SpaceVim/layers/lang/sh.vim | 13 +++++++++---- config/plugins_before/YouCompleteMe.vim | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/autoload/SpaceVim/layers/lang/sh.vim b/autoload/SpaceVim/layers/lang/sh.vim index db7bf155e..3fab71c25 100644 --- a/autoload/SpaceVim/layers/lang/sh.vim +++ b/autoload/SpaceVim/layers/lang/sh.vim @@ -1,7 +1,12 @@ -function! SpaceVim#layers#lang#javascript#plugins() abort - return [ - \ ['chrisbra/vim-zsh', { 'on_ft' : 'zsh' }] - \ ] +function! SpaceVim#layers#lang#sh#plugins() abort + let l:plugins = [] + call add(l:plugins, ['chrisbra/vim-zsh', { 'on_ft' : 'zsh' }]) + if get(g:, 'spacevim_enable_ycm') == 1 + call add(l:plugins, ['Valodim/vim-zsh-completion', { 'on_ft' : 'zsh' }]) + else + call add(l:plugins, ['zchee/deoplete-zsh', { 'on_ft' : 'zsh' }]) + endif + return l:plugins endfunction function! SpaceVim#layers#lang#sh#config() diff --git a/config/plugins_before/YouCompleteMe.vim b/config/plugins_before/YouCompleteMe.vim index 0835ed177..615861ddd 100644 --- a/config/plugins_before/YouCompleteMe.vim +++ b/config/plugins_before/YouCompleteMe.vim @@ -19,5 +19,6 @@ let g:ycm_semantic_triggers = { \ 'ruby' : ['.', '::'], \ 'lua' : ['.', ':'], \ 'erlang' : [':'], - \ 'sh' : ['re!\w{2}', '/', '-'], + \ 'sh' : ['re![\w-]{2}', '/', '-'], + \ 'zsh' : ['re![\w-]{2}', '/', '-'], \ }