|
|
|
@ -40,6 +40,15 @@ file. The only thing needed in the main Emacs init file is this line:
|
|
|
|
|
:CUSTOM_ID: basic-setup
|
|
|
|
|
:END:
|
|
|
|
|
|
|
|
|
|
** Lexical Scoping
|
|
|
|
|
|
|
|
|
|
By default, Emacs uses dynamic binding. Some aspects of my configuration
|
|
|
|
|
rely on /lexical binding/, so that gets turned on first!
|
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
|
;; -*- lexical-binding: t; -*-
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
** Native Compilation
|
|
|
|
|
|
|
|
|
|
If (and only if) Emacs has native compilation available, set it up to
|
|
|
|
@ -88,10 +97,12 @@ startup messages, the splash screen, tool bar, and tooltips.
|
|
|
|
|
(setq warning-minimum-level :emergency
|
|
|
|
|
inhibit-startup-message t
|
|
|
|
|
inhibit-splash-screen t)
|
|
|
|
|
(tool-bar-mode -1)
|
|
|
|
|
(tooltip-mode -1)
|
|
|
|
|
(scroll-bar-mode -1)
|
|
|
|
|
(menu-bar-mode -1)
|
|
|
|
|
(when window-system
|
|
|
|
|
(progn
|
|
|
|
|
(tool-bar-mode -1)
|
|
|
|
|
(tooltip-mode -1)
|
|
|
|
|
(scroll-bar-mode -1)))
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
** Local lisp directory
|
|
|
|
@ -295,8 +306,8 @@ Then, I up some default values to make editing large directories
|
|
|
|
|
happy.
|
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
|
(setq max-lisp-eval-depth 4000) ; default is 400
|
|
|
|
|
(setq max-specpdl-size 5000) ; default is 1000
|
|
|
|
|
(setq max-lisp-eval-depth 10000) ; default is 400
|
|
|
|
|
(setq max-specpdl-size 10000) ; default is 1000
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
** Recent Files
|
|
|
|
@ -721,18 +732,13 @@ often.
|
|
|
|
|
modus-themes-completions '((matches . (extrabold))
|
|
|
|
|
(selection . (semibold accented))
|
|
|
|
|
(popup . (accented intense)))
|
|
|
|
|
modus-themes-mode-line '(accented borderless padded)))
|
|
|
|
|
modus-themes-mode-line '(accented borderless padded))
|
|
|
|
|
(load-theme 'modus-vivendi t))
|
|
|
|
|
|
|
|
|
|
(use-package olivetti
|
|
|
|
|
:ensure t
|
|
|
|
|
:config
|
|
|
|
|
(setq olivetti-body-width 90))
|
|
|
|
|
|
|
|
|
|
;;; I can never decide whether I want light or dark...
|
|
|
|
|
;;; -- vivendi is dark
|
|
|
|
|
(modus-themes-load-vivendi)
|
|
|
|
|
;;; -- operandi is light
|
|
|
|
|
;; (modus-themes-load-operandi)
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
** Org Mode
|
|
|
|
@ -898,6 +904,15 @@ directory, rather than the default behavior of renaming them to
|
|
|
|
|
(lambda ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(find-file "~/Nextcloud/agenda/agenda.org")))
|
|
|
|
|
(setq org-directory (expand-file-name "~/Nextcloud/Notes"))
|
|
|
|
|
(setq org-default-notes-file (concat org-directory "/notes.org")
|
|
|
|
|
org-capture-templates
|
|
|
|
|
'(("t" "Task" entry (file+olp+datetree "~/Nextcloud/Notes/tasks.org")
|
|
|
|
|
"* TODO %?\n%i" :empty-lines 1)
|
|
|
|
|
("j" "Journal" entry (file+datetree "~/Nextcloud/Notes/journal.org")
|
|
|
|
|
"* %?\nAdded: %U\n%i" :empty-lines 1)
|
|
|
|
|
("n" "Note" entry (file "~/Nextcloud/Notes/notes.org")
|
|
|
|
|
"* %^{Headline}\nAdded: %U\n\n%?" :empty-lines 1)))
|
|
|
|
|
(setq org-habit-show-habits-only-for-today nil
|
|
|
|
|
org-agenda-files (file-expand-wildcards "~/Nextcloud/agenda/*.org")
|
|
|
|
|
org-default-notes-file "~/Nextcloud/agenda/agenda.org")))
|
|
|
|
@ -945,20 +960,6 @@ of =C-c c=.
|
|
|
|
|
(global-set-key (kbd "C-c c") 'org-capture)
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
I also set up a couple of notes files.
|
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
|
(setq org-directory (expand-file-name "~/Nextcloud/Notes"))
|
|
|
|
|
(setq org-default-notes-file (concat org-directory "/notes.org")
|
|
|
|
|
org-capture-templates
|
|
|
|
|
'(("t" "Task" entry (file+olp+datetree "~/Nextcloud/Notes/tasks.org")
|
|
|
|
|
"* TODO %?\n%i" :empty-lines 1)
|
|
|
|
|
("j" "Journal" entry (file+datetree "~/Nextcloud/Notes/journal.org")
|
|
|
|
|
"* %?\nAdded: %U\n%i" :empty-lines 1)
|
|
|
|
|
("n" "Note" entry (file "~/Nextcloud/Notes/notes.org")
|
|
|
|
|
"* %^{Headline}\nAdded: %U\n\n%?" :empty-lines 1)))
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
*** Org-Babel Language Integration
|
|
|
|
|
|
|
|
|
|
I want to be able to support C, Emacs Lisp, shell, python, and
|
|
|
|
@ -998,45 +999,56 @@ collapsed.
|
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
|
(setq org-pretty-entities t
|
|
|
|
|
org-ellipsis "↴")
|
|
|
|
|
org-ellipsis " ↴")
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
** Org Roam
|
|
|
|
|
|
|
|
|
|
Choose the best directory for org-roam: In my Nextcloud directory,
|
|
|
|
|
if it exists, otherwise in Documents.
|
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
|
(when (file-directory-p (expand-file-name "~/Nextcloud/org-roam/"))
|
|
|
|
|
(use-package org-roam
|
|
|
|
|
:ensure t
|
|
|
|
|
:init
|
|
|
|
|
(setq org-roam-v2-ack t
|
|
|
|
|
org-roam-dailies-directory "journal/")
|
|
|
|
|
:custom
|
|
|
|
|
(org-roam-directory (expand-file-name "~/Nextcloud/org-roam/"))
|
|
|
|
|
(org-roam-completion-everywhere t)
|
|
|
|
|
(org-roam-capture-templates
|
|
|
|
|
'(("d" "default" plain
|
|
|
|
|
"%?"
|
|
|
|
|
:if-new (file+head "%<%Y%m%d>-${slug}.org"
|
|
|
|
|
"#+TITLE: ${title}\n")
|
|
|
|
|
:unnarrowed t)))
|
|
|
|
|
(org-roam-dailies-capture-templates
|
|
|
|
|
'(("d" "default" entry "\n* %?"
|
|
|
|
|
:target (file+head "%<%Y-%m-%d>.org" "#+TITLE: %u\n#+STARTUP: showall\n\n")
|
|
|
|
|
:unnarrowed nil ; Show only the current note on entry
|
|
|
|
|
:empty-lines 1)))
|
|
|
|
|
:bind (("C-c n l" . org-roam-buffer-toggle)
|
|
|
|
|
("C-c n f" . org-roam-node-find)
|
|
|
|
|
("C-c n i" . org-roam-node-insert)
|
|
|
|
|
:map org-mode-map
|
|
|
|
|
("C-M-i" . completion-at-point)
|
|
|
|
|
:map org-roam-dailies-map
|
|
|
|
|
("Y" . org-roam-dailies-capture-yesterday)
|
|
|
|
|
("T" . org-roam-dailies-capture-tomorrow))
|
|
|
|
|
:bind-keymap ("C-c n d" . org-roam-dailies-map)
|
|
|
|
|
:config
|
|
|
|
|
(require 'org-roam-dailies)
|
|
|
|
|
(org-roam-db-autosync-mode)
|
|
|
|
|
(org-roam-setup)))
|
|
|
|
|
(setq my-org-roam-directory
|
|
|
|
|
(if (file-directory-p (expand-file-name "~/Nextcloud/org-roam/"))
|
|
|
|
|
"~/Nextcloud/org-roam/"
|
|
|
|
|
"~/Documents/org-roam/"))
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
Next, ensure ~org-roam~ is installed and configured.
|
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
|
(use-package org-roam
|
|
|
|
|
:ensure t
|
|
|
|
|
:init
|
|
|
|
|
(setq org-roam-v2-ack t
|
|
|
|
|
org-roam-dailies-directory "journal/")
|
|
|
|
|
:custom
|
|
|
|
|
(org-roam-directory (expand-file-name my-org-roam-directory))
|
|
|
|
|
(org-roam-completion-everywhere t)
|
|
|
|
|
(org-roam-capture-templates
|
|
|
|
|
'(("d" "default" plain
|
|
|
|
|
"%?"
|
|
|
|
|
:if-new (file+head "%<%Y%m%d>-${slug}.org"
|
|
|
|
|
"#+TITLE: ${title}\n")
|
|
|
|
|
:unnarrowed t)))
|
|
|
|
|
(org-roam-dailies-capture-templates
|
|
|
|
|
'(("d" "default" entry "\n* %?"
|
|
|
|
|
:target (file+head "%<%Y-%m-%d>.org" "#+TITLE: %u\n#+STARTUP: showall\n\n")
|
|
|
|
|
:unnarrowed nil ; Show only the current note on entry
|
|
|
|
|
:empty-lines 1)))
|
|
|
|
|
:bind (("C-c n l" . org-roam-buffer-toggle)
|
|
|
|
|
("C-c n f" . org-roam-node-find)
|
|
|
|
|
("C-c n i" . org-roam-node-insert)
|
|
|
|
|
:map org-mode-map
|
|
|
|
|
("C-M-i" . completion-at-point)
|
|
|
|
|
:map org-roam-dailies-map
|
|
|
|
|
("Y" . org-roam-dailies-capture-yesterday)
|
|
|
|
|
("T" . org-roam-dailies-capture-tomorrow))
|
|
|
|
|
:bind-keymap ("C-c n d" . org-roam-dailies-map)
|
|
|
|
|
:config
|
|
|
|
|
(require 'org-roam-dailies)
|
|
|
|
|
(org-roam-db-autosync-mode)
|
|
|
|
|
(org-roam-setup))
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
** Org Superstar
|
|
|
|
@ -1075,6 +1087,15 @@ with nicer looking defaults using Unicode.
|
|
|
|
|
(setq auth-sources '("~/.authinfo.gpg")))
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
** Tera Mode
|
|
|
|
|
|
|
|
|
|
Tera is a templating language used by [[https://www.getzola.org/][Zola]].
|
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
|
(use-package tera-mode
|
|
|
|
|
:load-path "lisp/tera-mode")
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
** Mastodon
|
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
@ -1110,10 +1131,7 @@ additional features.
|
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
|
(use-package magit
|
|
|
|
|
:ensure t
|
|
|
|
|
:init
|
|
|
|
|
(global-set-key (kbd "C-x g") 'magit-status)
|
|
|
|
|
(add-hook 'prog-mode-hook #'git-gutter-mode))
|
|
|
|
|
:ensure t)
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
@ -1174,7 +1192,7 @@ the =snippets= directory.
|
|
|
|
|
("\\.md\\'" . markdown-mode)
|
|
|
|
|
("\\.markdown\\'" . markdown-mode))
|
|
|
|
|
:init
|
|
|
|
|
(setq markdown-command "multimarkdown")
|
|
|
|
|
(setq markdown-command "markdown")
|
|
|
|
|
:config
|
|
|
|
|
(use-package edit-indirect
|
|
|
|
|
:ensure t))
|
|
|
|
@ -1362,23 +1380,33 @@ lsp-mode.
|
|
|
|
|
:commands lsp
|
|
|
|
|
:config
|
|
|
|
|
;; Improve performance and enable features
|
|
|
|
|
(setq read-process-output-max (* 1024 1024)
|
|
|
|
|
gc-cons-threshold 100000000
|
|
|
|
|
lsp-rust-analyzer-proc-macro-enable t
|
|
|
|
|
lsp-rust-analyzer-cargo-watch-command "clippy"
|
|
|
|
|
lsp-rust-analyzer-cargo-load-out-dirs-from-check t
|
|
|
|
|
;; These three make things significantly less flashy...
|
|
|
|
|
lsp-eldoc-render-all nil
|
|
|
|
|
lsp-eldoc-hook nil
|
|
|
|
|
lsp-idle-delay 1.0
|
|
|
|
|
lsp-eldoc-hook nil
|
|
|
|
|
lsp-enable-symbol-highlighting nil
|
|
|
|
|
lsp-signature-auto-activate nil
|
|
|
|
|
;; Do not automatically include headers for me!
|
|
|
|
|
lsp-clients-clangd-args '("--header-insertion=never")
|
|
|
|
|
;; Do not auto-format for me!
|
|
|
|
|
lsp-enable-indentation nil
|
|
|
|
|
lsp-enable-on-type-formatting nil))
|
|
|
|
|
(progn
|
|
|
|
|
(setq vc-ignore-dir-regexp
|
|
|
|
|
(format "\\(%s\\)\\|\\(%s\\)" vc-ignore-dir-regexp tramp-file-name-regexp)
|
|
|
|
|
read-process-output-max (* 1024 1024)
|
|
|
|
|
gc-cons-threshold 100000000
|
|
|
|
|
vc-handled-backends '(Git) ;; Only support git
|
|
|
|
|
lsp-rust-analyzer-proc-macro-enable t
|
|
|
|
|
lsp-rust-analyzer-cargo-watch-command "clippy"
|
|
|
|
|
lsp-rust-analyzer-cargo-load-out-dirs-from-check t
|
|
|
|
|
;; These three make things significantly less flashy...
|
|
|
|
|
lsp-eldoc-render-all nil
|
|
|
|
|
lsp-eldoc-hook nil
|
|
|
|
|
lsp-idle-delay 0.5
|
|
|
|
|
lsp-eldoc-hook nil
|
|
|
|
|
lsp-enable-symbol-highlighting nil
|
|
|
|
|
lsp-signature-auto-activate nil
|
|
|
|
|
;; Do not automatically include headers for me!
|
|
|
|
|
lsp-clients-clangd-args '("--header-insertion=never")
|
|
|
|
|
;; Do not auto-format for me!
|
|
|
|
|
lsp-enable-indentation nil
|
|
|
|
|
lsp-enable-on-type-formatting nil)
|
|
|
|
|
|
|
|
|
|
(lsp-register-client
|
|
|
|
|
(make-lsp-client :new-connection (lsp-tramp-connection "/usr/bin/clangd")
|
|
|
|
|
:major-modes '(c-mode)
|
|
|
|
|
:remote? t
|
|
|
|
|
:server-id 'clangd-remote))))
|
|
|
|
|
|
|
|
|
|
(use-package lsp-ui
|
|
|
|
|
:ensure t
|
|
|
|
@ -1402,7 +1430,7 @@ lsp-mode.
|
|
|
|
|
(corfu-cycle t)
|
|
|
|
|
(corfu-auto t)
|
|
|
|
|
(corfu-auto-prefix 2)
|
|
|
|
|
(corfu-auto-delay 0.0)
|
|
|
|
|
(corfu-auto-delay 2.0)
|
|
|
|
|
(corfu-quit-at-boundary 'separator)
|
|
|
|
|
(corfu-echo-documentation 0.25)
|
|
|
|
|
(corfu-preview-current 'separator)
|
|
|
|
|