yasnippets 候选人不会出现在公司自动完成中。
虽然我可以从SPC s i
看到它们,并且很好地消耗它们。
describe-variable
对company backends
的结果如下图所示
当我输入ifm
,自动完成应该为我显示ifmain
候选。
点击展开
- OS: darwin (x86_64-apple-darwin14.5.0)
- Emacs: 26.1 (May 31, 2018)
- Doom: 2.0.9 (develop cdf745e72a3e8bf9bef1f0fa4d051b00aab351e3)
- Graphic display: nil (daemon: nil)
- System features: NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS
- Details:
```elisp
elc count: 0
uname -a: Darwin machw 18.0.0 Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64 i386 MacBookPro10,1 Darwin
modules: (:feature (evil +everywhere) file-templates (lookup +docsets) snippets spellcheck (syntax-checker +childframe) workspaces :completion (helm +fuzzy) :ui doom-dashboard doom-modeline doom-quit evil-goggles fci hl-todo nav-flash treemacs (popup +all +defaults) unicode vc-gutter vi-tilde-fringe window-select :editor rotate-text :emacs ediff electric hideshow imenu vc :tools magit :lang emacs-lisp markdown (org +attach +babel +capture +export +present) python rust (sh +fish) :config)
packages: n/a
exec-path: (/usr/local/opt/coreutils/libexec/gnubin /usr/local/opt/python/libexec/bin /usr/local/bin /usr/local/sbin /usr/bin /bin /usr/sbin /sbin ~/.cargo/bin ~/bin /usr/local/opt/fzf/bin /Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_10 /Applications/Emacs.app/Contents/MacOS/libexec-x86_64-10_10 /Applications/Emacs.app/Contents/MacOS/libexec /Applications/Emacs.app/Contents/MacOS/bin)
```
这是可以预料的。 公司将只使用company-anaconda
。 (:separate company-capf company-yasnippet)
是后备,以防 anaconda 失败。
您可以通过C-x C-s
或通过更改python的后端访问代码段完成:
(set-company-backend! 'anaconda-mode '(company-anaconda company-yasnippet))
这会将公司后端更改为:
((company-anaconda company-yasnippet)
(:separate company-capf company-yasnippet)
company-capf)
在python模式下。
仅适用于新缓冲区,现有缓冲区不受影响。
你能帮忙吗?
查了doom的代码,发现公司后台修改了这里: https :
要默认启用company-yasnippet
,以下代码有效。
(after! anaconda-mode
(set-company-backend! 'anaconda-mode '(company-anaconda company-yasnippet)))
最有用的评论
查了doom的代码,发现公司后台修改了这里: https :
要默认启用
company-yasnippet
,以下代码有效。