-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit-lsp-bridge.el
66 lines (56 loc) · 2 KB
/
init-lsp-bridge.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
;; -*- lexical-binding: t -*-
(use-package lsp-bridge
:ensure nil
:straight (lsp-bridge :type git :host github :repo "manateelazycat/lsp-bridge"
:files ("*" (:exclude ".git" "test")))
:init
;; TODO a new face to inherit markdown mode
(setq acm-enable-tabnine nil
;; TODO acm-enable-codeium
acm-enable-yas nil
;; TODO acm-enable-citre
lsp-bridge-enable-completion-in-string t
acm-candidate-match-function 'orderless-flex
acm-enable-quick-access t ; select candidate with number key
acm-quick-access-use-number-select t
lsp-bridge-enable-signature-help nil
lsp-bridge-signature-show-function 'lsp-bridge-signature-show-with-frame
lsp-bridge-signature-show-with-frame-position "top-left"
lsp-bridge-enable-hover-diagnostic t)
:demand t
:config
(global-lsp-bridge-mode)
(evil-set-initial-state 'lsp-bridge-ref-mode 'emacs)
(jester/with-minor-leader 'lsp-bridge-mode
"d" 'lsp-bridge-popup-documentation)
(general-define-key
:states '(insert emacs)
"<tab>" 'jester/start-complete-or-yas)
(general-define-key
:states '(insert emacs)
:definer 'minor-mode
:keymaps 'acm-mode
"TAB" nil
"<tab>" 'jester/do-complete-or-yas
"<C-m>" 'acm-insert-common
"RET" 'newline
"<return>" 'newline)
(dotimes (i 10)
(general-define-key
:keymaps 'acm-mode-map
(format "M-%d" i) (eval `(lambda! (insert ,(number-to-string i)))))))
;; https://emacs.stackexchange.com/a/7925/12854
(defun jester/do-complete-or-yas ()
"`yas-expand' or complete the symbol."
(interactive)
(when (or (not yas-minor-mode)
(null (jester/yas-expand-no-prompt)))
(call-interactively 'acm-complete)))
(defun jester/start-complete-or-yas ()
(interactive)
(when (or (not yas-minor-mode)
(null (jester/yas-expand-no-prompt)))
(lsp-bridge-popup-complete-menu)))
(use-package orderless
:autoload (orderless-initialism orderless-flex))
(provide 'init-lsp-bridge)