Huge refactor and bugfixes
This commit is contained in:
parent
e1988f937a
commit
35de62d479
2 changed files with 485 additions and 890 deletions
365
guix/init.el
365
guix/init.el
|
|
@ -1,365 +0,0 @@
|
|||
(setq inhibit-startup-message t)
|
||||
|
||||
(menu-bar-mode -1)
|
||||
(tool-bar-mode -1)
|
||||
(scroll-bar-mode -1)
|
||||
|
||||
|
||||
(recentf-mode 1)
|
||||
(savehist-mode 1) ; remember previous commands in minibuffer
|
||||
(save-place-mode 1) ; put cursor in last place when opening a file
|
||||
|
||||
;; Avoid customization UI auto-variables in init.el
|
||||
(setq custom-file (locate-user-emacs-file "custom-vars.el"))
|
||||
(load custom-file 'noerror 'nomessage)
|
||||
|
||||
;; Don't show popup UI when prompting
|
||||
(setq use-dialog-box nil)
|
||||
|
||||
;; Update files when changed on disk
|
||||
(global-auto-revert-mode 1)
|
||||
|
||||
(set-frame-font "DejaVu Sans Mono 14")
|
||||
|
||||
;; Initialize Package Sources
|
||||
(require 'package)
|
||||
|
||||
(setq package-archives
|
||||
'(("melpa" . "https://melpa.org/packages/")
|
||||
("org" . "https://orgmode.org/elpa/")
|
||||
("elpa" . "https://elpa.gnu.org/packages/")))
|
||||
|
||||
(package-initialize)
|
||||
(unless package-archive-contents
|
||||
(package-refresh-contents))
|
||||
|
||||
;; Initialize use-package on non-linux platforms
|
||||
(unless (package-installed-p 'use-package)
|
||||
(package-install 'use-package))
|
||||
|
||||
(require 'use-package)
|
||||
(setq use-package-always-ensure t)
|
||||
|
||||
;; Persist history over Emacs restarts. Vertico sorts by history position.
|
||||
(use-package savehist
|
||||
:init
|
||||
(savehist-mode))
|
||||
;; Enable 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)
|
||||
)
|
||||
|
||||
;; 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)
|
||||
|
||||
;; Emacs 28: Hide commands in M-x which do not work in the current mode.
|
||||
;; Vertico commands are hidden in normal buffers.
|
||||
;; (setq read-extended-command-predicate
|
||||
;; #'command-completion-default-include-p)
|
||||
|
||||
;; Enable recursive minibuffers
|
||||
(setq enable-recursive-minibuffers t))
|
||||
|
||||
;; todo: evaluate this
|
||||
;; Optionally use the `orderless' completion style.
|
||||
(use-package orderless
|
||||
:init
|
||||
;; Configure a custom style dispatcher (see the Consult wiki)
|
||||
;; (setq orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch)
|
||||
;; orderless-component-separator #'orderless-escapable-split-on-space)
|
||||
(setq completion-styles '(orderless basic)
|
||||
completion-category-defaults nil
|
||||
completion-category-overrides '((file (styles partial-completion)))))
|
||||
|
||||
(setq completion-styles '(basic substring partial-completion flex))
|
||||
|
||||
;; Enable rich annotations using the Marginalia package
|
||||
(use-package marginalia
|
||||
;; Bind `marginalia-cycle' locally in the minibuffer. To make the binding
|
||||
;; available in the *Completions* buffer, add it to the
|
||||
;; `completion-list-mode-map'.
|
||||
:bind (:map minibuffer-local-map
|
||||
("M-A" . marginalia-cycle))
|
||||
|
||||
;; The :init section is always executed.
|
||||
:init
|
||||
|
||||
;; Marginalia must be activated in the :init section of use-package such that
|
||||
;; the mode gets enabled right away. Note that this forces loading the
|
||||
;; package.
|
||||
(marginalia-mode))
|
||||
(custom-set-variables
|
||||
;; custom-set-variables was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(package-selected-packages '(counsel ivy)))
|
||||
|
||||
(use-package simple-modeline
|
||||
:hook (after-init . simple-modeline-mode))
|
||||
|
||||
(use-package base16-theme)
|
||||
(load-theme 'base16-oceanicnext t)
|
||||
|
||||
(global-display-line-numbers-mode t)
|
||||
(dolist (mode
|
||||
'(org-mode-hook
|
||||
term-mode-hook
|
||||
eshell-mode-hook))
|
||||
(add-hook mode (lambda () (display-line-numbers-mode 0))))
|
||||
(column-number-mode)
|
||||
|
||||
(use-package rainbow-delimiters
|
||||
:hook (prog-mode . rainbow-delimiters-mode))
|
||||
|
||||
(use-package which-key
|
||||
:init (which-key-mode)
|
||||
:diminish which-key-mode
|
||||
:config(setq which-key-idle-delay 0.3))
|
||||
|
||||
(use-package helpful)
|
||||
;; Note that the built-in `describe-function' includes both functions
|
||||
;; and macros. `helpful-function' is functions only, so we provide
|
||||
;; `helpful-callable' as a drop-in replacement.
|
||||
(global-set-key (kbd "C-h f") #'helpful-callable)
|
||||
|
||||
(global-set-key (kbd "C-h v") #'helpful-variable)
|
||||
(global-set-key (kbd "C-h k") #'helpful-key)
|
||||
(global-set-key (kbd "C-h x") #'helpful-command)
|
||||
|
||||
;; Lookup the current symbol at point. C-c C-d is a common keybinding
|
||||
;; for this in lisp modes.
|
||||
(global-set-key (kbd "C-c C-d") #'helpful-at-point)
|
||||
|
||||
;; Look up *F*unctions (excludes macros).
|
||||
;;
|
||||
;; By default, C-h F is bound to `Info-goto-emacs-command-node'. Helpful
|
||||
;; already links to the manual, if a function is referenced there.
|
||||
(global-set-key (kbd "C-h F") #'helpful-function)
|
||||
|
||||
(defconst IS-MAC (eq system-type 'darwin))
|
||||
|
||||
(when IS-MAC
|
||||
;; mac specific settings
|
||||
)
|
||||
|
||||
;; General Emacs keybindings
|
||||
(which-key-add-key-based-replacements
|
||||
"C-x" "Ctrl-X-prefix"
|
||||
"C-c" "Ctrl-C-prefix"
|
||||
"C-h" "Help"
|
||||
"M-x" "M-x-commands"
|
||||
"C-x r" "Rectangles/Registers"
|
||||
"C-x 4" "Other-window"
|
||||
"C-x 5" "Frames"
|
||||
"C-x 8" "Unicode"
|
||||
"C-x @" "Event-modifiers"
|
||||
"C-x a" "Abbreviations"
|
||||
"C-x n" "Narrowing"
|
||||
"C-x g" "Magit-status"
|
||||
"C-c M-g" "Magit-file-dispatch"
|
||||
"C-x v" "Version-Control"
|
||||
"C-x X" "Font/Encoding"
|
||||
"C-x p" "Project/Buffer"
|
||||
"C-x t" "Tabs/Terminal"
|
||||
"C-x w" "Windows/Workspaces"
|
||||
"C-x x" "Text/Rectangle"
|
||||
"C-x C-a" "Emacs-Lisp-Debug"
|
||||
"C-x RET" "Coding-system")
|
||||
|
||||
;; Emacs major modes and related prefixes
|
||||
(which-key-add-key-based-replacements
|
||||
"C-c m" "Major-mode-cmds"
|
||||
"C-c p" "Projectile"
|
||||
"C-c g" "Magit"
|
||||
"C-c l" "Lisp"
|
||||
"C-c @" "HS-minor-mode"
|
||||
"C-c t" "Toggle"
|
||||
"C-c /" "Comment")
|
||||
|
||||
;; Org mode specific bindings
|
||||
(which-key-add-key-based-replacements
|
||||
"C-c C-x" "Org-mode-C-c-C-x"
|
||||
"C-c C-w" "Org-refile"
|
||||
"C-c [" "Org-agenda")
|
||||
|
||||
|
||||
(defun split-and-follow-horizontally ()
|
||||
(interactive)
|
||||
(split-window-below)
|
||||
(balance-windows)
|
||||
(other-window 1))
|
||||
|
||||
(defun split-and-follow-vertically ()
|
||||
(interactive)
|
||||
(split-window-right)
|
||||
(balance-windows)
|
||||
(other-window 1))
|
||||
|
||||
(global-set-key (kbd "s-c") 'delete-window)
|
||||
(global-set-key (kbd "s-h") 'windmove-left)
|
||||
(global-set-key (kbd "s-j") 'windmove-down)
|
||||
(global-set-key (kbd "s-k") 'windmove-up)
|
||||
(global-set-key (kbd "s-l") 'windmove-right)
|
||||
; (define-key evil-normal-state-map (kbd "s-d") 'kill-this-buffer)
|
||||
; (define-key evil-normal-state-map (kbd "s-n") 'projectile-next-project-buffer)
|
||||
; (define-key evil-normal-state-map (kbd "s-p") 'projectile-previous-project-buffer)
|
||||
; (define-key evil-normal-state-map (kbd "s-J") 'split-and-follow-horizontally)
|
||||
; (define-key evil-normal-state-map (kbd "s-L") 'split-and-follow-vertically)
|
||||
; (define-key evil-normal-state-map (kbd "s-b") 'buffer-menu)
|
||||
; (define-key evil-normal-state-map (kbd "s-x") 'execute-extended-command)
|
||||
(global-set-key (kbd "s-SPC") 'tab-next)
|
||||
|
||||
(use-package magit)
|
||||
(use-package treemacs)
|
||||
(use-package org)
|
||||
(use-package projectile)
|
||||
|
||||
(use-package lsp-mode
|
||||
:commands (lsp lsp-deferred)
|
||||
:init
|
||||
(setq lsp-keymap-prefix "C-c l")
|
||||
:config
|
||||
(lsp-enable-which-key-integration t))
|
||||
|
||||
(use-package lsp-ui)
|
||||
(use-package lsp-treemacs)
|
||||
;; todo
|
||||
|
||||
;; projectile
|
||||
;; deft
|
||||
;; roam
|
||||
;; ivy + fuzzzy +prescient?
|
||||
;; ivy-lsp
|
||||
;; hl-todo
|
||||
;; gitgutter
|
||||
;; perspective
|
||||
;; workspaces?
|
||||
;; paredit
|
||||
;; lispy
|
||||
;; persistent undo
|
||||
;; org : roam2, hugo, pretty, dragndrop, bullet
|
||||
;; dap-mode
|
||||
;; dabbrev-expand or company on c-n c-p
|
||||
;; c-N c-P for expand full line
|
||||
;; yasnippet
|
||||
;; tramp
|
||||
;; flesh out treemacs
|
||||
|
||||
|
||||
;; (setq deft-directory "~/notes/deft"
|
||||
;; deft-extensions '("org" "txt")
|
||||
;; deft-recursive t)
|
||||
|
||||
;; (setq org-roam-directory "~/notes/roam")
|
||||
|
||||
(setq projectile-project-search-path '("~/code/"))
|
||||
|
||||
;; (setq company-minimum-prefix-length 100)
|
||||
;; (map! :i "S-o" #'company-complete)
|
||||
|
||||
|
||||
|
||||
(setq tab-always-indent 'complete)
|
||||
(setq tab-first-completion 'word)
|
||||
|
||||
(use-package company
|
||||
:ensure t
|
||||
:hook (prog-mode . company-mode)
|
||||
:diminish
|
||||
:bind (:map company-active-map
|
||||
("<tab>" . company-select-next)
|
||||
("TAB" . company-select-next)
|
||||
("<backtab>" . company-select-previous)
|
||||
("<S-tab>" . company-select-previous))
|
||||
(:map lsp-mode-map ; more general mode than this?
|
||||
("<tab>" . company-indent-or-complete-common))
|
||||
:config
|
||||
(global-company-mode 1)
|
||||
:init
|
||||
(setq company-idle-delay nil))
|
||||
|
||||
(use-package rust-mode
|
||||
:ensure t
|
||||
:mode "\\.rs\\'"
|
||||
:config
|
||||
(setq rust-format-on-save t)) ; Automatically format rust files on save
|
||||
|
||||
(use-package cargo
|
||||
:ensure t
|
||||
:hook (rust-mode . cargo-minor-mode))
|
||||
|
||||
(use-package eshell)
|
||||
(use-package vterm)
|
||||
(use-package treemacs-projectile)
|
||||
;(use-package treemacs-nerd-icons
|
||||
; :config
|
||||
; (treemacs-load-theme "nerd-icons"))
|
||||
|
||||
(setq ring-bell-function 'ignore)
|
||||
(setq dired-listing-switches "-al")
|
||||
|
||||
(setq backup-directory-alist `(("." . "~/.config/emacs/backups/")))
|
||||
(setq auto-save-file-name-transforms
|
||||
`((".*" "~/.config/emacs/autosaves/" t)))
|
||||
|
||||
(setq dired-dwim-target t) ; opening 'other window' on a subdir enters 2 window dired mode for copy/paste
|
||||
(use-package dired-single)
|
||||
|
||||
(defun my-dired-init ()
|
||||
"Bunch of stuff to run for dired, either immediately or when it's
|
||||
loaded."
|
||||
;; <add other stuff here>
|
||||
(define-key dired-mode-map [remap dired-find-file]
|
||||
'dired-single-buffer)
|
||||
(define-key dired-mode-map [remap dired-mouse-find-file-other-window]
|
||||
'dired-single-buffer-mouse)
|
||||
(define-key dired-mode-map [remap dired-up-directory]
|
||||
'dired-single-up-directory))
|
||||
|
||||
;; if dired's already loaded, then the keymap will be bound
|
||||
(if (boundp 'dired-mode-map)
|
||||
;; we're good to go; just add our bindings
|
||||
(my-dired-init)
|
||||
;; it's not loaded yet, so add our bindings to the load-hook
|
||||
(add-hook 'dired-load-hook 'my-dired-init))
|
||||
|
||||
(use-package dired-open
|
||||
:config
|
||||
(setq dired-open-extensions '(("png" . "sxiv")
|
||||
("mkv" . "mpv")
|
||||
("avi" . "mpv"))))
|
||||
|
||||
(use-package all-the-icons-dired
|
||||
:hook (dired-mode . all-the-icons-dired-mode))
|
||||
|
||||
(use-package treemacs-all-the-icons)
|
||||
882
guix/init.org
882
guix/init.org
|
|
@ -1,7 +1,8 @@
|
|||
#+title Ian's Emacs Config
|
||||
#+PROPERTY: header-args:emacs-lisp :tangle ./init.el
|
||||
#+PROPERTY: header-args:emacs-lisp :tangle ~/.config/emacs/init.el
|
||||
|
||||
* Literate Config Setup
|
||||
* First things first
|
||||
** Literate Config Setup
|
||||
To get started, run =C-c C-v t=
|
||||
#+begin_src emacs-lisp
|
||||
(defun dotfiles/org-babel-tangle-config ()
|
||||
|
|
@ -12,58 +13,8 @@ To get started, run =C-c C-v t=
|
|||
|
||||
(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'dotfiles/org-babel-tangle-config)))
|
||||
#+end_src
|
||||
|
||||
#+RESULTS:
|
||||
| (lambda nil (add-hook 'after-save-hook #'dotfiles/org-babel-tangle-config)) | org-tempo-setup | #[0 \300\301\302\303\304$\207 [add-hook change-major-mode-hook org-fold-show-all append local] 5] | #[0 \300\301\302\303\304$\207 [add-hook change-major-mode-hook org-babel-show-result-all append local] 5] | org-babel-result-hide-spec | org-babel-hide-all-hashes | #[0 \301\211\207 [imenu-create-index-function org-imenu-get-tree] 2] | (lambda nil (display-line-numbers-mode 0)) |
|
||||
|
||||
* Global variables
|
||||
* Secrets
|
||||
** Package initialization
|
||||
#+begin_src emacs-lisp
|
||||
(use-package pinentry)
|
||||
(use-package pass)
|
||||
(use-package password-store)
|
||||
(pinentry-start)
|
||||
(setq gptel-api-key (password-store-get "self/openai-alt"))
|
||||
#+end_src
|
||||
* AI
|
||||
#+begin_src emacs-lisp
|
||||
(use-package gptel)
|
||||
(setq gptl-default-mode 'org-mode)
|
||||
#+end_src
|
||||
* Full Config
|
||||
I need to move this all over first before I do any organizing to make sure tangle works.
|
||||
#+begin_src emacs-lisp
|
||||
|
||||
(setq user-init-file (expand-file-name "~/dotfiles/guix/init.el"))
|
||||
|
||||
(defun reload-config ()
|
||||
"Reload the Emacs configuration."
|
||||
(interactive)
|
||||
(load-file user-init-file))
|
||||
|
||||
(setq inhibit-startup-message t)
|
||||
|
||||
(menu-bar-mode -1)
|
||||
(tool-bar-mode -1)
|
||||
(scroll-bar-mode -1)
|
||||
|
||||
|
||||
(recentf-mode 1)
|
||||
(savehist-mode 1) ; remember previous commands in minibuffer
|
||||
(save-place-mode 1) ; put cursor in last place when opening a file
|
||||
|
||||
;; Avoid customization UI auto-variables in init.el
|
||||
(setq custom-file (locate-user-emacs-file "custom-vars.el"))
|
||||
(load custom-file 'noerror 'nomessage)
|
||||
|
||||
;; Don't show popup UI when prompting
|
||||
(setq use-dialog-box nil)
|
||||
|
||||
;; Update files when changed on disk
|
||||
(global-auto-revert-mode 1)
|
||||
|
||||
(set-frame-font "DejaVu Sans Mono 14")
|
||||
|
||||
;; Initialize Package Sources
|
||||
(require 'package)
|
||||
|
||||
|
|
@ -71,7 +22,6 @@ I need to move this all over first before I do any organizing to make sure tangl
|
|||
'(("melpa" . "https://melpa.org/packages/")
|
||||
("org" . "https://orgmode.org/elpa/")
|
||||
("elpa" . "https://elpa.gnu.org/packages/")))
|
||||
|
||||
(package-initialize)
|
||||
(unless package-archive-contents
|
||||
(package-refresh-contents))
|
||||
|
|
@ -87,92 +37,129 @@ I need to move this all over first before I do any organizing to make sure tangl
|
|||
(use-package savehist
|
||||
:init
|
||||
(savehist-mode))
|
||||
;; Enable vertico
|
||||
(use-package vertico
|
||||
:init
|
||||
(vertico-mode)
|
||||
#+end_src
|
||||
** Secrets
|
||||
#+begin_src emacs-lisp
|
||||
(use-package pinentry)
|
||||
(use-package pass)
|
||||
(use-package password-store)
|
||||
(pinentry-start)
|
||||
(setq gptel-api-key (password-store-get "openai-alt")) ;; TODO if-macos
|
||||
#+end_src
|
||||
** Global variables
|
||||
** Handle config file
|
||||
#+begin_src emacs-lisp
|
||||
(setq user-init-file (expand-file-name "~/.config/emacs/init.el"))
|
||||
|
||||
;; Different scroll margin
|
||||
;; (setq vertico-scroll-margin 0)
|
||||
(defun reload-config ()
|
||||
"Reload the Emacs configuration."
|
||||
(interactive)
|
||||
(load-file user-init-file))
|
||||
#+end_src
|
||||
** Required directories for emacs setup
|
||||
#+begin_src emacs-lisp
|
||||
(defun ensure-directory (dir)
|
||||
"Ceate a dir if it doesn't exist."
|
||||
(unless (file-directory-p dir)
|
||||
(make-directory dir t)))
|
||||
|
||||
;; Show more candidates
|
||||
;; (setq vertico-count 20)
|
||||
(ensure-directory "~/.config/emacs/backups/")
|
||||
(ensure-directory "~/.config/emacs/autosaves")
|
||||
(ensure-directory "~/notes/roam")
|
||||
(ensure-directory "~/notes/deft")
|
||||
(ensure-directory "~/notes/code")
|
||||
|
||||
;; Grow and shrink the Vertico minibuffer
|
||||
;; (setq vertico-resize t)
|
||||
(setq deft-directory "~/notes/deft"
|
||||
org-roam-directory "~/notes/roam"
|
||||
projectile-project-search-path '("~/code/")
|
||||
backup-directory-alist `(("." . "~/.config/emacs/backups/"))
|
||||
auto-save-file-name-transforms `((".*" "~/.config/emacs/autosaves/" t)))
|
||||
|
||||
;; Optionally enable cycling for `vertico-next' and `vertico-previous'.
|
||||
;; (setq vertico-cycle t)
|
||||
)
|
||||
#+end_src
|
||||
** Helper Functions
|
||||
#+begin_src emacs-lisp
|
||||
(defun split-and-follow-horizontally ()
|
||||
(interactive)
|
||||
(split-window-below)
|
||||
(balance-windows)
|
||||
(other-window 1))
|
||||
|
||||
; For getting vertico history in shell buffer
|
||||
(use-package consult
|
||||
:bind (:map minibuffer-local-map ("C-r" . consult-history)))
|
||||
(defun split-and-follow-vertically ()
|
||||
(interactive)
|
||||
(split-window-right)
|
||||
(balance-windows)
|
||||
(other-window 1))
|
||||
|
||||
(defun custom/eval-region-or-buffer ()
|
||||
"Eval the region if anything is selected, otherwise eval the whole buffer."
|
||||
(interactive)
|
||||
(if mark-active
|
||||
(eval-region (region-beginning) (region-end))
|
||||
(eval-buffer)))
|
||||
|
||||
(defun custom/conditional-imenu ()
|
||||
"Call `consult-org-heading` in Org mode, otherwise `consult-imenu`."
|
||||
(interactive)
|
||||
(if (eq major-mode 'org-mode)
|
||||
(consult-org-heading)
|
||||
(consult-imenu)))
|
||||
|
||||
;; 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)
|
||||
#+end_src
|
||||
* One-Line Includes
|
||||
#+begin_src emacs-lisp
|
||||
(use-package treemacs)
|
||||
#+end_src
|
||||
* Notes
|
||||
|
||||
;; 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)
|
||||
#+begin_src emacs-lisp
|
||||
(use-package deft)
|
||||
(setq deft-recursive t
|
||||
deft-extensions '("org" "txt"))
|
||||
#+end_src
|
||||
* AI
|
||||
#+begin_src emacs-lisp
|
||||
(use-package gptel)
|
||||
(setq gptl-default-mode 'org-mode)
|
||||
#+end_src
|
||||
* Org Mode
|
||||
#+begin_src emacs-lisp
|
||||
(use-package org)
|
||||
|
||||
;; Emacs 28: Hide commands in M-x which do not work in the current mode.
|
||||
;; Vertico commands are hidden in normal buffers.
|
||||
;; (setq read-extended-command-predicate
|
||||
;; #'command-completion-default-include-p)
|
||||
; (add-hook 'org-mode-hook 'yas-minor-mode)
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-load-languages
|
||||
'((emacs-lisp . t)
|
||||
(python . t)))
|
||||
|
||||
;; Enable recursive minibuffers
|
||||
(setq enable-recursive-minibuffers t))
|
||||
(setq org-confirm-babel-evaluate nil)
|
||||
|
||||
;; todo: evaluate this
|
||||
;; Optionally use the `orderless' completion style.
|
||||
(use-package orderless
|
||||
:init
|
||||
;; Configure a custom style dispatcher (see the Consult wiki)
|
||||
;; (setq orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch)
|
||||
;; orderless-component-separator #'orderless-escapable-split-on-space)
|
||||
(setq completion-styles '(orderless basic)
|
||||
completion-category-defaults nil
|
||||
completion-category-overrides '((file (styles partial-completion)))))
|
||||
;; (use-package org-tempo)
|
||||
|
||||
(setq completion-styles '(basic substring partial-completion flex))
|
||||
(add-to-list 'org-structure-template-alist '("sh" . "src shell"))
|
||||
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
|
||||
(add-to-list 'org-structure-template-alist '("py" . "src python"))
|
||||
#+end_src
|
||||
* Basic Appearance and Behaviors
|
||||
#+begin_src emacs-lisp
|
||||
(setq inhibit-startup-message t)
|
||||
(menu-bar-mode -1)
|
||||
(tool-bar-mode -1)
|
||||
(scroll-bar-mode -1)
|
||||
(recentf-mode 1)
|
||||
(savehist-mode 1) ; remember previous commands in minibuffer
|
||||
(save-place-mode 1) ; put cursor in last place when opening a file
|
||||
|
||||
;; Enable rich annotations using the Marginalia package
|
||||
(use-package marginalia
|
||||
;; Bind `marginalia-cycle' locally in the minibuffer. To make the binding
|
||||
;; available in the *Completions* buffer, add it to the
|
||||
;; `completion-list-mode-map'.
|
||||
:bind (:map minibuffer-local-map
|
||||
("M-A" . marginalia-cycle))
|
||||
;; Avoid customization UI auto-variables in init.el
|
||||
(setq custom-file (locate-user-emacs-file "custom-vars.el"))
|
||||
(load custom-file 'noerror 'nomessage)
|
||||
|
||||
;; The :init section is always executed.
|
||||
:init
|
||||
;; Don't show popup UI when prompting
|
||||
(setq use-dialog-box nil)
|
||||
|
||||
;; Marginalia must be activated in the :init section of use-package such that
|
||||
;; the mode gets enabled right away. Note that this forces loading the
|
||||
;; package.
|
||||
(marginalia-mode))
|
||||
(custom-set-variables
|
||||
;; custom-set-variables was added by Custom.
|
||||
;; If you edit it by hand, you could mess it up, so be careful.
|
||||
;; Your init file should contain only one such instance.
|
||||
;; If there is more than one, they won't work right.
|
||||
'(package-selected-packages '(counsel ivy)))
|
||||
;; Update files when changed on disk
|
||||
(global-auto-revert-mode 1)
|
||||
|
||||
(set-frame-font "DejaVu Sans Mono 14")
|
||||
(use-package simple-modeline
|
||||
:hook (after-init . simple-modeline-mode))
|
||||
|
||||
|
|
@ -190,184 +177,32 @@ I need to move this all over first before I do any organizing to make sure tangl
|
|||
(use-package rainbow-delimiters
|
||||
:hook (prog-mode . rainbow-delimiters-mode))
|
||||
|
||||
(use-package which-key
|
||||
:init (which-key-mode)
|
||||
:diminish which-key-mode
|
||||
:config(setq which-key-idle-delay 0.3))
|
||||
|
||||
(use-package helpful)
|
||||
;; Note that the built-in `describe-function' includes both functions
|
||||
;; and macros. `helpful-function' is functions only, so we provide
|
||||
;; `helpful-callable' as a drop-in replacement.
|
||||
(global-set-key (kbd "C-h f") #'helpful-callable)
|
||||
|
||||
(global-set-key (kbd "C-h v") #'helpful-variable)
|
||||
(global-set-key (kbd "C-h k") #'helpful-key)
|
||||
(global-set-key (kbd "C-h x") #'helpful-command)
|
||||
|
||||
;; Lookup the current symbol at point. C-c C-d is a common keybinding
|
||||
;; for this in lisp modes.
|
||||
(global-set-key (kbd "C-c C-d") #'helpful-at-point)
|
||||
|
||||
;; Look up *F*unctions (excludes macros).
|
||||
;;
|
||||
;; By default, C-h F is bound to `Info-goto-emacs-command-node'. Helpful
|
||||
;; already links to the manual, if a function is referenced there.
|
||||
(global-set-key (kbd "C-h F") #'helpful-function)
|
||||
|
||||
(defconst IS-MAC (eq system-type 'darwin))
|
||||
|
||||
(when IS-MAC
|
||||
;; mac specific settings
|
||||
)
|
||||
|
||||
;; General Emacs keybindings
|
||||
(which-key-add-key-based-replacements
|
||||
"C-x" "Ctrl-X-prefix"
|
||||
"C-c" "Ctrl-C-prefix"
|
||||
"C-h" "Help"
|
||||
"M-x" "M-x-commands"
|
||||
"C-x r" "Rectangles/Registers"
|
||||
"C-x 4" "Other-window"
|
||||
"C-x 5" "Frames"
|
||||
"C-x 8" "Unicode"
|
||||
"C-x @" "Event-modifiers"
|
||||
"C-x a" "Abbreviations"
|
||||
"C-x n" "Narrowing"
|
||||
"C-x g" "Magit-status"
|
||||
"C-c M-g" "Magit-file-dispatch"
|
||||
"C-x v" "Version-Control"
|
||||
"C-x X" "Font/Encoding"
|
||||
"C-x p" "Project/Buffer"
|
||||
"C-x t" "Tabs/Terminal"
|
||||
"C-x w" "Windows/Workspaces"
|
||||
"C-x x" "Text/Rectangle"
|
||||
"C-x C-a" "Emacs-Lisp-Debug"
|
||||
"C-x RET" "Coding-system")
|
||||
|
||||
;; Emacs major modes and related prefixes
|
||||
(which-key-add-key-based-replacements
|
||||
"C-c m" "Major-mode-cmds"
|
||||
"C-c p" "Projectile"
|
||||
"C-c g" "Magit"
|
||||
"C-c l" "Lisp"
|
||||
"C-c @" "HS-minor-mode"
|
||||
"C-c t" "Toggle"
|
||||
"C-c /" "Comment")
|
||||
|
||||
;; Org mode specific bindings
|
||||
(which-key-add-key-based-replacements
|
||||
"C-c C-x" "Org-mode-C-c-C-x"
|
||||
"C-c C-w" "Org-refile"
|
||||
"C-c [" "Org-agenda")
|
||||
|
||||
|
||||
(defun split-and-follow-horizontally ()
|
||||
(interactive)
|
||||
(split-window-below)
|
||||
(balance-windows)
|
||||
(other-window 1))
|
||||
|
||||
(defun split-and-follow-vertically ()
|
||||
(interactive)
|
||||
(split-window-right)
|
||||
(balance-windows)
|
||||
(other-window 1))
|
||||
|
||||
(use-package helpful) ; Slightly more helpful help
|
||||
(setq tab-always-indent 'complete)
|
||||
(setq tab-first-completion 'word)
|
||||
#+end_src
|
||||
* Navigation
|
||||
** Windows
|
||||
#+begin_src emacs-lisp
|
||||
(global-set-key (kbd "s-c") 'delete-window)
|
||||
(global-set-key (kbd "s-h") 'windmove-left)
|
||||
(global-set-key (kbd "s-j") 'windmove-down)
|
||||
(global-set-key (kbd "s-k") 'windmove-up)
|
||||
(global-set-key (kbd "s-l") 'windmove-right)
|
||||
; (define-key evil-normal-state-map (kbd "s-d") 'kill-this-buffer)
|
||||
(define-key evil-normal-state-map (kbd "s-n") 'projectile-next-project-buffer)
|
||||
(define-key evil-normal-state-map (kbd "s-p") 'projectile-previous-project-buffer)
|
||||
; (define-key evil-normal-state-map (kbd "s-n") 'projectile-next-project-buffer)
|
||||
; (define-key evil-normal-state-map (kbd "s-p") 'projectile-previous-project-buffer)
|
||||
; (define-key evil-normal-state-map (kbd "s-J") 'split-and-follow-horizontally)
|
||||
; (define-key evil-normal-state-map (kbd "s-L") 'split-and-follow-vertically)
|
||||
; (define-key evil-normal-state-map (kbd "s-b") 'buffer-menu)
|
||||
; (define-key evil-normal-state-map (kbd "s-x") 'execute-extended-command)
|
||||
(global-set-key (kbd "s-SPC") 'tab-next)
|
||||
|
||||
(use-package magit)
|
||||
(use-package treemacs)
|
||||
(use-package org)
|
||||
(use-package projectile)
|
||||
|
||||
(use-package lsp-mode
|
||||
:commands (lsp lsp-deferred)
|
||||
:init
|
||||
(setq lsp-keymap-prefix "C-c l")
|
||||
:config
|
||||
(lsp-enable-which-key-integration t)
|
||||
:hook (terraform-mode . lsp-deferred)
|
||||
:hook (rust-mode . lsp-deferred))
|
||||
|
||||
(use-package lsp-ui)
|
||||
(use-package lsp-treemacs)
|
||||
(use-package flycheck
|
||||
:ensure t
|
||||
:init (global-flycheck-mode))
|
||||
|
||||
(use-package terraform-mode
|
||||
:ensure t)
|
||||
|
||||
|
||||
|
||||
;; (setq deft-directory "~/notes/deft"
|
||||
;; deft-extensions '("org" "txt")
|
||||
;; deft-recursive t)
|
||||
|
||||
;; (setq org-roam-directory "~/notes/roam")
|
||||
|
||||
(setq projectile-project-search-path '("~/code/"))
|
||||
|
||||
;; (setq company-minimum-prefix-length 100)
|
||||
;; (map! :i "S-o" #'company-complete)
|
||||
|
||||
|
||||
|
||||
(setq tab-always-indent 'complete)
|
||||
(setq tab-first-completion 'word)
|
||||
|
||||
(use-package company
|
||||
:ensure t
|
||||
:hook (prog-mode . company-mode)
|
||||
:diminish
|
||||
:bind (:map company-active-map
|
||||
("<tab>" . company-select-next)
|
||||
("TAB" . company-select-next)
|
||||
("<backtab>" . company-select-previous)
|
||||
("<S-tab>" . company-select-previous))
|
||||
(:map lsp-mode-map ; more general mode than this?
|
||||
("<tab>" . company-indent-or-complete-common))
|
||||
:config
|
||||
(global-company-mode 1)
|
||||
:init
|
||||
(setq company-idle-delay nil))
|
||||
|
||||
(use-package rust-mode
|
||||
:ensure t
|
||||
:mode "\\.rs\\'"
|
||||
:config
|
||||
(setq rust-format-on-save t)) ; Automatically format rust files on save
|
||||
|
||||
(use-package cargo
|
||||
:ensure t
|
||||
:hook (rust-mode . cargo-minor-mode))
|
||||
|
||||
(use-package eshell)
|
||||
(use-package vterm)
|
||||
(use-package treemacs-projectile)
|
||||
;(use-package treemacs-nerd-icons
|
||||
; :config
|
||||
; (treemacs-load-theme "nerd-icons"))
|
||||
|
||||
#+end_src
|
||||
** Dired
|
||||
#+begin_src emacs-lisp
|
||||
(setq ring-bell-function 'ignore)
|
||||
(setq dired-listing-switches "-al")
|
||||
|
||||
(setq backup-directory-alist `(("." . "~/.config/emacs/backups/")))
|
||||
(setq auto-save-file-name-transforms
|
||||
`((".*" "~/.config/emacs/autosaves/" t)))
|
||||
|
||||
(setq dired-dwim-target t) ; opening 'other window' on a subdir enters 2 window dired mode for copy/paste
|
||||
(use-package dired-single)
|
||||
|
|
@ -398,181 +233,20 @@ I need to move this all over first before I do any organizing to make sure tangl
|
|||
|
||||
(use-package all-the-icons-dired
|
||||
:hook (dired-mode . all-the-icons-dired-mode))
|
||||
|
||||
#+end_src
|
||||
** Treemacs
|
||||
#+begin_src emacs-lisp
|
||||
(use-package treemacs-all-the-icons)
|
||||
|
||||
(org-babel-do-load-languages
|
||||
'org-babel-load-languages
|
||||
'((emacs-lisp . t)
|
||||
(python . t)))
|
||||
|
||||
(setq org-confirm-babel-evaluate nil)
|
||||
|
||||
;; (use-package org-tempo)
|
||||
|
||||
(add-to-list 'org-structure-template-alist '("sh" . "src shell"))
|
||||
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
|
||||
(add-to-list 'org-structure-template-alist '("py" . "src python"))
|
||||
|
||||
(use-package embark-consult)
|
||||
#+end_src
|
||||
|
||||
* Meow
|
||||
** Which-key
|
||||
#+begin_src emacs-lisp
|
||||
; (use-package 'meow)
|
||||
; (defun meow-setup ()
|
||||
; (setq meow-cheatsheet-layout meow-cheatsheet-layout-colemak)
|
||||
; (meow-motion-overwrite-define-key
|
||||
; ;; Use e to move up, n to move down.
|
||||
; ;; Since special modes usually use n to move down, we only overwrite e here.
|
||||
; '("e" . meow-prev)
|
||||
; '("<escape>" . ignore))
|
||||
; (meow-leader-define-key
|
||||
; '("?" . meow-cheatsheet)
|
||||
; ;; To execute the originally e in MOTION state, use SPC e.
|
||||
; '("e" . "H-e")
|
||||
; '("1" . meow-digit-argument)
|
||||
; '("2" . meow-digit-argument)
|
||||
; '("3" . meow-digit-argument)
|
||||
; '("4" . meow-digit-argument)
|
||||
; '("5" . meow-digit-argument)
|
||||
; '("6" . meow-digit-argument)
|
||||
; '("7" . meow-digit-argument)
|
||||
; '("8" . meow-digit-argument)
|
||||
; '("9" . meow-digit-argument)
|
||||
; '("0" . meow-digit-argument))
|
||||
; (meow-normal-define-key
|
||||
; '("0" . meow-expand-0)
|
||||
; '("1" . meow-expand-1)
|
||||
; '("2" . meow-expand-2)
|
||||
; '("3" . meow-expand-3)
|
||||
; '("4" . meow-expand-4)
|
||||
; '("5" . meow-expand-5)
|
||||
; '("6" . meow-expand-6)
|
||||
; '("7" . meow-expand-7)
|
||||
; '("8" . meow-expand-8)
|
||||
; '("9" . meow-expand-9)
|
||||
; '("-" . negative-argument)
|
||||
; '(";" . meow-reverse)
|
||||
; '("," . meow-inner-of-thing)
|
||||
; '("." . meow-bounds-of-thing)
|
||||
; '("[" . meow-beginning-of-thing)
|
||||
; '("]" . meow-end-of-thing)
|
||||
; '("/" . meow-visit)
|
||||
; '("a" . meow-append)
|
||||
; '("A" . meow-open-below)
|
||||
; '("b" . meow-back-word)
|
||||
; '("B" . meow-back-symbol)
|
||||
; '("c" . meow-change)
|
||||
; '("d" . meow-delete)
|
||||
; '("e" . meow-prev)
|
||||
; '("E" . meow-prev-expand)
|
||||
; '("f" . meow-find)
|
||||
; '("g" . meow-cancel-selection)
|
||||
; '("G" . meow-grab)
|
||||
; '("m" . meow-left)
|
||||
; '("M" . meow-left-expand)
|
||||
; '("i" . meow-right)
|
||||
; '("I" . meow-right-expand)
|
||||
; '("j" . meow-join)
|
||||
; '("k" . meow-kill)
|
||||
; '("l" . meow-line)
|
||||
; '("L" . meow-goto-line)
|
||||
; '("h" . meow-mark-word)
|
||||
; '("H" . meow-mark-symbol)
|
||||
; '("n" . meow-next)
|
||||
; '("N" . meow-next-expand)
|
||||
; '("o" . meow-block)
|
||||
; '("O" . meow-to-block)
|
||||
; '("p" . meow-yank)
|
||||
; '("q" . meow-quit)
|
||||
; '("r" . meow-replace)
|
||||
; '("s" . meow-insert)
|
||||
; '("S" . meow-open-above)
|
||||
; '("t" . meow-till)
|
||||
; '("u" . meow-undo)
|
||||
; '("U" . meow-undo-in-selection)
|
||||
; '("v" . meow-search)
|
||||
; '("w" . meow-next-word)
|
||||
; '("W" . meow-next-symbol)
|
||||
; '("x" . meow-delete)
|
||||
; '("X" . meow-backward-delete)
|
||||
; '("y" . meow-save)
|
||||
; '("z" . meow-pop-selection)
|
||||
; '("'" . repeat)
|
||||
; '("<escape>" . ignore)))
|
||||
;
|
||||
; (require 'meow)
|
||||
; (meow-setup)
|
||||
; (meow-global-mode 1)
|
||||
#+end_src
|
||||
* Evil
|
||||
#+begin_src emacs-lisp
|
||||
;(unless (package-installed-p 'evil)
|
||||
; (package-install 'evil))
|
||||
; (evil-mode 1)
|
||||
; (setq evil-undo-system 'undo-tree)
|
||||
(use-package undo-tree
|
||||
:ensure t
|
||||
:after evil
|
||||
:diminish
|
||||
(use-package which-key
|
||||
:init (which-key-mode)
|
||||
:diminish which-key-mode
|
||||
:config
|
||||
(evil-set-undo-system 'undo-tree)
|
||||
(global-undo-tree-mode 1))
|
||||
(use-package evil
|
||||
:ensure t
|
||||
:config
|
||||
(evil-mode 1))
|
||||
(use-package evil-org
|
||||
:ensure t
|
||||
:after org
|
||||
:hook (org-mode . (lambda () evil-org-mode))
|
||||
:config
|
||||
(require 'evil-org-agenda)
|
||||
(evil-org-agenda-set-keys))
|
||||
(setq which-key-idle-delay 0.3))
|
||||
#+end_src
|
||||
* Custom command controls
|
||||
#+begin_src emacs-lisp
|
||||
(defun custom/eval-region-or-buffer ()
|
||||
"Eval the region if anything is selected, otherwise eval the whole buffer."
|
||||
(interactive)
|
||||
(if mark-active
|
||||
(eval-region (region-beginning) (region-end))
|
||||
(eval-buffer)))
|
||||
#+end_src
|
||||
* Mode-Specific Commands
|
||||
#+begin_src emacs-lisp
|
||||
(defun custom/conditional-imenu ()
|
||||
"Call `consult-org-heading` in Org mode, otherwise `consult-imenu`."
|
||||
(interactive)
|
||||
(if (eq major-mode 'org-mode)
|
||||
(consult-org-heading)
|
||||
(consult-imenu)))
|
||||
#+end_src
|
||||
* Web browsing and youtube
|
||||
#+begin_src emacs-lisp
|
||||
;; Using straight:
|
||||
;;(use-package empv
|
||||
;; :straight (:host github :repo "isamert/empv.el"))
|
||||
|
||||
(use-package empv)
|
||||
|
||||
(setq empv-radio-channels
|
||||
'(("SomaFM - Groove Salad" . "http://www.somafm.com/groovesalad.pls")
|
||||
("SomaFM - Drone Zone" . "http://www.somafm.com/dronezone.pls")
|
||||
("SomaFM - Sonic Universe" . "https://somafm.com/sonicuniverse.pls")
|
||||
("SomaFM - Metal" . "https://somafm.com/metal.pls")
|
||||
("SomaFM - Vaporwaves" . "https://somafm.com/vaporwaves.pls")
|
||||
("ADHD 1" . "https://www.youtube.com/watch?v=CmMrm4BpQHU")
|
||||
("WREK FM" . "http://streaming.wrek.org:8000/wrek_live-128kb.m3u")
|
||||
))
|
||||
;; Todo: lainchan? adhd music stream from youtube? wuog? wrekFM? does freeside have streaming radio?
|
||||
(with-eval-after-load 'embark (empv-embark-initialize-extra-actions))
|
||||
(add-to-list 'empv-mpv-args "--ytdl-format=best")
|
||||
(add-to-list 'empv-mpv-args "--save-position-on-quit")
|
||||
(add-hook 'empv-init-hook #'empv-override-quit-key)
|
||||
#+end_src
|
||||
* General
|
||||
** General
|
||||
#+begin_src emacs-lisp
|
||||
(use-package general
|
||||
:ensure t
|
||||
|
|
@ -805,6 +479,296 @@ I need to move this all over first before I do any organizing to make sure tangl
|
|||
|
||||
#+end_src
|
||||
|
||||
* Project management
|
||||
#+begin_src emacs-lisp
|
||||
(use-package projectile) ; todo config inside use-package
|
||||
(use-package treemacs-projectile)
|
||||
#+end_src
|
||||
* Autocomplete
|
||||
** Vertico
|
||||
#+begin_src emacs-lisp
|
||||
(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)
|
||||
)
|
||||
#+end_src
|
||||
** Consult
|
||||
#+begin_src emacs-lisp
|
||||
(use-package consult
|
||||
:bind (:map minibuffer-local-map ("C-r" . consult-history)))
|
||||
#+end_src
|
||||
** Generic completion
|
||||
Idk I think this came from the vertico readme
|
||||
#+begin_src emacs-lisp
|
||||
(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)
|
||||
|
||||
;; Emacs 28: Hide commands in M-x which do not work in the current mode.
|
||||
;; Vertico commands are hidden in normal buffers.
|
||||
;; (setq read-extended-command-predicate
|
||||
;; #'command-completion-default-include-p)
|
||||
|
||||
;; Enable recursive minibuffers
|
||||
(setq enable-recursive-minibuffers t))
|
||||
(setq completion-styles '(basic substring partial-completion flex))
|
||||
#+end_src
|
||||
** Orderless
|
||||
#+begin_src emacs-lisp
|
||||
(use-package orderless
|
||||
:init
|
||||
;; Configure a custom style dispatcher (see the Consult wiki)
|
||||
;; (setq orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch)
|
||||
;; orderless-component-separator #'orderless-escapable-split-on-space)
|
||||
(setq completion-styles '(orderless basic)
|
||||
completion-category-defaults nil
|
||||
completion-category-overrides '((file (styles partial-completion)))))
|
||||
#+end_src
|
||||
** Marginalia
|
||||
#+begin_src emacs-lisp
|
||||
(use-package marginalia
|
||||
;; Bind `marginalia-cycle' locally in the minibuffer. To make the binding
|
||||
;; available in the *Completions* buffer, add it to the
|
||||
;; `completion-list-mode-map'.
|
||||
:bind (:map minibuffer-local-map
|
||||
("M-A" . marginalia-cycle))
|
||||
|
||||
;; The :init section is always executed.
|
||||
:init
|
||||
|
||||
;; Marginalia must be activated in the :init section of use-package such that
|
||||
;; the mode gets enabled right away. Note that this forces loading the
|
||||
;; package.
|
||||
(marginalia-mode))
|
||||
#+end_src
|
||||
** Company-mode
|
||||
#+begin_src emacs-lisp
|
||||
(use-package company
|
||||
:ensure t
|
||||
:hook (prog-mode . company-mode)
|
||||
:diminish
|
||||
:bind (:map company-active-map
|
||||
("<tab>" . company-select-next)
|
||||
("TAB" . company-select-next)
|
||||
("<backtab>" . company-select-previous)
|
||||
("<S-tab>" . company-select-previous))
|
||||
(:map lsp-mode-map ; more general mode than this?
|
||||
("<tab>" . company-indent-or-complete-common))
|
||||
:config
|
||||
(global-company-mode 1)
|
||||
:init
|
||||
(setq company-idle-delay nil))
|
||||
#+end_src
|
||||
** Embark
|
||||
#+begin_src emacs-lisp
|
||||
(use-package embark-consult)
|
||||
#+end_src
|
||||
* Languages
|
||||
** LSP
|
||||
#+begin_src emacs-lisp
|
||||
(use-package lsp-mode
|
||||
:commands (lsp lsp-deferred)
|
||||
:init
|
||||
(setq lsp-keymap-prefix "C-c l")
|
||||
:config
|
||||
(lsp-enable-which-key-integration t)
|
||||
:hook (terraform-mode . lsp-deferred)
|
||||
:hook (rust-mode . lsp-deferred))
|
||||
|
||||
(use-package lsp-ui)
|
||||
(use-package lsp-treemacs)
|
||||
(use-package flycheck
|
||||
:ensure t
|
||||
:init (global-flycheck-mode))
|
||||
#+end_src
|
||||
** Rust
|
||||
#+begin_src emacs-lisp
|
||||
(use-package rust-mode
|
||||
:ensure t
|
||||
:mode "\\.rs\\'"
|
||||
:config
|
||||
(setq rust-format-on-save t)) ; Automatically format rust files on save
|
||||
|
||||
(use-package cargo
|
||||
:ensure t
|
||||
:hook (rust-mode . cargo-minor-mode))
|
||||
#+end_src
|
||||
** Terraform
|
||||
#+begin_src emacs-lisp
|
||||
(use-package terraform-mode
|
||||
:ensure t)
|
||||
#+end_src
|
||||
* Git
|
||||
#+begin_src emacs-lisp
|
||||
(use-package git-gutter+)
|
||||
(global-git-gutter+-mode t)
|
||||
(use-package magit)
|
||||
#+end_src
|
||||
* Meow
|
||||
#+begin_src emacs-lisp
|
||||
; (use-package 'meow)
|
||||
; (defun meow-setup ()
|
||||
; (setq meow-cheatsheet-layout meow-cheatsheet-layout-colemak)
|
||||
; (meow-motion-overwrite-define-key
|
||||
; ;; Use e to move up, n to move down.
|
||||
; ;; Since special modes usually use n to move down, we only overwrite e here.
|
||||
; '("e" . meow-prev)
|
||||
; '("<escape>" . ignore))
|
||||
; (meow-leader-define-key
|
||||
; '("?" . meow-cheatsheet)
|
||||
; ;; To execute the originally e in MOTION state, use SPC e.
|
||||
; '("e" . "H-e")
|
||||
; '("1" . meow-digit-argument)
|
||||
; '("2" . meow-digit-argument)
|
||||
; '("3" . meow-digit-argument)
|
||||
; '("4" . meow-digit-argument)
|
||||
; '("5" . meow-digit-argument)
|
||||
; '("6" . meow-digit-argument)
|
||||
; '("7" . meow-digit-argument)
|
||||
; '("8" . meow-digit-argument)
|
||||
; '("9" . meow-digit-argument)
|
||||
; '("0" . meow-digit-argument))
|
||||
; (meow-normal-define-key
|
||||
; '("0" . meow-expand-0)
|
||||
; '("1" . meow-expand-1)
|
||||
; '("2" . meow-expand-2)
|
||||
; '("3" . meow-expand-3)
|
||||
; '("4" . meow-expand-4)
|
||||
; '("5" . meow-expand-5)
|
||||
; '("6" . meow-expand-6)
|
||||
; '("7" . meow-expand-7)
|
||||
; '("8" . meow-expand-8)
|
||||
; '("9" . meow-expand-9)
|
||||
; '("-" . negative-argument)
|
||||
; '(";" . meow-reverse)
|
||||
; '("," . meow-inner-of-thing)
|
||||
; '("." . meow-bounds-of-thing)
|
||||
; '("[" . meow-beginning-of-thing)
|
||||
; '("]" . meow-end-of-thing)
|
||||
; '("/" . meow-visit)
|
||||
; '("a" . meow-append)
|
||||
; '("A" . meow-open-below)
|
||||
; '("b" . meow-back-word)
|
||||
; '("B" . meow-back-symbol)
|
||||
; '("c" . meow-change)
|
||||
; '("d" . meow-delete)
|
||||
; '("e" . meow-prev)
|
||||
; '("E" . meow-prev-expand)
|
||||
; '("f" . meow-find)
|
||||
; '("g" . meow-cancel-selection)
|
||||
; '("G" . meow-grab)
|
||||
; '("m" . meow-left)
|
||||
; '("M" . meow-left-expand)
|
||||
; '("i" . meow-right)
|
||||
; '("I" . meow-right-expand)
|
||||
; '("j" . meow-join)
|
||||
; '("k" . meow-kill)
|
||||
; '("l" . meow-line)
|
||||
; '("L" . meow-goto-line)
|
||||
; '("h" . meow-mark-word)
|
||||
; '("H" . meow-mark-symbol)
|
||||
; '("n" . meow-next)
|
||||
; '("N" . meow-next-expand)
|
||||
; '("o" . meow-block)
|
||||
; '("O" . meow-to-block)
|
||||
; '("p" . meow-yank)
|
||||
; '("q" . meow-quit)
|
||||
; '("r" . meow-replace)
|
||||
; '("s" . meow-insert)
|
||||
; '("S" . meow-open-above)
|
||||
; '("t" . meow-till)
|
||||
; '("u" . meow-undo)
|
||||
; '("U" . meow-undo-in-selection)
|
||||
; '("v" . meow-search)
|
||||
; '("w" . meow-next-word)
|
||||
; '("W" . meow-next-symbol)
|
||||
; '("x" . meow-delete)
|
||||
; '("X" . meow-backward-delete)
|
||||
; '("y" . meow-save)
|
||||
; '("z" . meow-pop-selection)
|
||||
; '("'" . repeat)
|
||||
; '("<escape>" . ignore)))
|
||||
;
|
||||
; (require 'meow)
|
||||
; (meow-setup)
|
||||
; (meow-global-mode 1)
|
||||
#+end_src
|
||||
* Evil
|
||||
#+begin_src emacs-lisp
|
||||
(use-package evil
|
||||
:ensure t
|
||||
:config
|
||||
(evil-mode 1))
|
||||
(use-package undo-tree
|
||||
:ensure t
|
||||
:after evil
|
||||
:diminish
|
||||
:config
|
||||
(evil-set-undo-system 'undo-tree)
|
||||
(global-undo-tree-mode 1))
|
||||
(use-package evil-org
|
||||
:ensure t
|
||||
:after org
|
||||
:hook (org-mode . (lambda () evil-org-mode))
|
||||
; :config
|
||||
; (require 'evil-org-agenda)
|
||||
; (evil-org-agenda-set-keys)
|
||||
)
|
||||
(use-package evil-collection
|
||||
:after evil
|
||||
:ensure t
|
||||
:config
|
||||
(evil-collection-init))
|
||||
#+end_src
|
||||
* Web browsing and youtube
|
||||
#+begin_src emacs-lisp
|
||||
;; Using straight:
|
||||
;;(use-package empv
|
||||
;; :straight (:host github :repo "isamert/empv.el"))
|
||||
|
||||
(use-package empv)
|
||||
|
||||
(setq empv-radio-channels
|
||||
'(("SomaFM - Groove Salad" . "http://www.somafm.com/groovesalad.pls")
|
||||
("SomaFM - Drone Zone" . "http://www.somafm.com/dronezone.pls")
|
||||
("SomaFM - Sonic Universe" . "https://somafm.com/sonicuniverse.pls")
|
||||
("SomaFM - Metal" . "https://somafm.com/metal.pls")
|
||||
("SomaFM - Vaporwaves" . "https://somafm.com/vaporwaves.pls")
|
||||
("ADHD 1" . "https://www.youtube.com/watch?v=CmMrm4BpQHU")
|
||||
("WREK FM" . "http://streaming.wrek.org:8000/wrek_live-128kb.m3u")
|
||||
))
|
||||
;; Todo: lainchan? adhd music stream from youtube? wuog? wrekFM? does freeside have streaming radio?
|
||||
(with-eval-after-load 'embark (empv-embark-initialize-extra-actions))
|
||||
(add-to-list 'empv-mpv-args "--ytdl-format=best")
|
||||
(add-to-list 'empv-mpv-args "--save-position-on-quit")
|
||||
(add-hook 'empv-init-hook #'empv-override-quit-key)
|
||||
#+end_src
|
||||
* Todo
|
||||
** General
|
||||
- Refactor to use use-package more effectively
|
||||
|
|
@ -831,7 +795,6 @@ I need to move this all over first before I do any organizing to make sure tangl
|
|||
|
||||
** One-offs
|
||||
- hl-todo
|
||||
- gitgutter
|
||||
- persistent undo
|
||||
- commentary
|
||||
- highlight tabs and newlines
|
||||
|
|
@ -903,16 +866,13 @@ variables and their documentations).
|
|||
- docker
|
||||
- terraform
|
||||
- straight?
|
||||
- eaf-browser
|
||||
- embark?
|
||||
- emms, emms-play-url binding (youtube view)
|
||||
- [[https://youtu.be/UtqE-lR2HCA?t=5134][consult-lsp]] (better for errors than treemacs integrations probably)
|
||||
- workspaces / persp mode
|
||||
- srht.el
|
||||
- orderless
|
||||
- affe
|
||||
- gnus
|
||||
- evil-org
|
||||
|
||||
** Appearance switches
|
||||
- fonts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue