;;; init.el --- Personal Emacs configuration -*- lexical-binding: t; -*- (require 'use-package) (use-package emacs :hook (text-mode . visual-line-mode) :config (menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) (global-display-line-numbers-mode 1) (keymap-global-set "C-w" #'backward-kill-word) :custom (completion-styles '(basic partial-completion flex)) (tab-always-indent 'complete) (text-mode-ispell-word-completion nil) (read-extended-command-predicate #'command-completion-default-include-p) (scroll-margin 8) (scroll-conservatively 101) (display-line-numbers-type 'relative)) (defun my-docs-at-point () (interactive) (if (derived-mode-p 'emacs-lisp-mode) (helpful-at-point) (eldoc-doc-buffer t))) (use-package helix :ensure nil :demand t :config (helix-define-key 'normal (kbd "C-c") nil) ; Let the global keymap take precedence (helix-define-key 'insert (kbd "C-w") nil) ; Buffer menu binding overrides (helix-define-key 'normal "d" #'Buffer-menu-delete 'Buffer-menu-mode) (helix-define-key 'normal "x" #'Buffer-menu-execute 'Buffer-menu-mode) (helix-define-key 'normal "u" #'Buffer-menu-unmark 'Buffer-menu-mode) (helix-define-key 'normal "J" (lambda () (interactive) (delete-indentation 1))) (helix-define-key 'space "k" #'my-docs-at-point) (unless helix-global-mode (helix-mode))) (use-package vertico :ensure nil :demand t :config (vertico-mode 1)) (use-package corfu :ensure nil :demand t :custom (corfu-auto t) (corfu-auto-prefix 2) (corfu-preselect 'prompt) (corfu-preview-current 'insert) :config (global-corfu-mode 1) :bind (:map corfu-map ("TAB" . corfu-next) ("" . corfu-previous) ("" . corfu-quit))) (use-package which-key :ensure nil :config (which-key-mode 1)) (use-package marginalia :ensure nil :bind (:map minibuffer-local-map ("M-A" . marginalia-cycle)) :config (marginalia-mode 1)) (use-package consult :ensure nil :init (define-prefix-command 'my-search-map) (keymap-global-set "C-s" #'my-search-map) (setq xref-show-xrefs-function #'consult-xref xref-show-definitions-function #'consult-xref) :bind (:map my-search-map ("b" . consult-buffer) ("l" . consult-line) ("g" . consult-goto-line) ("r" . consult-ripgrep) ("f" . consult-fd) ("h" . consult-org-heading))) (use-package helpful :ensure nil :bind (("C-h f" . helpful-callable) ("C-h v" . helpful-variable) ("C-h k" . helpful-key) ("C-h x" . helpful-command))) (use-package org :ensure nil :defer t :custom (org-src-fontify-natively t) (org-auto-align-tags nil) (org-tags-column 0) (org-catch-invisible-edits 'show-and-error) (org-special-ctrl-a/e t) (org-insert-heading-respect-content t) (org-hide-emphasis-markers t) (org-pretty-entities t) (org-ellipsis "…") :hook (org-mode . (lambda () (display-line-numbers-mode -1))) (org-mode . org-indent-mode)) (use-package org-modern :ensure nil :custom (org-modern-star 'replace) :config (set-face-attribute 'org-modern-symbol nil :family "Iosevka") :hook (org-mode . org-modern-mode)) (use-package org-appear :ensure nil :custom (org-appear-autolinks t) (org-appear-autoentities t) (org-appear-autosubmarkers t) :hook (org-mode . org-appear-mode)) (use-package olivetti :ensure nil :custom (olivetti-body-width 96) :hook (org-mode . olivetti-mode)) (use-package ghostel :ensure nil :commands ghostel) (use-package eglot :ensure nil :commands eglot-ensure :hook (typst-ts-mode . (lambda () (when (executable-find "tinymist") (eglot-ensure)))) :config (add-to-list 'eglot-server-programs '(typst-ts-mode . ("tinymist")))) (use-package typst-ts-mode :ensure nil :mode "\\.typ\\'") (use-package markdown-mode :ensure nil :after eglot :demand t) (use-package jinx :ensure nil :hook ((org-mode . jinx-mode) (typst-ts-mode . jinx-mode)) :bind (("M-$" . jinx-correct)) :custom (jinx-languages "en_GB") :config (setf (alist-get 'typst-ts-mode jinx-exclude-faces) '(typst-ts-markup-reference-face typst-ts-markup-label-face typst-ts-markup-url-face typst-ts-markup-rawspan-blob-face typst-ts-markup-rawblock-blob-face typst-ts-markup-rawblock-lang-face font-lock-function-call-face font-lock-variable-name-face font-lock-variable-use-face font-lock-keyword-face font-lock-constant-face )))