ThoomEmacs init changes
- Move package management to top - Add exec-path-from-shell - Add server start - Move thoom/meow-negate macro out of use-package block - Add visual-line-mode to org - Set org src indentation to 0 (but don't actually reindent yet) - Add aspirational headings for modes to configure
This commit is contained in:
@@ -2,29 +2,7 @@
|
|||||||
#+PROPERTY: header-args:emacs-lisp :tangle ./init.el :mkdirp yes
|
#+PROPERTY: header-args:emacs-lisp :tangle ./init.el :mkdirp yes
|
||||||
#+STARTUP: content
|
#+STARTUP: content
|
||||||
* Prelude
|
* Prelude
|
||||||
** Utility constants for checking operating system
|
** Package Management
|
||||||
#+begin_src emacs-lisp
|
|
||||||
;; Check the system used
|
|
||||||
(defconst ON-LINUX (eq system-type 'gnu/linux))
|
|
||||||
(defconst ON-MAC (eq system-type 'darwin))
|
|
||||||
(defconst ON-BSD (or ON-MAC (eq system-type 'berkeley-unix)))
|
|
||||||
(defconst ON-WINDOWS (memq system-type '(cygwin windows-nt ms-dos)))
|
|
||||||
#+end_src
|
|
||||||
** Auto-tangle this file
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
(defun thoom/org-babel-tangle-config ()
|
|
||||||
(when (string-equal (file-truename (buffer-file-name))
|
|
||||||
(expand-file-name "~/.dotfiles/thoom-emacs/ThoomEmacs.org"))
|
|
||||||
;; Dynamic scoping to the rescue
|
|
||||||
(let ((org-confirm-babel-evaluate nil))
|
|
||||||
(org-babel-tangle))))
|
|
||||||
|
|
||||||
(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'thoom/org-babel-tangle-config)))
|
|
||||||
#+end_src
|
|
||||||
* Package Management
|
|
||||||
|
|
||||||
** straight.el
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defvar bootstrap-version)
|
(defvar bootstrap-version)
|
||||||
(let ((bootstrap-file
|
(let ((bootstrap-file
|
||||||
@@ -38,14 +16,41 @@
|
|||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(eval-print-last-sexp)))
|
(eval-print-last-sexp)))
|
||||||
(load bootstrap-file nil 'nomessage))
|
(load bootstrap-file nil 'nomessage))
|
||||||
#+END_SRC
|
|
||||||
|
|
||||||
** use-package
|
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
|
||||||
(straight-use-package 'use-package)
|
(straight-use-package 'use-package)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
** Utility constants for checking operating system
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
;; Check the system used
|
||||||
|
(defconst ON-LINUX (eq system-type 'gnu/linux))
|
||||||
|
(defconst ON-MAC (eq system-type 'darwin))
|
||||||
|
(defconst ON-BSD (or ON-MAC (eq system-type 'berkeley-unix)))
|
||||||
|
(defconst ON-WINDOWS (memq system-type '(cygwin windows-nt ms-dos)))
|
||||||
|
#+end_src
|
||||||
|
** Fix PATH on macOS
|
||||||
|
Emacs on macOS doesn't naturally find shell variables like PATH, so to help it out we run a shell and load some variables from the env command.
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package exec-path-from-shell
|
||||||
|
:straight t
|
||||||
|
:if (and ON-MAC (memq window-system '(mac ns)))
|
||||||
|
:config
|
||||||
|
(dolist (var '("NIX_SSL_CERT_FILE"
|
||||||
|
"NIX_PATH"
|
||||||
|
"NIX_PROFILES"))
|
||||||
|
(add-to-list 'exec-path-from-shell-variables var))
|
||||||
|
(exec-path-from-shell-initialize))
|
||||||
|
#+end_src
|
||||||
|
** Auto-tangle this file
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(defun thoom/org-babel-tangle-config ()
|
||||||
|
(when (string-equal (file-truename (buffer-file-name))
|
||||||
|
(expand-file-name "~/.dotfiles/thoom-emacs/ThoomEmacs.org"))
|
||||||
|
;; Dynamic scoping to the rescue
|
||||||
|
(let ((org-confirm-babel-evaluate nil))
|
||||||
|
(org-babel-tangle))))
|
||||||
|
|
||||||
|
(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'thoom/org-babel-tangle-config)))
|
||||||
|
#+end_src
|
||||||
* Basic UI Tweaks
|
* Basic UI Tweaks
|
||||||
** Theme
|
** Theme
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
@@ -63,7 +68,7 @@
|
|||||||
(doom-themes-org-config))
|
(doom-themes-org-config))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Hiding Stuff
|
** Hiding Clutter
|
||||||
Disable a bunch of stuff we don't want to see.
|
Disable a bunch of stuff we don't want to see.
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
@@ -100,18 +105,14 @@ Set some common settings, like global-auto-revert-mode.
|
|||||||
;; TODO - Decide whether to enable this
|
;; TODO - Decide whether to enable this
|
||||||
;; (defalias 'yes-or-no-p 'y-or-n-p)
|
;; (defalias 'yes-or-no-p 'y-or-n-p)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** hl-todo
|
** hl-todo
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package hl-todo
|
(use-package hl-todo
|
||||||
:straight t
|
:straight t
|
||||||
:init
|
:init
|
||||||
(global-hl-todo-mode))
|
(global-hl-todo-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Repeat Mode
|
** Repeat Mode
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(repeat-mode 1)
|
(repeat-mode 1)
|
||||||
|
|
||||||
@@ -133,20 +134,22 @@ Set some common settings, like global-auto-revert-mode.
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Tab Bar
|
** Tab Bar
|
||||||
|
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(tab-bar-mode)
|
(tab-bar-mode)
|
||||||
|
|
||||||
;; TODO - keybindings
|
;; TODO - keybindings
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
** Custom File
|
** Custom File
|
||||||
|
|
||||||
Set a location for the custom file so it doesn't pollute this file.
|
Set a location for the custom file so it doesn't pollute this file.
|
||||||
|
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(setq custom-file (locate-user-emacs-file "custom-vars.el"))
|
(setq custom-file (locate-user-emacs-file "custom-vars.el"))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
* Emacs Server
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(require 'server)
|
||||||
|
(unless (server-running-p) (server-start))
|
||||||
|
#+end_src
|
||||||
|
|
||||||
* Keybindings
|
* Keybindings
|
||||||
** Which-key
|
** Which-key
|
||||||
@@ -183,6 +186,7 @@ Set a location for the custom file so it doesn't pollute this file.
|
|||||||
("C-c b b" . consult-buffer)
|
("C-c b b" . consult-buffer)
|
||||||
("C-c b p" . previous-buffer)
|
("C-c b p" . previous-buffer)
|
||||||
("C-c b n" . next-buffer)
|
("C-c b n" . next-buffer)
|
||||||
|
("C-c b C-c" . server-edit)
|
||||||
|
|
||||||
("C-o" . pop-global-mark)
|
("C-o" . pop-global-mark)
|
||||||
("M-DEL" . backward-kill-word)
|
("M-DEL" . backward-kill-word)
|
||||||
@@ -202,16 +206,17 @@ When in indent-rigidly mode (=+= in normal state), use =H/L= to adjust indent by
|
|||||||
#+end_src
|
#+end_src
|
||||||
** Meow
|
** Meow
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
|
(defmacro thoom/meow-negate (meow-command)
|
||||||
|
`(lambda ()
|
||||||
|
(interactive)
|
||||||
|
(let ((current-prefix-arg -1))
|
||||||
|
(call-interactively ,meow-command))))
|
||||||
|
|
||||||
(use-package meow
|
(use-package meow
|
||||||
:straight t
|
:straight t
|
||||||
:init
|
:init
|
||||||
;; TODO - make this unnecessary
|
;; TODO - make this unnecessary
|
||||||
(require 'meow)
|
(require 'meow)
|
||||||
(defmacro thoom/meow-negate (meow-command)
|
|
||||||
`(lambda ()
|
|
||||||
(interactive)
|
|
||||||
(let ((current-prefix-arg -1))
|
|
||||||
(call-interactively ,meow-command))))
|
|
||||||
|
|
||||||
;; TODO - debug this. should make org headings into meow things
|
;; TODO - debug this. should make org headings into meow things
|
||||||
(meow-thing-register 'heading 'heading 'heading)
|
(meow-thing-register 'heading 'heading 'heading)
|
||||||
@@ -345,14 +350,18 @@ When in indent-rigidly mode (=+= in normal state), use =H/L= to adjust indent by
|
|||||||
|
|
||||||
(meow-global-mode 1))
|
(meow-global-mode 1))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
** TODO Autocompletion
|
||||||
* Org
|
* Org
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package org
|
(use-package org
|
||||||
|
:hook (org-mode . visual-line-mode)
|
||||||
:config
|
:config
|
||||||
;; Add structure templates
|
;; Add structure templates
|
||||||
(add-to-list 'org-modules 'org-tempo t)
|
(add-to-list 'org-modules 'org-tempo t)
|
||||||
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
|
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
|
||||||
|
|
||||||
|
(setq org-edit-src-content-indentation 0)
|
||||||
|
|
||||||
;; Repeat map for previous/next heading
|
;; Repeat map for previous/next heading
|
||||||
(thoom/repeat-map thoom/org-previous-next-visible-heading-repeat-map
|
(thoom/repeat-map thoom/org-previous-next-visible-heading-repeat-map
|
||||||
("n" . org-next-visible-heading)
|
("n" . org-next-visible-heading)
|
||||||
@@ -366,7 +375,6 @@ When in indent-rigidly mode (=+= in normal state), use =H/L= to adjust indent by
|
|||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
* VMOCE
|
* VMOCE
|
||||||
|
|
||||||
** Vertico
|
** Vertico
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
(use-package vertico
|
(use-package vertico
|
||||||
@@ -548,3 +556,13 @@ When in indent-rigidly mode (=+= in normal state), use =H/L= to adjust indent by
|
|||||||
:hook
|
:hook
|
||||||
(embark-collect-mode . consult-preview-at-point-mode))
|
(embark-collect-mode . consult-preview-at-point-mode))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
* TODO Git
|
||||||
|
|
||||||
|
* TODO Direnv
|
||||||
|
|
||||||
|
* Programming
|
||||||
|
** TODO LSP
|
||||||
|
** TODO Python
|
||||||
|
** TODO Web
|
||||||
|
** TODO Nix
|
||||||
|
|||||||
@@ -1,18 +1,3 @@
|
|||||||
;; Check the system used
|
|
||||||
(defconst ON-LINUX (eq system-type 'gnu/linux))
|
|
||||||
(defconst ON-MAC (eq system-type 'darwin))
|
|
||||||
(defconst ON-BSD (or ON-MAC (eq system-type 'berkeley-unix)))
|
|
||||||
(defconst ON-WINDOWS (memq system-type '(cygwin windows-nt ms-dos)))
|
|
||||||
|
|
||||||
(defun thoom/org-babel-tangle-config ()
|
|
||||||
(when (string-equal (file-truename (buffer-file-name))
|
|
||||||
(expand-file-name "~/.dotfiles/thoom-emacs/ThoomEmacs.org"))
|
|
||||||
;; Dynamic scoping to the rescue
|
|
||||||
(let ((org-confirm-babel-evaluate nil))
|
|
||||||
(org-babel-tangle))))
|
|
||||||
|
|
||||||
(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'thoom/org-babel-tangle-config)))
|
|
||||||
|
|
||||||
(defvar bootstrap-version)
|
(defvar bootstrap-version)
|
||||||
(let ((bootstrap-file
|
(let ((bootstrap-file
|
||||||
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
||||||
@@ -28,6 +13,31 @@
|
|||||||
|
|
||||||
(straight-use-package 'use-package)
|
(straight-use-package 'use-package)
|
||||||
|
|
||||||
|
;; Check the system used
|
||||||
|
(defconst ON-LINUX (eq system-type 'gnu/linux))
|
||||||
|
(defconst ON-MAC (eq system-type 'darwin))
|
||||||
|
(defconst ON-BSD (or ON-MAC (eq system-type 'berkeley-unix)))
|
||||||
|
(defconst ON-WINDOWS (memq system-type '(cygwin windows-nt ms-dos)))
|
||||||
|
|
||||||
|
(use-package exec-path-from-shell
|
||||||
|
:straight t
|
||||||
|
:if (and ON-MAC (memq window-system '(mac ns)))
|
||||||
|
:config
|
||||||
|
(dolist (var '("NIX_SSL_CERT_FILE"
|
||||||
|
"NIX_PATH"
|
||||||
|
"NIX_PROFILES"))
|
||||||
|
(add-to-list 'exec-path-from-shell-variables var))
|
||||||
|
(exec-path-from-shell-initialize))
|
||||||
|
|
||||||
|
(defun thoom/org-babel-tangle-config ()
|
||||||
|
(when (string-equal (file-truename (buffer-file-name))
|
||||||
|
(expand-file-name "~/.dotfiles/thoom-emacs/ThoomEmacs.org"))
|
||||||
|
;; Dynamic scoping to the rescue
|
||||||
|
(let ((org-confirm-babel-evaluate nil))
|
||||||
|
(org-babel-tangle))))
|
||||||
|
|
||||||
|
(add-hook 'org-mode-hook (lambda () (add-hook 'after-save-hook #'thoom/org-babel-tangle-config)))
|
||||||
|
|
||||||
(use-package doom-themes
|
(use-package doom-themes
|
||||||
:straight t
|
:straight t
|
||||||
:config
|
:config
|
||||||
@@ -98,6 +108,9 @@
|
|||||||
|
|
||||||
(setq custom-file (locate-user-emacs-file "custom-vars.el"))
|
(setq custom-file (locate-user-emacs-file "custom-vars.el"))
|
||||||
|
|
||||||
|
(require 'server)
|
||||||
|
(unless (server-running-p) (server-start))
|
||||||
|
|
||||||
(use-package which-key
|
(use-package which-key
|
||||||
:straight t
|
:straight t
|
||||||
:init
|
:init
|
||||||
@@ -128,6 +141,7 @@
|
|||||||
("C-c b b" . consult-buffer)
|
("C-c b b" . consult-buffer)
|
||||||
("C-c b p" . previous-buffer)
|
("C-c b p" . previous-buffer)
|
||||||
("C-c b n" . next-buffer)
|
("C-c b n" . next-buffer)
|
||||||
|
("C-c b C-c" . server-edit)
|
||||||
|
|
||||||
("C-o" . pop-global-mark)
|
("C-o" . pop-global-mark)
|
||||||
("M-DEL" . backward-kill-word)
|
("M-DEL" . backward-kill-word)
|
||||||
@@ -139,16 +153,17 @@
|
|||||||
(define-key indent-rigidly-map (kbd "h") 'indent-rigidly-left-to-tab-stop)
|
(define-key indent-rigidly-map (kbd "h") 'indent-rigidly-left-to-tab-stop)
|
||||||
(define-key indent-rigidly-map (kbd "l") 'indent-rigidly-right-to-tab-stop)
|
(define-key indent-rigidly-map (kbd "l") 'indent-rigidly-right-to-tab-stop)
|
||||||
|
|
||||||
|
(defmacro thoom/meow-negate (meow-command)
|
||||||
|
`(lambda ()
|
||||||
|
(interactive)
|
||||||
|
(let ((current-prefix-arg -1))
|
||||||
|
(call-interactively ,meow-command))))
|
||||||
|
|
||||||
(use-package meow
|
(use-package meow
|
||||||
:straight t
|
:straight t
|
||||||
:init
|
:init
|
||||||
;; TODO - make this unnecessary
|
;; TODO - make this unnecessary
|
||||||
(require 'meow)
|
(require 'meow)
|
||||||
(defmacro thoom/meow-negate (meow-command)
|
|
||||||
`(lambda ()
|
|
||||||
(interactive)
|
|
||||||
(let ((current-prefix-arg -1))
|
|
||||||
(call-interactively ,meow-command))))
|
|
||||||
|
|
||||||
;; TODO - debug this. should make org headings into meow things
|
;; TODO - debug this. should make org headings into meow things
|
||||||
(meow-thing-register 'heading 'heading 'heading)
|
(meow-thing-register 'heading 'heading 'heading)
|
||||||
@@ -283,11 +298,14 @@
|
|||||||
(meow-global-mode 1))
|
(meow-global-mode 1))
|
||||||
|
|
||||||
(use-package org
|
(use-package org
|
||||||
|
:hook (org-mode . visual-line-mode)
|
||||||
:config
|
:config
|
||||||
;; Add structure templates
|
;; Add structure templates
|
||||||
(add-to-list 'org-modules 'org-tempo t)
|
(add-to-list 'org-modules 'org-tempo t)
|
||||||
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
|
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
|
||||||
|
|
||||||
|
(setq org-edit-src-content-indentation 0)
|
||||||
|
|
||||||
;; Repeat map for previous/next heading
|
;; Repeat map for previous/next heading
|
||||||
(thoom/repeat-map thoom/org-previous-next-visible-heading-repeat-map
|
(thoom/repeat-map thoom/org-previous-next-visible-heading-repeat-map
|
||||||
("n" . org-next-visible-heading)
|
("n" . org-next-visible-heading)
|
||||||
|
|||||||
Reference in New Issue
Block a user