Skip to content

Commit

Permalink
replace lsp-mode with eglot in anticipation of emacs 29
Browse files Browse the repository at this point in the history
- also fix unsorted inactive packages
  • Loading branch information
PalaceChan authored and PalaceChan committed Nov 4, 2022
1 parent 9a64d5d commit a071c24
Showing 1 changed file with 105 additions and 90 deletions.
195 changes: 105 additions & 90 deletions config.org
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,21 @@ Use ~M-w~ and modifiers to more efficiently save things to kill ring
(global-set-key [remap kill-ring-save] #'easy-kill)
(global-set-key [remap mark-sexp] #'easy-mark))
#+END_SRC
** eglot
[[https://github.com/joaotavora/eglot][homepage]]

#+begin_src emacs-lisp
(use-package eglot
:ensure t
:commands eglot
:bind (:map eglot-mode-map ("C-h ." . eldoc))
:custom
(eglot-events-buffer-size 0)
(eglot-extend-to-xref t))
;; :config
;; (add-to-list 'eglot-server-programs
;; '((c++-mode c-mode) "/custom/path/to/bin/clangd"))
#+end_src
** elisp
use =paredit= in lisp modes ([[http://danmidwood.com/content/2014/11/21/animated-paredit.html][animated paredit guide]])
#+BEGIN_SRC emacs-lisp
Expand Down Expand Up @@ -1108,88 +1123,6 @@ remap =term-previous-matching-input= to a helm frontend
:bind ("C-x C-b" . ibuffer)
:config (define-key ibuffer-mode-map (kbd "M-o") nil))
#+END_SRC
** lsp
Some references here:
[[https://github.com/MaskRay/ccls/wiki/lsp-mode][ccls + lsp]]
[[https://github.com/rememberYou/.emacs.d/blob/master/config.org#lsp][example A]]
[[https://github.com/MatthewZMD/.emacs.d#org75e3a83][example B]] and [[https://github.com/MatthewZMD/.emacs.d#orga4fa68f][B2]]
[[http://ivanmalison.github.io/dotfiles/#languageserverprotocollsp][example C]]
[[https://github.com/jimeh/.emacs.d/blob/master/modules/lsp/siren-lsp.el][goodies]]
[[https://github.com/waymondo/hemacs/blob/master/init.el][lsp-ui goodies]]
[[https://github.com/novoid/dot-emacs/blob/master/config.org][lsp-ui more goodies]]
[[https://emacs-lsp.github.io/lsp-mode/tutorials/how-to-turn-off/][how-to-turn-off]]
[[http://blog.binchen.org/posts/how-to-speed-up-lsp-mode/][example D]]

Only use lsp with flycheck
(rather than hook, manual enable via ==M-x lsp==)
#+BEGIN_SRC emacs-lisp
(use-package lsp-mode
:ensure t
:after flycheck
:commands lsp
:bind
(:map lsp-mode-map
([remap xref-find-references] . lsp-find-references)
([remap xref-find-definitions] . lsp-find-definition))
:custom
(lsp-keymap-prefix "C-c u")
(lsp-auto-configure t)
(lsp-eldoc-hook nil)
(lsp-eldoc-enable-hover t)
(lsp-diagnostics-provider :none)
(lsp-enable-symbol-highlighting nil)
(lsp-headerline-breadcrumb-enable nil)
(lsp-lens-enable t)
(lsp-modeline-code-actions-enable t)
(lsp-modeline-diagnostics-enable nil)
(lsp-signature-render-documentation t)
(lsp-completion-show-kind t)
(lsp-completion-show-detail t)
(lsp-enable-file-watchers t)
(lsp-file-watch-threshold nil)
(lsp-enable-xref t)
(lsp-enable-imenu t)
(lsp-enable-folding nil)
(lsp-enable-links nil)
(read-process-output-max (* 1024 1024))
;:config
;(define-key lsp-mode-map (kbd "C-c u") 'lsp-describe-thing-at-point)
)
#+END_SRC

#+BEGIN_SRC emacs-lisp
(use-package lsp-ui
:ensure t
:after lsp-mode flycheck
:diminish
:commands lsp-ui-mode
:bind
(:map lsp-ui-mode-map
;("C-c u" . lsp-ui-imenu)
;("C-c C-d" . lsp-ui-doc-glance)
("C-c d" . lsp-ui-doc-show)
("M-i" . lsp-ui-doc-focus-frame))
:custom
(lsp-ui-peek-enable t)
(lsp-ui-doc-enable t)
(lsp-ui-doc-alignment 'window)
(lsp-ui-doc-header t)
(lsp-ui-doc-max-height 45)
(lsp-ui-doc-position 'at-point)
(lsp-ui-doc-show-with-mouse nil)
(lsp-ui-doc-show-with-cursor nil)
(lsp-ui-doc-include-signature t)
(lsp-ui-doc-border (face-foreground 'default))
(lsp-ui-sideline-enable t)
(lsp-ui-sideline-ignore-duplicate t)
(lsp-ui-sideline-show-code-actions nil)
(lsp-ui-sideline-show-diagnostics nil)
(lsp-ui-sideline-show-hover nil))

;(use-package company-lsp
; :ensure t
; :custom (company-lsp-cache-candidates 'auto))
#+END_SRC
** magit
#+BEGIN_SRC emacs-lisp
(use-package magit
Expand Down Expand Up @@ -1709,14 +1642,6 @@ nice directory level diffing
("j" . ztree-jump-side)))
#+END_SRC
* inactive packages
** dmenu
to launch applications from exwm (not in use)
#+BEGIN_SRC emacs-lisp
;;(use-package dmenu
;; :ensure t
;; :bind
;; ("s-SPC" . dmenu))
#+END_SRC
** clojure
#+BEGIN_SRC emacs-lisp
; (use-package clojure-mode
Expand Down Expand Up @@ -1757,6 +1682,14 @@ to launch applications from exwm (not in use)
; )
; (cider-repl-toggle-pretty-printing))
#+END_SRC
** dmenu
to launch applications from exwm (not in use)
#+BEGIN_SRC emacs-lisp
;;(use-package dmenu
;; :ensure t
;; :bind
;; ("s-SPC" . dmenu))
#+END_SRC
** eaf
Disabled as not snappy enough
[[https://aur.archlinux.org/packages/emacs-eaf/][emacs-eaf AUR]]
Expand Down Expand Up @@ -1895,6 +1828,88 @@ on MELPA from here [[https://github.com/kaiwk/leetcode][leetcode]]
; (setq leetcode-prefer-language "cpp")
; (setq leetcode-prefer-sql "mysql"))
#+END_SRC
** lsp
Some references here:
[[https://github.com/MaskRay/ccls/wiki/lsp-mode][ccls + lsp]]
[[https://github.com/rememberYou/.emacs.d/blob/master/config.org#lsp][example A]]
[[https://github.com/MatthewZMD/.emacs.d#org75e3a83][example B]] and [[https://github.com/MatthewZMD/.emacs.d#orga4fa68f][B2]]
[[http://ivanmalison.github.io/dotfiles/#languageserverprotocollsp][example C]]
[[https://github.com/jimeh/.emacs.d/blob/master/modules/lsp/siren-lsp.el][goodies]]
[[https://github.com/waymondo/hemacs/blob/master/init.el][lsp-ui goodies]]
[[https://github.com/novoid/dot-emacs/blob/master/config.org][lsp-ui more goodies]]
[[https://emacs-lsp.github.io/lsp-mode/tutorials/how-to-turn-off/][how-to-turn-off]]
[[http://blog.binchen.org/posts/how-to-speed-up-lsp-mode/][example D]]

Only use lsp with flycheck
(rather than hook, manual enable via ==M-x lsp==)
#+BEGIN_SRC emacs-lisp
(use-package lsp-mode
:ensure t
:after flycheck
:commands lsp
:bind
(:map lsp-mode-map
([remap xref-find-references] . lsp-find-references)
([remap xref-find-definitions] . lsp-find-definition))
:custom
(lsp-keymap-prefix "C-c u")
(lsp-auto-configure t)
(lsp-eldoc-hook nil)
(lsp-eldoc-enable-hover t)
(lsp-diagnostics-provider :none)
(lsp-enable-symbol-highlighting nil)
(lsp-headerline-breadcrumb-enable nil)
(lsp-lens-enable t)
(lsp-modeline-code-actions-enable t)
(lsp-modeline-diagnostics-enable nil)
(lsp-signature-render-documentation t)
(lsp-completion-show-kind t)
(lsp-completion-show-detail t)
(lsp-enable-file-watchers t)
(lsp-file-watch-threshold nil)
(lsp-enable-xref t)
(lsp-enable-imenu t)
(lsp-enable-folding nil)
(lsp-enable-links nil)
(read-process-output-max (* 1024 1024))
;:config
;(define-key lsp-mode-map (kbd "C-c u") 'lsp-describe-thing-at-point)
)
#+END_SRC

#+BEGIN_SRC emacs-lisp
(use-package lsp-ui
:ensure t
:after lsp-mode flycheck
:diminish
:commands lsp-ui-mode
:bind
(:map lsp-ui-mode-map
;("C-c u" . lsp-ui-imenu)
;("C-c C-d" . lsp-ui-doc-glance)
("C-c d" . lsp-ui-doc-show)
("M-i" . lsp-ui-doc-focus-frame))
:custom
(lsp-ui-peek-enable t)
(lsp-ui-doc-enable t)
(lsp-ui-doc-alignment 'window)
(lsp-ui-doc-header t)
(lsp-ui-doc-max-height 45)
(lsp-ui-doc-position 'at-point)
(lsp-ui-doc-show-with-mouse nil)
(lsp-ui-doc-show-with-cursor nil)
(lsp-ui-doc-include-signature t)
(lsp-ui-doc-border (face-foreground 'default))
(lsp-ui-sideline-enable t)
(lsp-ui-sideline-ignore-duplicate t)
(lsp-ui-sideline-show-code-actions nil)
(lsp-ui-sideline-show-diagnostics nil)
(lsp-ui-sideline-show-hover nil))

;(use-package company-lsp
; :ensure t
; :custom (company-lsp-cache-candidates 'auto))
#+END_SRC
** mu4e
The smtp portion will require app specific password and will store it in ~/.authinfo after first use
#+BEGIN_SRC emacs-lisp
Expand Down

0 comments on commit a071c24

Please sign in to comment.