summaryrefslogtreecommitdiff
path: root/tw
diff options
context:
space:
mode:
authorTimo Wilken2023-10-30 23:38:47 +0100
committerTimo Wilken2023-10-30 23:38:47 +0100
commita6896676ea0d4f969629597eeee518003c02e883 (patch)
treee80fce4c4871e12cb5c31e6ff442ad5c81965b7e /tw
parenteca49ccec53882720d3d20172b2c35c315a7ebeb (diff)
Solve old Emacs todos, enable pixel-scroll-precision-mode
Diffstat (limited to 'tw')
-rw-r--r--tw/home/files/emacs-init.el9
1 files changed, 4 insertions, 5 deletions
diff --git a/tw/home/files/emacs-init.el b/tw/home/files/emacs-init.el
index 0e8d2049..9fecfab7 100644
--- a/tw/home/files/emacs-init.el
+++ b/tw/home/files/emacs-init.el
@@ -6,8 +6,6 @@
(expand-file-name "emacs/eln" (or (getenv "XDG_CACHE_HOME") "~/.cache/")))
(add-hook 'after-init-hook #'native-compile-prune-cache)
-;; TODO: try new `pixel-scroll-precision-mode'
-
;; Load settings set through Custom.
;; (setq custom-file (locate-user-emacs-file "custom.el"))
;; (when (file-readable-p custom-file)
@@ -42,6 +40,7 @@ If CREATE is true and the resulting directory does not exist, create it."
(max-mini-window-height 3 "Let the echo area grow to a maximum of 3 lines, e.g. when using `eldoc-mode'.")
(scroll-up-aggressively 0.0 "Don't recenter the window if the point moves off the page.")
(scroll-down-aggressively 0.0 "Don't recenter the window if the point moves off the page.")
+ (pixel-scroll-precision-mode t "Enable pixel-by-pixel scrolling, e.g. to handle inline images.")
;; Niceties.
(tramp-default-method "scpx" "ssh and scp hang forever. scpx is faster than sshx for large files.")
(global-hl-line-mode t "Highlight the current line in all buffers.")
@@ -297,7 +296,6 @@ If CREATE is true and the resulting directory does not exist, create it."
("<leader>ev" . flymake-running-backends)
("<leader>eV" . flymake-disabled-backends))
:custom
- ;; TODO: what does `flymake-mode-line-lighter' do?
(flymake-suppress-zero-counters nil "Show severity counters even when they are zero."))
(use-package flymake-collection
@@ -311,18 +309,19 @@ If CREATE is true and the resulting directory does not exist, create it."
;; Language Server Protocol.
(defun tw/help-is-eldoc (&rest _)
"Set up `evil-lookup-func' to display the `eldoc' buffer."
- (setq-local evil-lookup-func #'eldoc-doc-buffer))
+ (when (eglot-managed-p)
+ (setq-local evil-lookup-func #'eldoc-doc-buffer)))
(use-package eglot
;; I have clang (for clangd) and python-lsp-server installed.
;; `:hook' adds `-mode' to the package name, but `eglot-mode' doesn't exist.
:hook ((python-mode python-ts-mode c-mode c++-mode c-or-c++-ts-mode) . eglot-ensure)
:commands (eglot)
+ :functions (eglot-managed-p)
:custom
(eglot-autoshutdown t "Shut down language servers after deleting their last associated buffer.")
(eglot-sync-connect 0.1 "Wait for the language server in the background if it takes longer than 100ms.")
:config
- ;; TODO: only run `tw/help-is-eldoc' if `eglot-managed-p' is true.
(add-hook 'eglot-managed-mode-hook #'tw/help-is-eldoc))
;; Tree-sitter