more packages

This commit is contained in:
2024-03-08 16:49:14 +01:00
parent bb59d3f808
commit 8c7cf1b5f6

152
.emacs
View File

@ -1,3 +1,16 @@
(add-to-list
'package-archives
'("stable" . "https://stable.melpa.org/packages/") t)
(add-to-list
'package-archives
'("melpa" . "https://melpa.org/packages/") t)
(customize-set-variable
'package-archive-priorities
'(("gnu" . 99) ; prefer GNU packages
("nongnu" . 80) ; use non-gnu packages if not found in GNU elpa
("stable" . 70) ; prefer "released" versions from melpa
("melpa" . 1))) ; if all else fails, get it from melpa
(use-package emacs (use-package emacs
:ensure nil :ensure nil
:custom :custom
@ -6,7 +19,9 @@
(elixir "https://github.com/elixir-lang/tree-sitter-elixir"))) (elixir "https://github.com/elixir-lang/tree-sitter-elixir")))
(major-mode-remap-alist (major-mode-remap-alist
'((elixir-mode . elixir-ts-mode)))) '((elixir-mode . elixir-ts-mode)))
:config
(global-prettify-symbols-mode))
(use-package eglot (use-package eglot
:ensure nil :ensure nil
@ -53,32 +68,123 @@
:ensure nil :ensure nil
:hook ((prog-mode . rainbow-delimiters-mode))) :hook ((prog-mode . rainbow-delimiters-mode)))
(use-package projectile (use-package helpful :ensure t
:ensure t :bind
:bind-keymap ("s-p" . projectile-command-map) ("C-h f" . helpful-callable)
("C-h v" . helpful-variable)
("C-h k" . helpful-key)
("C-h F" . helpful-function)
("C-h C" . helpful-command))
(use-package which-key :ensure t :config (which-key-mode))
(defun corfu-enable-in-minibuffer ()
"Enable Corfu in the minibuffer if `completion-at-point' is bound."
(when (where-is-internal #'completion-at-point (list (current-local-map)))
;; (setq-local corfu-auto nil) ;; Enable/disable auto completion
(setq-local
corfu-echo-delay nil ;; Disable automatic echo and (point)opup
corfu-popupinfo-delay nil)
(corfu-mode 1)))
(use-package corfu :ensure t
:bind
(:map
corfu-map
("<escape>" . corfu-quit)
("<return>" . corfu-insert)
("M-n" . corfu-popupinfo-scroll-up)
("M-p" . corfu-popupinfo-scroll-down))
:custom
;; Works with `indent-for-tab-command'. Make sure tab doesn't indent when you
;; want to perform completion
(tab-always-indent 'complete) (corfu-auto nil) (corfu-auto-prefix 2) (corfu-auto-delay 0.25)
(corfu-preview-current 'insert) (corfu-preselect-first t)
:init (global-corfu-mode) (corfu-popupinfo-mode) (corfu-echo-mode)
:hook (minibuffer-setup . corfu-enable-in-minibuffer))
(use-package cape :ensure t
;; Bind dedicated completion commands
;; Alternative prefix keys: C-c p, M-p, M-+, ...
:bind
(("M-/" . completion-at-point) ;; capf
("C-c p t" . complete-tag) ;; etags
("C-c p d" . cape-dabbrev) ;; or dabbrev-completion
("C-c p h" . cape-history)
("C-c p f" . cape-file)
("C-c p k" . cape-keyword)
("C-c p s" . cape-symbol)
("C-c p a" . cape-abbrev)
("C-c p i" . cape-ispell)
("C-c p l" . cape-line)
("C-c p w" . cape-dict)
("C-c p \\" . cape-tex)
("C-c p _" . cape-tex)
("C-c p ^" . cape-tex)
("C-c p &" . cape-sgml)
("C-c p r" . cape-rfc1345))
:init :init
(setq projectile-mode-line-function '(lambda () (format " [%s]" (projectile-project-name)))) ;; Add `completion-at-point-functions', used by `completion-at-point'.
:config (add-to-list 'completion-at-point-functions #'cape-file)
(projectile-mode +1)) (add-to-list 'completion-at-point-functions #'cape-dabbrev)
(add-to-list 'completion-at-point-functions #'cape-ispell)
(advice-add 'eglot-completion-at-point :around #'cape-wrap-buster))
(use-package company ;; Enable vertico
:ensure t (use-package vertico :ensure t :init (vertico-mode))
:delight company-mode
:demand t (use-package consult :ensure t
:bind
( ;; C-c bindings (mode-specific-map)
("C-x b" . consult-buffer) ;; orig. switch-to-buffer
("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer
("s-b" . consult-project-buffer) ;; orig. project-switch-to-buffer
;; Other custom bindings
("M-y" . consult-yank-pop) ;; orig. yank-pop
("M-g f" . consult-flymake) ;; Alternative: consult-flycheck
("M-g g" . consult-goto-line) ;; orig. goto-line
("M-g i" . consult-imenu)
("M-g I" . consult-imenu-multi)
;; M-s bindings (search-map)
("M-s d" . consult-find)
("M-s D" . consult-locate)
("M-s g" . consult-grep)
("M-s G" . consult-git-grep)
("M-s r" . consult-ripgrep)
("M-s l" . consult-line)
("C-s" . consult-line)
("M-s L" . consult-line-multi)
("M-s m" . consult-multi-occur)
("M-s u" . consult-focus-lines)
:map
isearch-mode-map
("M-e" . consult-isearch-history) ;; orig. isearch-edit-string
("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string
("M-s l" . consult-line) ;; needed by consult-line to detect isearch
("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch
;; Minibuffer history
:map
minibuffer-local-map
("M-s" . consult-history) ;; orig. next-matching-history-element
("M-r" . consult-history)) ;; orig. previous-matching-history-element
:hook (completion-list-mode . consult-preview-at-point-mode))
;; Optionally use the `orderless' completion style.
(use-package orderless :ensure t
:init :init
(setq company-idle-delay 0.1 (setq
company-minimum-prefix-length 1) completion-styles '(orderless basic)
:bind (:map company-active-map completion-category-defaults nil
("C-n" . company-select-next) completion-category-overrides '((file (styles partial-completion)))))
("C-p". company-select-previous))
:config
(global-company-mode))
(use-package paredit ;; Persist history over Emacs restarts. Vertico sorts by history position.
:ensure t) (use-package savehist :ensure t :init (savehist-mode))
(add-to-list 'package-archives (use-package multiple-cursors :ensure t
'("melpa" . "https://melpa.org/packages/") t) :bind ("C->" . 'mc/mark-next-like-this) ("C-<" . 'mc/mark-previous-like-this))
(use-package magit :ensure t)
(custom-set-variables (custom-set-variables
;; custom-set-variables was added by Custom. ;; custom-set-variables was added by Custom.
@ -89,7 +195,7 @@
'(inhibit-startup-screen t) '(inhibit-startup-screen t)
'(initial-scratch-message nil) '(initial-scratch-message nil)
'(package-selected-packages '(package-selected-packages
'(company projectile rainbow-delimiters exec-path-from-shell elixir-mode elixir-ts-mode paredit par-edit use-package org)) '(magit elixir-yasnippets consult-yasnippet rainbow-delimiters exec-path-from-shell elixir-mode elixir-ts-mode paredit par-edit org))
'(scroll-bar-mode nil) '(scroll-bar-mode nil)
'(tool-bar-mode nil)) '(tool-bar-mode nil))
(custom-set-faces (custom-set-faces