关于company-dabbrev的一个的问题

看了子龙山人大大的第10个视频,有一个小问题

补全只能在注释里面生效。。但是 M-/是可以补全的。

配置

  (setq company-dabbrev-code-everywhere t)
  (setq company-dabbrev-minimum-length 2)
  (setq company-dabbrev-ignore-buffers "nil")

company-backends

Value: ((company-capf :with company-yasnippet)
 (company-dabbrev-code company-gtags company-etags company-keywords :with company-yasnippet)
 (company-files :with company-yasnippet)
 (company-dabbrev :with company-yasnippet))

Original value was 
(company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-files
              (company-dabbrev-code company-gtags company-etags company-keywords)
              company-oddmuse company-dabbrev)

Local in buffer test.el; global value is 
(php-extras-company company-bbdb company-nxml company-css company-eclim company-semantic company-clang company-xcode company-cmake company-capf company-files
                    (company-dabbrev-code company-gtags company-etags company-keywords)
                    company-oddmuse company-dabbrev)



今天尝试了重新安装 spacemacs,只安装 auto-completion,还是只能在注释中补全 dabbrev

1 个赞

与你的问题无关,但

搞错了吧?String 的 "nil" 应该没什么意义。

1 个赞

这里找到的,加了 company-dabbrev-ignore-buffers 之后可以在 scratch 里面用 dabbrev

噢,是没什么意义,但是把原来的正则表达式覆盖掉了

遇到同样的问题 ‘(company-dabbrev-ignore-buffers "\`\’") '(company-dabbrev-code-everywhere t) '(company-dabbrev-minimum-length 1) 都加上了 还是只能在;;后面补全

你可以看看当前提供补全的 backend 是什么,如果你希望用 company-dabbrev 来补全的话最好的做法就是,直接把当前的 company-backends 设置为 company-dabbrev,而不是用

((company-capf :with company-yasnippet)
 (company-dabbrev-code company-gtags company-etags company-keywords :with company-yasnippet)
 (company-files :with company-yasnippet)
 (company-dabbrev :with company-yasnippet))

我遇到类似的问题,请问你的问题解决了吗