aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Rodrigues Lordello <[email protected]>2025-03-29 15:04:20 +0100
committerNicholas Rodrigues Lordello <[email protected]>2025-03-29 15:04:20 +0100
commitff13a64aa51e2101e381a4b27a89ac84e0b8176b (patch)
treeaf20a072a1afa325e78933938df1f6f05c70003e
parent47423e640f87f432895313b1e0b93110c7f138db (diff)
Keybind Eglot Format
Add a keybind (C-c M-q; as an analogy to M-q) to format the entire buffer. Note that we use `use-package` (for consistency, and I imaging that it just Does the Right Thing (TM) with respect to lazy loading) in order to configure the local keybindings. Also learned that we don't need to require the whole `use-package` and can instead just require `use-package-ensure` in order to configure the "always ensure" setting.
-rw-r--r--config/emacs/flavours/development.el10
-rw-r--r--config/emacs/sanemacs.el2
2 files changed, 11 insertions, 1 deletions
diff --git a/config/emacs/flavours/development.el b/config/emacs/flavours/development.el
index 0354b40..5d3ecb3 100644
--- a/config/emacs/flavours/development.el
+++ b/config/emacs/flavours/development.el
@@ -1,5 +1,15 @@
;;; -*- lexical-binding: t -*-
+;;;
+;;; General
+;;;
+
+(use-package eglot
+ :ensure nil
+ :bind
+ (:map eglot-mode-map
+ ("C-c M-q" . eglot-format-buffer)))
+
(use-package ligature
:hook
(prog-mode . ligature-mode)
diff --git a/config/emacs/sanemacs.el b/config/emacs/sanemacs.el
index 3f77fa7..2bc3a4d 100644
--- a/config/emacs/sanemacs.el
+++ b/config/emacs/sanemacs.el
@@ -39,7 +39,7 @@
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(setq package-archive-priorities '(("gnu" . 1) ("nongnu" . 1) ("melpa" . 0)))
-(require 'use-package)
+(require 'use-package-ensure)
(setq use-package-always-ensure t)
;; Install standard packages