jayli / vim-easycomplete

杭州市余杭区最好用的 VIM/NVIM 代码补全插件
MIT License
404 stars 26 forks source link

可以增加一个禁用字典补全的开关吗? #297

Closed seflerZ closed 2 months ago

seflerZ commented 2 months ago

目前我是通过修改代码实现的,可能比较 hack。

index fccf990..2752133 100644
--- a/autoload/easycomplete/sources/buf.vim
+++ b/autoload/easycomplete/sources/buf.vim
@@ -77,7 +77,13 @@ function! s:GetBufKeywordsList(typing)
   if !exists("g:easycomplete_bufkw_storage")
     let g:easycomplete_bufkw_storage = {}
   endif
+
+  if exists("g:easycomplete_disable_buf")
+       return []
+  endif
+
   let tmpkeywords = []
   " preform: 0.022s
   for buf in getbufinfo()
     if !empty(getbufvar(buf['bufnr'], '&buftype'))
seflerZ commented 2 months ago

看了下代码,另外还可以设置这个变量,只禁用字典,当前文档分词还会提示:let b:easycomplete_global_dict = []。

seflerZ commented 2 months ago

先这样吧。