Emacs config changes from the last few days
This commit is contained in:
parent
1fae9f1514
commit
0db94f8ba4
1 changed files with 242 additions and 129 deletions
371
guix/init.org
371
guix/init.org
|
|
@ -1,5 +1,20 @@
|
||||||
#+title Ian's Emacs Config
|
#+title Ian's Emacs Config
|
||||||
#+PROPERTY: header-args:emacs-lisp :tangle (if (eq system-type 'darwin) "~/dotfiles/guix/init.el" "~/.config/emacs/init.el")
|
#+PROPERTY: header-args:emacs-lisp :tangle (if (eq system-type 'darwin) "~/dotfiles/guix/init.el" "~/.config/emacs/init.el")
|
||||||
|
#+EXPORT_FILE_NAME: ~/code/website/src/content/dotfiles/emacs.md
|
||||||
|
|
||||||
|
#+begin_src
|
||||||
|
+++
|
||||||
|
title = "Emacs Configuration"
|
||||||
|
author = ["Ian Keane"]
|
||||||
|
date = 2023-02-09
|
||||||
|
tags = ["Config", "Text editing"]
|
||||||
|
description = 'My emacs configuration.'
|
||||||
|
+++
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
|
||||||
|
* Preamble
|
||||||
|
My emacs configuration. It tangles to =.emacs.d/init.el= and exports to this markdown file on save. If you're viewing this in a repo, it's better to visit the website at <https://iankeane.srht.site/dotfiles>. If you are viewing this on the website and want the repo, you can find it at <https://sr.ht/~iankeane/dotfiles>. To see the hugo front-matter configuration, you'll have to view the raw code.
|
||||||
|
|
||||||
* First things first
|
* First things first
|
||||||
** Literate Config Setup
|
** Literate Config Setup
|
||||||
|
|
@ -10,7 +25,7 @@ To get started, run =C-c C-v t=
|
||||||
(expand-file-name "~/dotfiles/guix/init.org"))
|
(expand-file-name "~/dotfiles/guix/init.org"))
|
||||||
(let ((org-confirm-babel-evaluate nil))
|
(let ((org-confirm-babel-evaluate nil))
|
||||||
(org-babel-tangle))))
|
(org-babel-tangle))))
|
||||||
|
|
||||||
(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'dotfiles/org-babel-tangle-config)))
|
(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'dotfiles/org-babel-tangle-config)))
|
||||||
#+end_src
|
#+end_src
|
||||||
** Package initialization
|
** Package initialization
|
||||||
|
|
@ -20,8 +35,8 @@ To get started, run =C-c C-v t=
|
||||||
|
|
||||||
(setq package-archives
|
(setq package-archives
|
||||||
'(("melpa" . "https://melpa.org/packages/")
|
'(("melpa" . "https://melpa.org/packages/")
|
||||||
("org" . "https://orgmode.org/elpa/")
|
("org" . "https://orgmode.org/elpa/")
|
||||||
("elpa" . "https://elpa.gnu.org/packages/")))
|
("elpa" . "https://elpa.gnu.org/packages/")))
|
||||||
(package-initialize)
|
(package-initialize)
|
||||||
|
|
||||||
;; Initialize use-package on non-linux platforms
|
;; Initialize use-package on non-linux platforms
|
||||||
|
|
@ -37,6 +52,26 @@ To get started, run =C-c C-v t=
|
||||||
:init
|
:init
|
||||||
(savehist-mode))
|
(savehist-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
** Straight
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defvar bootstrap-version)
|
||||||
|
(let ((bootstrap-file
|
||||||
|
(expand-file-name
|
||||||
|
"straight/repos/straight.el/bootstrap.el"
|
||||||
|
(or (bound-and-true-p straight-base-dir)
|
||||||
|
user-emacs-directory)))
|
||||||
|
(bootstrap-version 7))
|
||||||
|
(unless (file-exists-p bootstrap-file)
|
||||||
|
(with-current-buffer
|
||||||
|
(url-retrieve-synchronously
|
||||||
|
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
||||||
|
'silent 'inhibit-cookies)
|
||||||
|
(goto-char (point-max))
|
||||||
|
(eval-print-last-sexp)))
|
||||||
|
(load bootstrap-file nil 'nomessage))
|
||||||
|
|
||||||
|
(setq package-enable-at-startup nil)
|
||||||
|
#+end_src
|
||||||
** Environment-specific setup
|
** Environment-specific setup
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(setq IS-MACOS (eq system-type 'darwin))
|
(setq IS-MACOS (eq system-type 'darwin))
|
||||||
|
|
@ -79,26 +114,24 @@ To get started, run =C-c C-v t=
|
||||||
(ensure-directory "~/.config/emacs/video")
|
(ensure-directory "~/.config/emacs/video")
|
||||||
(ensure-directory "~/.config/emacs/audio")
|
(ensure-directory "~/.config/emacs/audio")
|
||||||
|
|
||||||
(setq deft-directory "~/notes/deft"
|
(setq projectile-project-search-path '("~/code/")
|
||||||
org-roam-directory "~/notes/roam"
|
|
||||||
projectile-project-search-path '("~/code/")
|
|
||||||
empv-video-dir "~/.config/emacs/video"
|
empv-video-dir "~/.config/emacs/video"
|
||||||
empv-audio-dir "~/.config/emacs/audio"
|
empv-audio-dir "~/.config/emacs/audio"
|
||||||
backup-directory-alist `(("." . "~/.config/emacs/backups/"))
|
backup-directory-alist `(("." . "~/.config/emacs/backups/"))
|
||||||
auto-save-file-name-transforms `((".*" "~/.config/emacs/autosaves/" t)))
|
auto-save-file-name-transforms `((".*" "~/.config/emacs/autosaves/" t)))
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
** Helper Functions
|
** Helper Functions
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
||||||
(defun custom/eval-region-or-buffer ()
|
(defun ian/eval-region-or-buffer ()
|
||||||
"Eval the region if anything is selected, otherwise eval the whole buffer."
|
"Eval the region if anything is selected, otherwise eval the whole buffer."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if mark-active
|
(if mark-active
|
||||||
(eval-region (region-beginning) (region-end))
|
(eval-region (region-beginning) (region-end))
|
||||||
(eval-buffer)))
|
(eval-buffer)))
|
||||||
|
|
||||||
(defun custom/conditional-imenu ()
|
(defun ian/conditional-imenu ()
|
||||||
"Call `consult-org-heading` in Org mode, otherwise `consult-imenu`."
|
"Call `consult-org-heading` in Org mode, otherwise `consult-imenu`."
|
||||||
(interactive)
|
(interactive)
|
||||||
(if (eq major-mode 'org-mode)
|
(if (eq major-mode 'org-mode)
|
||||||
|
|
@ -107,15 +140,27 @@ To get started, run =C-c C-v t=
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
* One-Line Includes
|
* One-Line Includes
|
||||||
|
TODO: rename this section
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package treemacs)
|
(use-package treemacs)
|
||||||
|
;; Enable follow mode
|
||||||
|
;; Use treemacs-current-visibility function to expand backspace functionality
|
||||||
|
(setq treemacs--project-follow-delay 0)
|
||||||
|
(defun ian/treemacs-open-current-or-jump ()
|
||||||
|
"Find the current file and open treemacs if it's not open, otherwise jump
|
||||||
|
to the treemacs window"
|
||||||
|
(interactive)
|
||||||
|
(if
|
||||||
|
(not(eq (treemacs-current-visibility) 'visible))
|
||||||
|
(treemacs-find-file))
|
||||||
|
(treemacs-select-window))
|
||||||
#+end_src
|
#+end_src
|
||||||
* Notes
|
* Notes
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package deft)
|
(use-package deft)
|
||||||
(setq deft-recursive t
|
(setq deft-recursive t
|
||||||
deft-extensions '("org" "txt"))
|
deft-extensions '("org" "txt"))
|
||||||
#+end_src
|
#+end_src
|
||||||
* AI
|
* AI
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
@ -125,7 +170,7 @@ To get started, run =C-c C-v t=
|
||||||
* Org Mode
|
* Org Mode
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org)
|
(use-package org)
|
||||||
;; (add-hook 'org-mode-hook 'yas-minor-mode)
|
;; (add-hook 'org-mode-hook 'yas-minor-mode)
|
||||||
(org-babel-do-load-languages
|
(org-babel-do-load-languages
|
||||||
'org-babel-load-languages
|
'org-babel-load-languages
|
||||||
'((emacs-lisp . t)
|
'((emacs-lisp . t)
|
||||||
|
|
@ -137,8 +182,6 @@ To get started, run =C-c C-v t=
|
||||||
(add-to-list 'org-structure-template-alist '("sh" . "src shell"))
|
(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 '("el" . "src emacs-lisp"))
|
||||||
|
|
||||||
(use-package org-make-toc
|
|
||||||
:hook (org-mode . org-make-toc-mode))
|
|
||||||
(add-to-list 'org-structure-template-alist '("py" . "src python"))
|
(add-to-list 'org-structure-template-alist '("py" . "src python"))
|
||||||
|
|
||||||
(setq org-hide-emphasis-markers t)
|
(setq org-hide-emphasis-markers t)
|
||||||
|
|
@ -146,6 +189,34 @@ To get started, run =C-c C-v t=
|
||||||
(use-package org-appear
|
(use-package org-appear
|
||||||
:hook (org-mode . org-appear-mode))
|
:hook (org-mode . org-appear-mode))
|
||||||
|
|
||||||
|
(use-package org-roam
|
||||||
|
:ensure t
|
||||||
|
:custom
|
||||||
|
(org-roam-directory "~/notes/roam")
|
||||||
|
:config
|
||||||
|
;; If you're using a vertical completion framework, you might want a more informative completion interface
|
||||||
|
;; (setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
|
||||||
|
(org-roam-db-autosync-mode))
|
||||||
|
|
||||||
|
(use-package deft
|
||||||
|
:commands (deft)
|
||||||
|
:config
|
||||||
|
(setq deft-directory "~/notes/deft"
|
||||||
|
deft-extensions '("org" "txt")
|
||||||
|
deft-recursive t))
|
||||||
|
|
||||||
|
(use-package ox-hugo
|
||||||
|
:after ox)
|
||||||
|
|
||||||
|
(use-package org-roam-ui
|
||||||
|
:after org-roam
|
||||||
|
:config
|
||||||
|
(setq org-roam-ui-sync-theme t
|
||||||
|
org-roam-ui-follow t
|
||||||
|
org-roam-ui-update-on-save t
|
||||||
|
org-roam-ui-open-on-start t))
|
||||||
|
|
||||||
|
(use-package ox-gfm)
|
||||||
#+end_src
|
#+end_src
|
||||||
* Basic Appearance and Behaviors
|
* Basic Appearance and Behaviors
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
@ -171,20 +242,20 @@ To get started, run =C-c C-v t=
|
||||||
:config (solaire-global-mode +1))
|
:config (solaire-global-mode +1))
|
||||||
|
|
||||||
(use-package doom-themes
|
(use-package doom-themes
|
||||||
:ensure t
|
:ensure t
|
||||||
:config
|
:config
|
||||||
;; Global settings (defaults)
|
;; Global settings (defaults)
|
||||||
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
|
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
|
||||||
doom-themes-enable-italic t) ; if nil, italics is universally disabled
|
doom-themes-enable-italic t) ; if nil, italics is universally disabled
|
||||||
;; (load-theme 'doom-one t)
|
;; (load-theme 'doom-one t)
|
||||||
|
|
||||||
;; Enable flashing mode-line on errors
|
;; Enable flashing mode-line on errors
|
||||||
(setq doom-themes-treemacs-theme "doom-atom") ; use "doom-colors" for less minimal icon theme
|
(setq doom-themes-treemacs-theme "doom-atom") ; use "doom-colors" for less minimal icon theme
|
||||||
(doom-themes-treemacs-config)
|
(doom-themes-treemacs-config)
|
||||||
;; Corrects (and improves) org-mode's native fontification.
|
;; Corrects (and improves) org-mode's native fontification.
|
||||||
(doom-themes-org-config))
|
(doom-themes-org-config))
|
||||||
|
|
||||||
(set-frame-font "DejaVu Sans Mono 14")
|
(set-frame-font "DejaVu Sans Mono 17")
|
||||||
(use-package simple-modeline
|
(use-package simple-modeline
|
||||||
:hook (after-init . simple-modeline-mode))
|
:hook (after-init . simple-modeline-mode))
|
||||||
|
|
||||||
|
|
@ -193,9 +264,9 @@ To get started, run =C-c C-v t=
|
||||||
|
|
||||||
(global-display-line-numbers-mode t)
|
(global-display-line-numbers-mode t)
|
||||||
(dolist (mode
|
(dolist (mode
|
||||||
'(org-mode-hook
|
'(org-mode-hook
|
||||||
term-mode-hook
|
term-mode-hook
|
||||||
eshell-mode-hook))
|
eshell-mode-hook))
|
||||||
(add-hook mode (lambda () (display-line-numbers-mode 0))))
|
(add-hook mode (lambda () (display-line-numbers-mode 0))))
|
||||||
(column-number-mode)
|
(column-number-mode)
|
||||||
|
|
||||||
|
|
@ -215,12 +286,23 @@ To get started, run =C-c C-v t=
|
||||||
|
|
||||||
;; Generate buffers in last window
|
;; Generate buffers in last window
|
||||||
(setq display-buffer-base-action
|
(setq display-buffer-base-action
|
||||||
'(display-buffer-reuse-mode-window
|
'(display-buffer-reuse-mode-window
|
||||||
display-buffer-reuse-window
|
display-buffer-reuse-window
|
||||||
display-buffer-same-window))
|
display-buffer-same-window))
|
||||||
|
|
||||||
;; If a popup does happen, don't resize windows to be equal-sized
|
;; If a popup does happen, don't resize windows to be equal-sized
|
||||||
(setq even-window-sizes nil)
|
(setq even-window-sizes nil)
|
||||||
|
(setq whitespace-style '(trailing tabs newline tab-mark )) ; show tab characters
|
||||||
|
(setq indent-tabs-mode nil) ; tabs not spaces
|
||||||
|
(visual-line-mode)
|
||||||
|
#+end_src
|
||||||
|
** Tab bar
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package tab-bar-echo-area
|
||||||
|
:ensure
|
||||||
|
:config
|
||||||
|
(tab-bar-echo-area-mode 1)
|
||||||
|
(setq tab-bar-show nil))
|
||||||
#+end_src
|
#+end_src
|
||||||
* Navigation
|
* Navigation
|
||||||
** Helper Functions
|
** Helper Functions
|
||||||
|
|
@ -262,31 +344,36 @@ To get started, run =C-c C-v t=
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
** Windows and Workspaces
|
** Windows and Workspaces
|
||||||
|
[[https://github.com/abo-abo/ace-window/issues/216][Credit]] for manual dispatch function
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package persp-mode
|
(defun ace-window-manual-dispatch (arg)
|
||||||
:diminish persp-mode)
|
"Calls `ace-window' with ARG asking for the dispatch, even if `aw-dispatch-always' is nil.
|
||||||
(unless (equal persp-mode t)
|
This could be useful to use the advanced commands"
|
||||||
(persp-mode))
|
(interactive "p")
|
||||||
|
(let ((aw-dispatch-always t))
|
||||||
|
(ace-window arg)
|
||||||
|
))
|
||||||
(use-package ace-window)
|
(use-package ace-window)
|
||||||
(setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))
|
(setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))
|
||||||
(defvar aw-dispatch-alist
|
(setq aw-dispatch-alist
|
||||||
'((?x aw-delete-window "Delete Window")
|
'(
|
||||||
(?m aw-swap-window "Swap Windows")
|
(?x aw-delete-window "Delete Window")
|
||||||
(?M aw-move-window "Move Window")
|
(?m aw-swap-window "Swap Windows")
|
||||||
(?c aw-copy-window "Copy Window")
|
(?M aw-move-window "Move Window")
|
||||||
(?j aw-switch-buffer-in-window "Select Buffer")
|
;; (?c aw-copy-window "Copy Window")
|
||||||
(?n aw-flip-window)
|
;; (?j aw-switch-buffer-in-window "Select Buffer")
|
||||||
;;(?u aw-switch-buffer-other-window "Switch Buffer Other Window")
|
;; (?n aw-flip-window)
|
||||||
(?u aw-switch-buffer-other-window 'winner-undo)
|
;; ;;
|
||||||
(?U aw-switch-buffer-other-window 'winner-redo)
|
(?b aw-switch-buffer-other-window "Switch Buffer Other Window")
|
||||||
(?c aw-split-window-fair "Split Fair Window")
|
(?u winner-undo)
|
||||||
(?v aw-split-window-vert "Split Vert Window")
|
(?U winner-redo)
|
||||||
(?b aw-split-window-horz "Split Horz Window")
|
(?c aw-split-window-fair "Split Fair Window")
|
||||||
(?o delete-other-windows "Delete Other Windows")
|
(?v aw-split-window-vert "Split Vert Window")
|
||||||
(?? aw-show-dispatch-help))
|
(?H aw-split-window-horz "Split Horz Window")
|
||||||
"List of actions for `aw-dispatch-default'.")
|
(?o delete-other-windows "Delete Other Windows")
|
||||||
;; TODO: maybe put workspace controls in aw-dispatch?
|
(?? aw-show-dispatch-help)))
|
||||||
|
(setq aw-scope 'frame)
|
||||||
|
;; TODO: Window width controls
|
||||||
#+end_src
|
#+end_src
|
||||||
** Dired
|
** Dired
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
@ -302,11 +389,11 @@ To get started, run =C-c C-v t=
|
||||||
loaded."
|
loaded."
|
||||||
;; <add other stuff here>
|
;; <add other stuff here>
|
||||||
(define-key dired-mode-map [remap dired-find-file]
|
(define-key dired-mode-map [remap dired-find-file]
|
||||||
'dired-single-buffer)
|
'dired-single-buffer)
|
||||||
(define-key dired-mode-map [remap dired-mouse-find-file-other-window]
|
(define-key dired-mode-map [remap dired-mouse-find-file-other-window]
|
||||||
'dired-single-buffer-mouse)
|
'dired-single-buffer-mouse)
|
||||||
(define-key dired-mode-map [remap dired-up-directory]
|
(define-key dired-mode-map [remap dired-up-directory]
|
||||||
'dired-single-up-directory))
|
'dired-single-up-directory))
|
||||||
|
|
||||||
;; if dired's already loaded, then the keymap will be bound
|
;; if dired's already loaded, then the keymap will be bound
|
||||||
(if (boundp 'dired-mode-map)
|
(if (boundp 'dired-mode-map)
|
||||||
|
|
@ -318,8 +405,8 @@ To get started, run =C-c C-v t=
|
||||||
(use-package dired-open
|
(use-package dired-open
|
||||||
:config
|
:config
|
||||||
(setq dired-open-extensions '(("png" . "sxiv")
|
(setq dired-open-extensions '(("png" . "sxiv")
|
||||||
("mkv" . "mpv")
|
("mkv" . "mpv")
|
||||||
("avi" . "mpv"))))
|
("avi" . "mpv"))))
|
||||||
|
|
||||||
(use-package all-the-icons-dired
|
(use-package all-the-icons-dired
|
||||||
:hook (dired-mode . all-the-icons-dired-mode))
|
:hook (dired-mode . all-the-icons-dired-mode))
|
||||||
|
|
@ -357,19 +444,20 @@ To get started, run =C-c C-v t=
|
||||||
(general-definition
|
(general-definition
|
||||||
|
|
||||||
;; Top level bindings
|
;; Top level bindings
|
||||||
"SPC" '(projectile-find-file :which-key "Find project file")
|
"SPC" '(projectile-find-file :which-key "Find project file")
|
||||||
"<backspace>" '(treemacs-find-file :which-key "Find current file in sidebar")
|
"<backspace>" '(ian/treemacs-open-current-or-jump :which-key "Find current file in sidebar") ; TODO or treemacs-select-window
|
||||||
"," '(+ivy/switch-workspace-buffer :which-key "Buffers (workspace)")
|
"," '(+ivy/switch-workspace-buffer :which-key "Buffers (workspace)")
|
||||||
"/" '(consult-ripgrep :which-key "Search project")
|
"/" '(consult-ripgrep :which-key "Search project")
|
||||||
":" '(execute-extended-command :which-key "M-x")
|
":" '(execute-extended-command :which-key "M-x")
|
||||||
";" '(eval-expression :which-key "Eval")
|
";" '(eval-expression :which-key "Eval")
|
||||||
"<" '(consult-buffer :which-key "Buffers (all)")
|
"<" '(consult-buffer :which-key "Buffers (all)")
|
||||||
"x" '(scratch-buffer :which-key "Scratch popup")
|
"x" '(scratch-buffer :which-key "Scratch popup")
|
||||||
"-" '(dired :which-key "Find Directory")
|
"-" '(dired :which-key "Find Directory")
|
||||||
;; "*" '(counsel-locate :which-key "Fuzzy find file") ;; find-file? consult-locate?
|
;; "*" '(counsel-locate :which-key "Fuzzy find file") ;; find-file? consult-locate?
|
||||||
"d" '(docker :which-key "Docker")
|
"d" '(docker :which-key "Docker")
|
||||||
"i" '(custom/conditional-imenu :which-key "Imenu") ;; consult-outline?
|
"i" '(ian/conditional-imenu :which-key "Imenu") ;; consult-outline?
|
||||||
"w" '(ace-window :which-key "Window")
|
"w" '(ace-window :which-key "Window")
|
||||||
|
"W" '(ace-window-manual-dispatch :which-key "Window (dispatch)")
|
||||||
|
|
||||||
;; Agenda
|
;; Agenda
|
||||||
"a" '(:ignore t :which-key "Agenda")
|
"a" '(:ignore t :which-key "Agenda")
|
||||||
|
|
@ -402,7 +490,7 @@ To get started, run =C-c C-v t=
|
||||||
"cC" '(recompile :which-key "Recompile")
|
"cC" '(recompile :which-key "Recompile")
|
||||||
"cd" '(+lookup/definition :which-key "Goto definition")
|
"cd" '(+lookup/definition :which-key "Goto definition")
|
||||||
"cr" '(+lookup/references :which-key "Goto references")
|
"cr" '(+lookup/references :which-key "Goto references")
|
||||||
"ce" '(custom/eval-region-or-buffer :which-key "Eval buffer/region")
|
"ce" '(ian/eval-region-or-buffer :which-key "Eval buffer/region")
|
||||||
;; "cf" '(NOT A COMMAND (re-do) :which-key "Format buffer/region")
|
;; "cf" '(NOT A COMMAND (re-do) :which-key "Format buffer/region")
|
||||||
"ci" '(+lookup/implementations :which-key "Find implementations")
|
"ci" '(+lookup/implementations :which-key "Find implementations")
|
||||||
"cj" '(lsp-ivy-workspace-symbol :which-key "Goto symbol (curr. workspace)")
|
"cj" '(lsp-ivy-workspace-symbol :which-key "Goto symbol (curr. workspace)")
|
||||||
|
|
@ -500,44 +588,44 @@ To get started, run =C-c C-v t=
|
||||||
"hwm" '(which-key-show-major-mode :which-key "Show major mode")
|
"hwm" '(which-key-show-major-mode :which-key "Show major mode")
|
||||||
"hwt" '(which-key-show-top-level :which-key "Show top-level")
|
"hwt" '(which-key-show-top-level :which-key "Show top-level")
|
||||||
|
|
||||||
"m" '(:ignore t :which-key "media")
|
"m" '(:ignore t :which-key "media")
|
||||||
"my" '(empv-youtube :which-key "youtube")
|
"my" '(empv-youtube :which-key "youtube")
|
||||||
"mt" '(empv-toggle :which-key "toggle")
|
"mt" '(empv-toggle :which-key "toggle")
|
||||||
"mT" '(empv-toggle-video :which-key "toggle-video")
|
"mT" '(empv-toggle-video :which-key "toggle-video")
|
||||||
"mq" '(empv-exit :which-key "quit")
|
"mq" '(empv-exit :which-key "quit")
|
||||||
"ms" '(empv-display-current :which-key "show currently playing")
|
"ms" '(empv-display-current :which-key "show currently playing")
|
||||||
|
|
||||||
"mr" '(:ignore t :which-key "radio")
|
"mr" '(:ignore t :which-key "radio")
|
||||||
"mrr" '(empv-play-radio :which-key "play")
|
"mrr" '(empv-play-radio :which-key "play")
|
||||||
"mrR" '(empv-play-random-channel :which-key "play random")
|
"mrR" '(empv-play-random-channel :which-key "play random")
|
||||||
"mrl" '(empv-log-current-radio-song-name :which-key "log song name")
|
"mrl" '(empv-log-current-radio-song-name :which-key "log song name")
|
||||||
|
|
||||||
"mp" '(:ignore t :which-key "playlist")
|
"mp" '(:ignore t :which-key "playlist")
|
||||||
"mpP" '(empv-playlist :which-key "playlist")
|
"mpP" '(empv-playlist :which-key "playlist")
|
||||||
"mps" '(empv-playlist-select :which-key "select")
|
"mps" '(empv-playlist-select :which-key "select")
|
||||||
"mpn" '(empv-playlist-next :which-key "next")
|
"mpn" '(empv-playlist-next :which-key "next")
|
||||||
"mpp" '(empv-playlist-prev :which-key "prev")
|
"mpp" '(empv-playlist-prev :which-key "prev")
|
||||||
"mpc" '(empv-playlist-clear :which-key "clear")
|
"mpc" '(empv-playlist-clear :which-key "clear")
|
||||||
"mpS" '(empv-playlist-shuffle :which-key "shuffle")
|
"mpS" '(empv-playlist-shuffle :which-key "shuffle")
|
||||||
|
|
||||||
"mf" '(:ignore t :which-key "file")
|
"mf" '(:ignore t :which-key "file")
|
||||||
"mff" '(empv-play-file :which-key "play file")
|
"mff" '(empv-play-file :which-key "play file")
|
||||||
"mfd" '(empv-play-directory :which-key "play directory")
|
"mfd" '(empv-play-directory :which-key "play directory")
|
||||||
|
|
||||||
"mv" '(:ignore t :which-key "volume")
|
"mv" '(:ignore t :which-key "volume")
|
||||||
"mvd" '(empv-volume-down :which-key "down")
|
"mvd" '(empv-volume-down :which-key "down")
|
||||||
"mvu" '(empv-volume-up :which-key "up")
|
"mvu" '(empv-volume-up :which-key "up")
|
||||||
|
|
||||||
"mc" '(:ignore t :which-key "chapter")
|
"mc" '(:ignore t :which-key "chapter")
|
||||||
"mcp" '(empv-chapter-prev :which-key "prev")
|
"mcp" '(empv-chapter-prev :which-key "prev")
|
||||||
"mcn" '(empv-chapter-next :which-key "next")
|
"mcn" '(empv-chapter-next :which-key "next")
|
||||||
"mcs" '(empv-chapter-select :which-key "select")
|
"mcs" '(empv-chapter-select :which-key "select")
|
||||||
|
|
||||||
;; Notes
|
;; Notes
|
||||||
"nd" '(deft :which-key "Deft")
|
"nd" '(deft :which-key "Deft")
|
||||||
"nt" '(org-todo-list :which-key "Todo list")
|
"nt" '(org-todo-list :which-key "Todo list")
|
||||||
"nf" '(org-roam-node-find :which-key "Find node")
|
"nf" '(org-roam-node-find :which-key "Find node")
|
||||||
"ng" '(org-roam-graph :which-key "Show graph")
|
"ng" '(org-roam-ui-open :which-key "Show graph")
|
||||||
"nr" '(org-roam-buffer-toggle :which-key "Toggle roam buffer")
|
"nr" '(org-roam-buffer-toggle :which-key "Toggle roam buffer")
|
||||||
"nb" '(org-roam-buffer-display-dedicated :which-key "Launch roam buffer")
|
"nb" '(org-roam-buffer-display-dedicated :which-key "Launch roam buffer")
|
||||||
"ns" '(org-roam-db-sync :which-key "Sync database")
|
"ns" '(org-roam-db-sync :which-key "Sync database")
|
||||||
|
|
@ -607,7 +695,6 @@ To get started, run =C-c C-v t=
|
||||||
"TAB s" '(+workspace/save :which-key "Save workspace")
|
"TAB s" '(+workspace/save :which-key "Save workspace")
|
||||||
"TAB x" '(+workspace/kill-session :which-key "Delete session")
|
"TAB x" '(+workspace/kill-session :which-key "Delete session")
|
||||||
))
|
))
|
||||||
|
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* Project management
|
* Project management
|
||||||
|
|
@ -649,16 +736,16 @@ Idk I think this came from the vertico readme
|
||||||
;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
|
;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma.
|
||||||
(defun crm-indicator (args)
|
(defun crm-indicator (args)
|
||||||
(cons (format "[CRM%s] %s"
|
(cons (format "[CRM%s] %s"
|
||||||
(replace-regexp-in-string
|
(replace-regexp-in-string
|
||||||
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
|
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
|
||||||
crm-separator)
|
crm-separator)
|
||||||
(car args))
|
(car args))
|
||||||
(cdr args)))
|
(cdr args)))
|
||||||
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
|
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
|
||||||
|
|
||||||
;; Do not allow the cursor in the minibuffer prompt
|
;; Do not allow the cursor in the minibuffer prompt
|
||||||
(setq minibuffer-prompt-properties
|
(setq minibuffer-prompt-properties
|
||||||
'(read-only t cursor-intangible t face minibuffer-prompt))
|
'(read-only t cursor-intangible t face minibuffer-prompt))
|
||||||
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
|
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
|
||||||
|
|
||||||
;; Emacs 28: Hide commands in M-x which do not work in the current mode.
|
;; Emacs 28: Hide commands in M-x which do not work in the current mode.
|
||||||
|
|
@ -678,8 +765,8 @@ Idk I think this came from the vertico readme
|
||||||
;; (setq orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch)
|
;; (setq orderless-style-dispatchers '(+orderless-consult-dispatch orderless-affix-dispatch)
|
||||||
;; orderless-component-separator #'orderless-escapable-split-on-space)
|
;; orderless-component-separator #'orderless-escapable-split-on-space)
|
||||||
(setq completion-styles '(orderless basic)
|
(setq completion-styles '(orderless basic)
|
||||||
completion-category-defaults nil
|
completion-category-defaults nil
|
||||||
completion-category-overrides '((file (styles partial-completion)))))
|
completion-category-overrides '((file (styles partial-completion)))))
|
||||||
#+end_src
|
#+end_src
|
||||||
** Marginalia
|
** Marginalia
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
|
@ -688,7 +775,7 @@ Idk I think this came from the vertico readme
|
||||||
;; available in the *Completions* buffer, add it to the
|
;; available in the *Completions* buffer, add it to the
|
||||||
;; `completion-list-mode-map'.
|
;; `completion-list-mode-map'.
|
||||||
:bind (:map minibuffer-local-map
|
:bind (:map minibuffer-local-map
|
||||||
("M-A" . marginalia-cycle))
|
("M-A" . marginalia-cycle))
|
||||||
|
|
||||||
;; The :init section is always executed.
|
;; The :init section is always executed.
|
||||||
:init
|
:init
|
||||||
|
|
@ -705,12 +792,12 @@ Idk I think this came from the vertico readme
|
||||||
:hook (prog-mode . company-mode)
|
:hook (prog-mode . company-mode)
|
||||||
:diminish
|
:diminish
|
||||||
:bind (:map company-active-map
|
:bind (:map company-active-map
|
||||||
("<tab>" . company-select-next)
|
("<tab>" . company-select-next)
|
||||||
("TAB" . company-select-next)
|
("TAB" . company-select-next)
|
||||||
("<backtab>" . company-select-previous)
|
("<backtab>" . company-select-previous)
|
||||||
("<S-tab>" . company-select-previous))
|
("<S-tab>" . company-select-previous))
|
||||||
(:map lsp-mode-map ; more general mode than this?
|
(:map lsp-mode-map ; more general mode than this?
|
||||||
("<tab>" . company-indent-or-complete-common))
|
("<tab>" . company-indent-or-complete-common))
|
||||||
:config
|
:config
|
||||||
(global-company-mode 1)
|
(global-company-mode 1)
|
||||||
:init
|
:init
|
||||||
|
|
@ -799,6 +886,7 @@ All lisp-family languages
|
||||||
(lispyville-set-key-theme '(operators c-w additional)))
|
(lispyville-set-key-theme '(operators c-w additional)))
|
||||||
#+end_src
|
#+end_src
|
||||||
* Markups
|
* Markups
|
||||||
|
** Markdown
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package markdown-mode
|
(use-package markdown-mode
|
||||||
:mode ("\\.md\\'" . markdown-mode))
|
:mode ("\\.md\\'" . markdown-mode))
|
||||||
|
|
@ -807,13 +895,32 @@ All lisp-family languages
|
||||||
(use-package json-mode)
|
(use-package json-mode)
|
||||||
(use-package yaml-mode)
|
(use-package yaml-mode)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
** Beancount
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defun beancount-tab-function ()
|
||||||
|
"Improved beancount tab ripped off from doom emacs"
|
||||||
|
(interactive)
|
||||||
|
(if (and outline-minor-mode (outline-on-heading-p))
|
||||||
|
(beancount-outline-cycle)
|
||||||
|
(indent-according-to-mode)))
|
||||||
|
|
||||||
|
(use-package beancount
|
||||||
|
:straight (beancount :type git :host github :repo "beancount/beancount-mode")
|
||||||
|
:mode ("\\.beancount\\'" . beancount-mode)
|
||||||
|
:hook (beancount-mode . outline-minor-mode)
|
||||||
|
:config
|
||||||
|
(evil-define-key 'normal 'beancount-mode-map (kbd "TAB") 'beancount-tab-function)
|
||||||
|
) ;; Bind the TAB key
|
||||||
|
|
||||||
|
(add-hook 'beancount-mode-hook #'flymake-bean-check-enable)
|
||||||
|
#+end_src
|
||||||
* Shells
|
* Shells
|
||||||
** Enable fish completions
|
** Enable fish completions
|
||||||
Uses the external fish program to provide fish-style completions to eshell etc
|
Uses the external fish program to provide fish-style completions to eshell etc
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package fish-completion)
|
(use-package fish-completion)
|
||||||
(when (and (executable-find "fish")
|
(when (and (executable-find "fish")
|
||||||
(require 'fish-completion nil t))
|
(require 'fish-completion nil t))
|
||||||
(global-fish-completion-mode))
|
(global-fish-completion-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
* Git
|
* Git
|
||||||
|
|
@ -935,16 +1042,22 @@ Uses the external fish program to provide fish-style completions to eshell etc
|
||||||
;; (require 'evil-org-agenda)
|
;; (require 'evil-org-agenda)
|
||||||
;; (evil-org-agenda-set-keys)
|
;; (evil-org-agenda-set-keys)
|
||||||
)
|
)
|
||||||
|
|
||||||
(use-package evil-collection
|
(use-package evil-collection
|
||||||
:after evil
|
:after evil
|
||||||
:ensure t
|
:ensure t
|
||||||
:diminish evil-collection-unimpaired-mode
|
:diminish evil-collection-unimpaired-mode
|
||||||
|
:init
|
||||||
|
(setq evil-want-C-u-scroll t)
|
||||||
:config
|
:config
|
||||||
(evil-collection-init)
|
(evil-collection-init)
|
||||||
|
|
||||||
(setq evil-want-C-i-jump t
|
(setq evil-want-C-i-jump t
|
||||||
evil-respect-visual-line-mode t))
|
evil-respect-visual-line-mode t))
|
||||||
#+end_src
|
|
||||||
|
(use-package evil-commentary
|
||||||
|
:config
|
||||||
|
(evil-commentary-mode))
|
||||||
|
#+end_src
|
||||||
* Web browsing and youtube
|
* Web browsing and youtube
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
;; Using straight:
|
;; Using straight:
|
||||||
|
|
@ -954,14 +1067,14 @@ Uses the external fish program to provide fish-style completions to eshell etc
|
||||||
(use-package empv)
|
(use-package empv)
|
||||||
|
|
||||||
(setq empv-radio-channels
|
(setq empv-radio-channels
|
||||||
'(("SomaFM - Groove Salad" . "http://www.somafm.com/groovesalad.pls")
|
'(("SomaFM - Groove Salad" . "http://www.somafm.com/groovesalad.pls")
|
||||||
("SomaFM - Drone Zone" . "http://www.somafm.com/dronezone.pls")
|
("SomaFM - Drone Zone" . "http://www.somafm.com/dronezone.pls")
|
||||||
("SomaFM - Sonic Universe" . "https://somafm.com/sonicuniverse.pls")
|
("SomaFM - Sonic Universe" . "https://somafm.com/sonicuniverse.pls")
|
||||||
("SomaFM - Metal" . "https://somafm.com/metal.pls")
|
("SomaFM - Metal" . "https://somafm.com/metal.pls")
|
||||||
("SomaFM - Vaporwaves" . "https://somafm.com/vaporwaves.pls")
|
("SomaFM - Vaporwaves" . "https://somafm.com/vaporwaves.pls")
|
||||||
("ADHD 1" . "https://www.youtube.com/watch?v=CmMrm4BpQHU")
|
("ADHD 1" . "https://www.youtube.com/watch?v=CmMrm4BpQHU")
|
||||||
("WREK FM" . "http://streaming.wrek.org:8000/wrek_live-128kb.m3u")
|
("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?
|
;; Todo: lainchan? adhd music stream from youtube? wuog? wrekFM? does freeside have streaming radio?
|
||||||
(with-eval-after-load 'embark (empv-embark-initialize-extra-actions))
|
(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 "--ytdl-format=best")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue