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:
@@ -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)
|
||||
(let ((bootstrap-file
|
||||
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
||||
@@ -28,6 +13,31 @@
|
||||
|
||||
(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
|
||||
:straight t
|
||||
:config
|
||||
@@ -98,6 +108,9 @@
|
||||
|
||||
(setq custom-file (locate-user-emacs-file "custom-vars.el"))
|
||||
|
||||
(require 'server)
|
||||
(unless (server-running-p) (server-start))
|
||||
|
||||
(use-package which-key
|
||||
:straight t
|
||||
:init
|
||||
@@ -128,6 +141,7 @@
|
||||
("C-c b b" . consult-buffer)
|
||||
("C-c b p" . previous-buffer)
|
||||
("C-c b n" . next-buffer)
|
||||
("C-c b C-c" . server-edit)
|
||||
|
||||
("C-o" . pop-global-mark)
|
||||
("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 "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
|
||||
:straight t
|
||||
:init
|
||||
;; TODO - make this unnecessary
|
||||
(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
|
||||
(meow-thing-register 'heading 'heading 'heading)
|
||||
@@ -283,11 +298,14 @@
|
||||
(meow-global-mode 1))
|
||||
|
||||
(use-package org
|
||||
:hook (org-mode . visual-line-mode)
|
||||
:config
|
||||
;; Add structure templates
|
||||
(add-to-list 'org-modules 'org-tempo t)
|
||||
(add-to-list 'org-structure-template-alist '("el" . "src emacs-lisp"))
|
||||
|
||||
(setq org-edit-src-content-indentation 0)
|
||||
|
||||
;; Repeat map for previous/next heading
|
||||
(thoom/repeat-map thoom/org-previous-next-visible-heading-repeat-map
|
||||
("n" . org-next-visible-heading)
|
||||
|
||||
Reference in New Issue
Block a user