config/doom: extend config & add annotate package
This commit is contained in:
parent
ccc29ffa0c
commit
6e32e49b4d
|
@ -1,3 +1,2 @@
|
||||||
init.el
|
init.el
|
||||||
local.el
|
local.el
|
||||||
packages.el
|
|
||||||
|
|
|
@ -26,22 +26,41 @@
|
||||||
;; `load-theme' function. This is the default:
|
;; `load-theme' function. This is the default:
|
||||||
(setq doom-theme 'doom-one)
|
(setq doom-theme 'doom-one)
|
||||||
|
|
||||||
|
(setq doom-font (font-spec :family "Fira Code" :size 22 :weight 'semi-light)
|
||||||
|
doom-variable-pitch-font (font-spec :family "sans" :size 25))
|
||||||
|
|
||||||
|
(setq display-line-numbers-type 'relative)
|
||||||
|
|
||||||
(map! :leader "u" 'evil-prev-buffer
|
(map! :leader "u" 'evil-prev-buffer
|
||||||
:leader "i" 'evil-next-buffer
|
:leader "i" 'evil-next-buffer
|
||||||
:leader "bq" 'doom/save-and-kill-buffer
|
:leader "bq" 'doom/save-and-kill-buffer
|
||||||
:leader "mj" 'org-insert-heading)
|
:leader "mj" 'org-insert-heading
|
||||||
|
:leader "aa" 'annotate-annotate
|
||||||
|
:leader "as" 'annotate-mode
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
;; Undo
|
||||||
(setq evil-want-fine-undo t)
|
(setq evil-want-fine-undo t)
|
||||||
|
|
||||||
|
(setq undo-tree-auto-save-history t)
|
||||||
|
(setq undo-tree-history-directory-alist `(("" . (expand-file-name "backups/undo" user-emacs-directory))))
|
||||||
|
|
||||||
|
(setq amalgamating-undo-limit 5)
|
||||||
|
|
||||||
|
; (advice-add 'undo-auto--last-boundary-amalgamating-number :override #'ignore)
|
||||||
|
|
||||||
|
;; Global config
|
||||||
|
(setq confirm-kill-emacs nil)
|
||||||
|
|
||||||
(setq initial-major-mode 'org-mode)
|
(setq initial-major-mode 'org-mode)
|
||||||
|
|
||||||
(desktop-save-mode 1)
|
(desktop-save-mode 1)
|
||||||
|
|
||||||
(setq whitespace-global-modes -1)
|
(global-whitespace-mode -1)
|
||||||
(whitespace-mode -1)
|
(whitespace-mode -1)
|
||||||
|
|
||||||
;; Backups & auto-saves
|
;; Backups & auto-saves
|
||||||
|
|
||||||
(setq auto-save-default t)
|
(setq auto-save-default t)
|
||||||
(setq auto-save-interval 40)
|
(setq auto-save-interval 40)
|
||||||
|
|
||||||
|
@ -52,25 +71,21 @@
|
||||||
version-control t)
|
version-control t)
|
||||||
(setq vc-make-backup-files t)
|
(setq vc-make-backup-files t)
|
||||||
|
|
||||||
(setq undo-tree-auto-save-history t)
|
;; Data dirs
|
||||||
(setq undo-tree-history-directory-alist `(("" . (expand-file-name "backups/undo" user-emacs-directory))))
|
|
||||||
|
|
||||||
(setq amalgamating-undo-limit 5)
|
(defvar user-data-dir "~/data" "Location of the main user data")
|
||||||
|
|
||||||
; (advice-add 'undo-auto--last-boundary-amalgamating-number :override #'ignore)
|
|
||||||
|
|
||||||
(load! "./local.el" nil t)
|
(load! "./local.el" nil t)
|
||||||
|
|
||||||
; ORG
|
; ORG
|
||||||
|
|
||||||
(defvar user-data-dir "~/data" "Location of the main user data")
|
;; Fix xdg-open - https://askubuntu.com/questions/646631/emacs-doesnot-work-with-xdg-open
|
||||||
|
(setq process-connection-type nil)
|
||||||
|
|
||||||
(setq org-image-actual-width 200)
|
(setq org-image-actual-width 200)
|
||||||
|
|
||||||
(set-file-template! 'org-mode :ignore t)
|
(set-file-template! 'org-mode :ignore t)
|
||||||
|
|
||||||
;; If you use `org' and don't want your org files in the default location below,
|
|
||||||
;; change `org-directory'. It must be set before org loads!
|
|
||||||
(let ((default-directory user-data-dir))
|
(let ((default-directory user-data-dir))
|
||||||
(setq org-directory (expand-file-name "1-projects"))
|
(setq org-directory (expand-file-name "1-projects"))
|
||||||
(require 'org)
|
(require 'org)
|
||||||
|
@ -99,10 +114,26 @@
|
||||||
(add-hook 'org-mode-hook 'org-toggle-blocks)
|
(add-hook 'org-mode-hook 'org-toggle-blocks)
|
||||||
(add-hook 'org-mode-hook 'org-toggle-inline-images)
|
(add-hook 'org-mode-hook 'org-toggle-inline-images)
|
||||||
(add-hook 'org-mode-hook (apply-partially '+org/close-all-folds 2))
|
(add-hook 'org-mode-hook (apply-partially '+org/close-all-folds 2))
|
||||||
|
(add-hook 'org-mode-hook (apply-partially 'whitespace-mode -1))
|
||||||
|
|
||||||
;; This determines the style of line numbers in effect. If set to `nil', line
|
;; https://christiantietze.de/posts/2019/06/org-fold-heading/
|
||||||
;; numbers are disabled. For relative line numbers, set this to `relative'.
|
(defun ct/org-foldup ()
|
||||||
(setq display-line-numbers-type 'relative)
|
"Hide the entire subtree from root headline at point."
|
||||||
|
(interactive)
|
||||||
|
(while (ignore-errors (outline-up-heading 1)))
|
||||||
|
(org-flag-subtree t))
|
||||||
|
|
||||||
|
(defun ct/org-shifttab (&optional arg)
|
||||||
|
(interactive "P")
|
||||||
|
(if (or (null (org-current-level)) ; point is before 1st heading, or
|
||||||
|
(and (= 1 (org-current-level)) ; at level-1 heading, or
|
||||||
|
(org-at-heading-p))
|
||||||
|
(org-at-table-p)) ; in a table (to preserve cell movement)
|
||||||
|
; perform org-shifttab at root level elements and inside tables
|
||||||
|
(org-shifttab arg)
|
||||||
|
; try to fold up elsewhere
|
||||||
|
(ct/org-foldup)))
|
||||||
|
(define-key org-mode-map (kbd "S-<tab>") 'ct/org-shifttab)
|
||||||
|
|
||||||
;; Here are some additional functions/macros that could help you configure Doom:
|
;; Here are some additional functions/macros that could help you configure Doom:
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
;; -*- no-byte-compile: t; -*-
|
||||||
|
;;; $DOOMDIR/packages.el
|
||||||
|
|
||||||
|
;; To install a package with Doom you must declare them here and run 'doom sync'
|
||||||
|
;; on the command line, then restart Emacs for the changes to take effect -- or
|
||||||
|
;; use 'M-x doom/reload'.
|
||||||
|
|
||||||
|
|
||||||
|
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
|
||||||
|
;(package! some-package)
|
||||||
|
|
||||||
|
;; To install a package directly from a remote git repo, you must specify a
|
||||||
|
;; `:recipe'. You'll find documentation on what `:recipe' accepts here:
|
||||||
|
;; https://github.com/raxod502/straight.el#the-recipe-format
|
||||||
|
;(package! another-package
|
||||||
|
; :recipe (:host github :repo "username/repo"))
|
||||||
|
|
||||||
|
;; If the package you are trying to install does not contain a PACKAGENAME.el
|
||||||
|
;; file, or is located in a subdirectory of the repo, you'll need to specify
|
||||||
|
;; `:files' in the `:recipe':
|
||||||
|
;(package! this-package
|
||||||
|
; :recipe (:host github :repo "username/repo"
|
||||||
|
; :files ("some-file.el" "src/lisp/*.el")))
|
||||||
|
|
||||||
|
;; If you'd like to disable a package included with Doom, you can do so here
|
||||||
|
;; with the `:disable' property:
|
||||||
|
;(package! builtin-package :disable t)
|
||||||
|
|
||||||
|
;; You can override the recipe of a built in package without having to specify
|
||||||
|
;; all the properties for `:recipe'. These will inherit the rest of its recipe
|
||||||
|
;; from Doom or MELPA/ELPA/Emacsmirror:
|
||||||
|
;(package! builtin-package :recipe (:nonrecursive t))
|
||||||
|
;(package! builtin-package-2 :recipe (:repo "myfork/package"))
|
||||||
|
|
||||||
|
;; Specify a `:branch' to install a package from a particular branch or tag.
|
||||||
|
;; This is required for some packages whose default branch isn't 'master' (which
|
||||||
|
;; our package manager can't deal with; see raxod502/straight.el#279)
|
||||||
|
;(package! builtin-package :recipe (:branch "develop"))
|
||||||
|
|
||||||
|
;; Use `:pin' to specify a particular commit to install.
|
||||||
|
;(package! builtin-package :pin "1a2b3c4d5e")
|
||||||
|
|
||||||
|
|
||||||
|
;; Doom's packages are pinned to a specific commit and updated from release to
|
||||||
|
;; release. The `unpin!' macro allows you to unpin single packages...
|
||||||
|
;(unpin! pinned-package)
|
||||||
|
;; ...or multiple packages
|
||||||
|
;(unpin! pinned-package another-pinned-package)
|
||||||
|
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
|
||||||
|
;(unpin! t)
|
||||||
|
|
||||||
|
(package! annotate)
|
||||||
|
(package! visual-fill-column)
|
Loading…
Reference in New Issue