Update .emacs.d/config.org
This commit is contained in:
parent
6bb79a03d0
commit
8e83ef53da
1 changed files with 80 additions and 49 deletions
|
@ -24,6 +24,13 @@ Here, we're initializing MELPA, as well as package.el and use-package.
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** General config
|
** General config
|
||||||
|
*** no-littering
|
||||||
|
|
||||||
|
no-littering is a useful package that allows to put all of the autosave files and temporary files in one directory (the files ending with ~ for instance)
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package no-littering)
|
||||||
|
#+end_src
|
||||||
|
|
||||||
*** Minimal interface
|
*** Minimal interface
|
||||||
|
|
||||||
We disable a lot of interface elements, to make the editor more minimal looking.
|
We disable a lot of interface elements, to make the editor more minimal looking.
|
||||||
|
@ -108,55 +115,64 @@ I use doom-modeline as my modeline, as I find it really clean and minimal.
|
||||||
I use vertico as my completion framework. It's minimal, fast and tells me all I need to know and even sorts by history.
|
I use vertico as my completion framework. It's minimal, fast and tells me all I need to know and even sorts by history.
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package vertico
|
(use-package vertico
|
||||||
|
:init
|
||||||
|
(vertico-mode)
|
||||||
|
|
||||||
|
;; Different scroll margin
|
||||||
|
;; (setq vertico-scroll-margin 0)
|
||||||
|
|
||||||
|
;; Show more candidates
|
||||||
|
;; (setq vertico-count 20)
|
||||||
|
|
||||||
|
;; Grow and shrink the Vertico minibuffer
|
||||||
|
(setq vertico-resize t)
|
||||||
|
|
||||||
|
;; Optionally enable cycling for `vertico-next' and `vertico-previous'.
|
||||||
|
(setq vertico-cycle t)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; Persist history over Emacs restarts. Vertico sorts by history position.
|
||||||
|
(use-package savehist
|
||||||
|
:init
|
||||||
|
(savehist-mode))
|
||||||
|
|
||||||
|
;; A few more useful configurations...
|
||||||
|
(use-package emacs
|
||||||
|
:init
|
||||||
|
;; Add prompt indicator to `completing-read-multiple'.
|
||||||
|
;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
|
||||||
|
(defun crm-indicator (args)
|
||||||
|
(cons (format "[CRM%s] %s"
|
||||||
|
(replace-regexp-in-string
|
||||||
|
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
|
||||||
|
crm-separator)
|
||||||
|
(car args))
|
||||||
|
(cdr args)))
|
||||||
|
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
|
||||||
|
|
||||||
|
;; Do not allow the cursor in the minibuffer prompt
|
||||||
|
(setq minibuffer-prompt-properties
|
||||||
|
'(read-only t cursor-intangible t face minibuffer-prompt))
|
||||||
|
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
|
||||||
|
|
||||||
|
;; Support opening new minibuffers from inside existing minibuffers.
|
||||||
|
(setq enable-recursive-minibuffers t)
|
||||||
|
|
||||||
|
;; Emacs 28 and newer: Hide commands in M-x which do not work in the current
|
||||||
|
;; mode. Vertico commands are hidden in normal buffers. This setting is
|
||||||
|
;; useful beyond Vertico.
|
||||||
|
(setq read-extended-command-predicate #'command-completion-default-include-p))
|
||||||
|
|
||||||
|
;; Optionally use the `orderless' completion style.
|
||||||
|
(use-package orderless
|
||||||
:init
|
:init
|
||||||
(vertico-mode)
|
;; Configure a custom style dispatcher (see the Consult wiki)
|
||||||
|
;; (setq orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch)
|
||||||
;; Different scroll margin
|
;; orderless-component-separator #'orderless-escapable-split-on-space)
|
||||||
;; (setq vertico-scroll-margin 0)
|
(setq completion-styles '(orderless basic)
|
||||||
|
completion-category-defaults nil
|
||||||
;; Show more candidates
|
completion-category-overrides '((file (styles partial-completion)))))
|
||||||
;; (setq vertico-count 20)
|
|
||||||
|
|
||||||
;; Grow and shrink the Vertico minibuffer
|
|
||||||
(setq vertico-resize t)
|
|
||||||
|
|
||||||
;; Optionally enable cycling for `vertico-next' and `vertico-previous'.
|
|
||||||
(setq vertico-cycle t)
|
|
||||||
)
|
|
||||||
|
|
||||||
;; Persist history over Emacs restarts. Vertico sorts by history position.
|
|
||||||
(use-package savehist
|
|
||||||
:init
|
|
||||||
(savehist-mode))
|
|
||||||
|
|
||||||
;; A few more useful configurations...
|
|
||||||
(use-package emacs
|
|
||||||
:init
|
|
||||||
;; Add prompt indicator to `completing-read-multiple'.
|
|
||||||
;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
|
|
||||||
(defun crm-indicator (args)
|
|
||||||
(cons (format "[CRM%s] %s"
|
|
||||||
(replace-regexp-in-string
|
|
||||||
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
|
|
||||||
crm-separator)
|
|
||||||
(car args))
|
|
||||||
(cdr args)))
|
|
||||||
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
|
|
||||||
|
|
||||||
;; Do not allow the cursor in the minibuffer prompt
|
|
||||||
(setq minibuffer-prompt-properties
|
|
||||||
'(read-only t cursor-intangible t face minibuffer-prompt))
|
|
||||||
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
|
|
||||||
|
|
||||||
;; Support opening new minibuffers from inside existing minibuffers.
|
|
||||||
(setq enable-recursive-minibuffers t)
|
|
||||||
|
|
||||||
;; Emacs 28 and newer: Hide commands in M-x which do not work in the current
|
|
||||||
;; mode. Vertico commands are hidden in normal buffers. This setting is
|
|
||||||
;; useful beyond Vertico.
|
|
||||||
(setq read-extended-command-predicate #'command-completion-default-include-p))
|
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
*** which-key
|
*** which-key
|
||||||
|
|
||||||
|
@ -273,6 +289,14 @@ Magit is a git client in Emacs.
|
||||||
(setq rust-format-on-save t))
|
(setq rust-format-on-save t))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
**** Typst
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package typst-ts-mode
|
||||||
|
:quelpa (typst-ts-mode :fetcher git :url "https://git.sr.ht/~meow_king/typst-ts-mode" :files ("*.el"))
|
||||||
|
:custom
|
||||||
|
(typst-ts-mode-grammar-location (expand-file-name "tree-sitter/libtree-sitter-typst.so" user-emacs-directory)))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
**** tree-sitter
|
**** tree-sitter
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq treesit-language-source-alist
|
(setq treesit-language-source-alist
|
||||||
|
@ -290,11 +314,11 @@ Magit is a git client in Emacs.
|
||||||
(toml "https://github.com/tree-sitter/tree-sitter-toml")
|
(toml "https://github.com/tree-sitter/tree-sitter-toml")
|
||||||
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")
|
(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")
|
||||||
(typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
|
(typescript "https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")
|
||||||
|
(typst "https://github.com/uben0/tree-sitter-typst")
|
||||||
(yaml "https://github.com/ikatyang/tree-sitter-yaml")))
|
(yaml "https://github.com/ikatyang/tree-sitter-yaml")))
|
||||||
|
|
||||||
(add-to-list 'auto-mode-alist '("\\.ts\\'" . tsx-ts-mode))
|
(add-to-list 'auto-mode-alist '("\\.ts\\'" . tsx-ts-mode))
|
||||||
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode))
|
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode))
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
#+begin_src sh
|
#+begin_src sh
|
||||||
|
@ -313,3 +337,10 @@ Magit is a git client in Emacs.
|
||||||
'(npx "prettier" file)))
|
'(npx "prettier" file)))
|
||||||
(use-package dtrt-indent)
|
(use-package dtrt-indent)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
**** expand-region
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package expand-region
|
||||||
|
:bind ("C-=" . er/expand-region))
|
||||||
|
#+end_src
|
||||||
|
|
Loading…
Reference in a new issue