summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-09-17 13:59:42 -0700
committerFranck Cuny <franck@fcuny.net>2022-09-17 13:59:42 -0700
commit2fbd75d91dc458da1323790386812dbd9553f2f4 (patch)
tree2381d59dc1dfcffc2c8ab8217757a912c8ebb422
parentfeat(lang/python): configure Emacs for python (diff)
downloademacs.d-2fbd75d91dc458da1323790386812dbd9553f2f4.tar.gz
feat(lsp): configure lsp-mode for Emacs
Despite all the hype around eglot, it's not working well enough for me.
I keep running into issues where the text is poorly formatted (I might
have more than one formatter running, so it could be my fault). It also
have to frequently reconnect to the server, which is really
annoying (and I did not use to have that problem with lsp-mode).

Change-Id: I5763487882599053adf9fd05c612422ad94edbe1
-rw-r--r--.gitignore1
-rw-r--r--emacs/custom/my-lsp.el27
-rw-r--r--emacs/init.el1
3 files changed, 29 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index fcc7770..be51923 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@
 /emacs/history
 /emacs/places
 /emacs/recentf
+/emacs/.lsp-session-v1
diff --git a/emacs/custom/my-lsp.el b/emacs/custom/my-lsp.el
new file mode 100644
index 0000000..0cb62bd
--- /dev/null
+++ b/emacs/custom/my-lsp.el
@@ -0,0 +1,27 @@
+;;; my-lsp.el --- Configures emacs for LSP -*- lexical-binding: t -*-
+;; Author: Franck Cuny <franck@fcuny.net>
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'lsp-mode)
+(require 'lsp-ui)
+
+(setq lsp-ui-doc-position 'at-point)
+(setq lsp-ui-peek-enable                t) ;; Enable `lsp-ui-peek'.
+(setq lsp-ui-peek-show-directory        t) ;; Show the directory of files.
+(setq lsp-ui-sideline-enable            t) ;; Enable `lsp-ui-sideline'.
+(setq lsp-ui-sideline-show-hover        t) ;; Show hover messages in sideline.
+(setq lsp-ui-sideline-show-code-actions t) ;; Show code actions in sideline.
+
+(setq lsp-completion-enable t) ;; Enable `completion-at-point' integration.
+
+(require 'lsp-diagnostics)
+(setq lsp-diagnostics-provider :flymake)
+
+(add-hook 'lsp-mode-hook #'lsp-ui-mode)
+
+(provide 'my-lsp)
+
+;;; my-lsp.el ends here
diff --git a/emacs/init.el b/emacs/init.el
index d23dc2d..2dcca81 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -50,6 +50,7 @@
 (require 'my-notmuch)
 (require 'my-elfeed)
 
+(require 'my-lsp)
 (require 'my-lang-python)
 
 (require 'my-buffers)