Makes company speaks yasnippet

This commit is contained in:
2023-09-30 13:15:35 +02:00
parent fa9286e318
commit 7cf57b9ab8

27
.emacs
View File

@@ -10,11 +10,6 @@
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(c-basic-offset 4)
'(c-default-style
'((c++-mode . "tuleu-c++")
(java-mode . "java")
(awk-mode . "awk")
(other . "gnu")))
'(company-idle-delay 20.0)
'(compilation-scroll-output 'first-error)
'(custom-safe-themes
@@ -230,7 +225,20 @@
:delight
:bind ( ("M-TAB" . company-complete) )
:config
(global-company-mode t)
(defun atu/company-prog-mode ()
"Starts yas company and set up backends accordingly"
(yas-minor-mode)
(company-mode)
(setq-local company-backends
'(
(company-yasnippet company-capf)
company-files
company-keywords
)
)
)
:hook
(prog-mode . atu/company-prog-mode)
)
(use-package cmake-mode
@@ -281,15 +289,14 @@
(use-package yasnippet
:delight yas-minor-mode
:config
(yas-global-mode)
:after (company)
:bind ( :map yas-minor-mode-map
("TAB" . nil)
)
)
(use-package yasnippet-snippets
:after (yasnippet)
:after yasnippet
)
(use-package projectile
@@ -348,7 +355,6 @@
(setq lsp-keymap-prefix "C-c l")
:bind-keymap ("C-c l" . lsp-command-map)
:config
(yas-minor-mode)
(if (display-graphic-p)
(setq lsp-ui-doc-use-webkit t)
)
@@ -360,6 +366,7 @@
)
)
)
(setq lsp-completion-provider :none)
:bind (
("C-c C-d" . lsp-ui-doc-toggle)
)