(use-package corfu
:init
(progn
(setq corfu-auto t)
(setq corfu-cycle t)
(setq corfu-quit-at-boundary t)
(setq corfu-quit-no-match t)
(setq corfu-preview-current nil)
(setq corfu-min-width 80)
(setq corfu-max-width 100)
(setq corfu-auto-delay 0.2)
(setq corfu-auto-prefix 1)
(setq corfu-on-exact-match nil)
(global-corfu-mode)
))
(use-package treesit-auto
:demand t
:config
(setq treesit-auto-install 'prompt)
(global-treesit-auto-mode))
(setq treesit-font-lock-level 4)
不是,就是用corfu补全,这方法试过了不行
看一下 completion-at-point-functions
这个变量
completion-at-point-functions is a variable defined in ‘minibuffer.el’.
Its value is (python-completion-at-point t)
Local in buffer te.py; global value is
(tags-completion-at-point-function)
禁用treesit-auto或者python-ts-mode就没问题了吗?
如果你是说在你第一个截图里输入t之后没有弹出,感觉也挺正常啊,这时corfu可能都还没有可供补全用的候选项。
1 个赞
;;seting python
(setenv "IPY_TEST_SIMPLE_PROMPT" "1")
(setq elpy-rpc-python-command "python")
;; For interactive shell
(setq python-shell-interpreter "ipython"
python-shell-interpreter-args "-i --simple-prompt")
;;start elpy
(setq elpy-rpc-virtualenv-path 'current)
(elpy-enable)
;;yapf to format python code
(add-hook 'python-mode-hook 'yapf-mode)
;;py-autopep8
(require 'py-autopep8)
;; (add-hook 'python-mode-hook 'py-autopep8-on-save-p)
;; (add-hook 'elpy-mode-hook 'py-autopep8-on-save-p)
(add-hook 'python-mode-hook 'py-autopep8-mode)
(setq py-autopep8-options '("--max-line-length=100"))
这是我在python配置使用了elpy后,corfu会有补全窗口弹出,这里应该corfu是作为一个前端,而elpy作为一个提供补全后端接口。如果使用treesit-auto后要选用另外一种后端补全。
那你这不就自己解答了自己的问题了吗?corfu不能补全跟你装了treesit-auto没有直接的关系。