Merge remote-tracking branch 'gwydion/feature/nix-doom-emacs' into tmp

This commit is contained in:
Jez Cope 2023-07-05 21:19:53 +01:00
commit 8a42b3d5d7
7 changed files with 1294 additions and 78 deletions

View File

@ -1,5 +1,38 @@
{
"nodes": {
"doom-emacs": {
"flake": false,
"locked": {
"lastModified": 1662497747,
"narHash": "sha256-4n7E1fqda7cn5/F2jTkOnKw1juG6XMS/FI9gqODL3aU=",
"owner": "doomemacs",
"repo": "doomemacs",
"rev": "3853dff5e11655e858d0bfae64b70cb12ef685ac",
"type": "github"
},
"original": {
"owner": "doomemacs",
"repo": "doomemacs",
"rev": "3853dff5e11655e858d0bfae64b70cb12ef685ac",
"type": "github"
}
},
"doom-snippets": {
"flake": false,
"locked": {
"lastModified": 1676839496,
"narHash": "sha256-1Ay9zi0u1lycmEeFqIxr0RWH+JvH9BnzgRzkPeWEAYY=",
"owner": "doomemacs",
"repo": "snippets",
"rev": "fe4003014ae00b866f117cb193f711fd9d72fd11",
"type": "github"
},
"original": {
"owner": "doomemacs",
"repo": "snippets",
"type": "github"
}
},
"emacs-overlay": {
"inputs": {
"flake-utils": "flake-utils",
@ -22,6 +55,151 @@
"type": "github"
}
},
"emacs-overlay_2": {
"flake": false,
"locked": {
"lastModified": 1676366521,
"narHash": "sha256-i4UAY8t9Au9SJtsgYppa3NHSVf1YkV6yqnNIQd+Km4g=",
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "c16be6de78ea878aedd0292aa5d4a1ee0a5da501",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "emacs-overlay",
"rev": "c16be6de78ea878aedd0292aa5d4a1ee0a5da501",
"type": "github"
}
},
"emacs-so-long": {
"flake": false,
"locked": {
"lastModified": 1575031854,
"narHash": "sha256-xIa5zO0ZaToDrec1OFjBK6l39AbA4l/CE4LInVu2hi0=",
"owner": "hlissner",
"repo": "emacs-so-long",
"rev": "ed666b0716f60e8988c455804de24b55919e71ca",
"type": "github"
},
"original": {
"owner": "hlissner",
"repo": "emacs-so-long",
"type": "github"
}
},
"evil-collection": {
"flake": false,
"locked": {
"lastModified": 1686801899,
"narHash": "sha256-wGJWF9t8yaxLyYQRf3hK+5/AIYYAS8qWXPDEvatzBlc=",
"owner": "emacs-evil",
"repo": "evil-collection",
"rev": "4a7d924dbd851ef1b2ccb85778be6e7a6a81ebd4",
"type": "github"
},
"original": {
"owner": "emacs-evil",
"repo": "evil-collection",
"type": "github"
}
},
"evil-escape": {
"flake": false,
"locked": {
"lastModified": 1588439096,
"narHash": "sha256-aB2Ge5o/93B18tPf4fN1c+O46CNh/nOqwLJbox4c8Gw=",
"owner": "hlissner",
"repo": "evil-escape",
"rev": "819f1ee1cf3f69a1ae920e6004f2c0baeebbe077",
"type": "github"
},
"original": {
"owner": "hlissner",
"repo": "evil-escape",
"type": "github"
}
},
"evil-markdown": {
"flake": false,
"locked": {
"lastModified": 1626852210,
"narHash": "sha256-HBBuZ1VWIn6kwK5CtGIvHM1+9eiNiKPH0GUsyvpUVN8=",
"owner": "Somelauw",
"repo": "evil-markdown",
"rev": "8e6cc68af83914b2fa9fd3a3b8472573dbcef477",
"type": "github"
},
"original": {
"owner": "Somelauw",
"repo": "evil-markdown",
"type": "github"
}
},
"evil-org-mode": {
"flake": false,
"locked": {
"lastModified": 1607203864,
"narHash": "sha256-JxwqVYDN6OIJEH15MVI6XOZAPtUWUhJQWHyzcrUvrFg=",
"owner": "hlissner",
"repo": "evil-org-mode",
"rev": "a9706da260c45b98601bcd72b1d2c0a24a017700",
"type": "github"
},
"original": {
"owner": "hlissner",
"repo": "evil-org-mode",
"type": "github"
}
},
"evil-quick-diff": {
"flake": false,
"locked": {
"lastModified": 1575189609,
"narHash": "sha256-oGzl1ayW9rIuq0haoiFS7RZsS8NFMdEA7K1BSozgnJU=",
"owner": "rgrinberg",
"repo": "evil-quick-diff",
"rev": "69c883720b30a892c63bc89f49d4f0e8b8028908",
"type": "github"
},
"original": {
"owner": "rgrinberg",
"repo": "evil-quick-diff",
"type": "github"
}
},
"explain-pause-mode": {
"flake": false,
"locked": {
"lastModified": 1595842060,
"narHash": "sha256-++znrjiDSx+cy4okFBBXUBkRFdtnE2x+trkmqjB3Njs=",
"owner": "lastquestion",
"repo": "explain-pause-mode",
"rev": "2356c8c3639cbeeb9751744dbe737267849b4b51",
"type": "github"
},
"original": {
"owner": "lastquestion",
"repo": "explain-pause-mode",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@ -40,6 +218,41 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1681202837,
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"format-all": {
"flake": false,
"locked": {
"lastModified": 1581716637,
"narHash": "sha256-ul7LCe60W8TIvUmUtZtZRo8489TK9iTPDsLHmzxY57M=",
"owner": "lassik",
"repo": "emacs-format-all-the-code",
"rev": "47d862d40a088ca089c92cd393c6dca4628f87d3",
"type": "github"
},
"original": {
"owner": "lassik",
"repo": "emacs-format-all-the-code",
"rev": "47d862d40a088ca089c92cd393c6dca4628f87d3",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -60,6 +273,50 @@
"type": "github"
}
},
"nix-doom-emacs": {
"inputs": {
"doom-emacs": "doom-emacs",
"doom-snippets": "doom-snippets",
"emacs-overlay": "emacs-overlay_2",
"emacs-so-long": "emacs-so-long",
"evil-collection": "evil-collection",
"evil-escape": "evil-escape",
"evil-markdown": "evil-markdown",
"evil-org-mode": "evil-org-mode",
"evil-quick-diff": "evil-quick-diff",
"explain-pause-mode": "explain-pause-mode",
"flake-compat": "flake-compat",
"flake-utils": "flake-utils_2",
"format-all": "format-all",
"nix-straight": "nix-straight",
"nixpkgs": "nixpkgs",
"nose": "nose",
"ob-racket": "ob-racket",
"org": "org",
"org-contrib": "org-contrib",
"org-yt": "org-yt",
"php-extras": "php-extras",
"revealjs": "revealjs",
"rotate-text": "rotate-text",
"sln-mode": "sln-mode",
"ts-fold": "ts-fold",
"ws-butler": "ws-butler"
},
"locked": {
"lastModified": 1688582535,
"narHash": "sha256-HSeSSfh2ymUobASavsGZWK7eNd6BA/g80hd0qJjwySA=",
"ref": "fix/evil-collection",
"rev": "ee45d28b54a674da1fd8ccb4e9444d4890345bcc",
"revCount": 774,
"type": "git",
"url": "https://codeberg.org/jezcope/nix-doom-emacs"
},
"original": {
"ref": "fix/evil-collection",
"type": "git",
"url": "https://codeberg.org/jezcope/nix-doom-emacs"
}
},
"nix-std": {
"locked": {
"lastModified": 1685917625,
@ -75,18 +332,34 @@
"type": "github"
}
},
"nix-straight": {
"flake": false,
"locked": {
"lastModified": 1666982610,
"narHash": "sha256-xjgIrmUsekVTE+MpZb5DMU8DQf9DJ/ZiR0o30L9/XCc=",
"owner": "nix-community",
"repo": "nix-straight.el",
"rev": "ad10364d64f472c904115fd38d194efe1c3f1226",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nix-straight.el",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1688322751,
"narHash": "sha256-eW62dC5f33oKZL7VWlomttbUnOTHrAbte9yNUNW8rbk=",
"lastModified": 1682566018,
"narHash": "sha256-HPzPRFiy2o/7k7mtnwfM1E6NVZHiFbPdmYCMoIpkHO4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0fbe93c5a7cac99f90b60bdf5f149383daaa615f",
"rev": "8e3b64db39f2aaa14b35ee5376bd6a2e707cadc2",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"ref": "nixpkgs-unstable",
"type": "indirect"
}
},
@ -106,6 +379,37 @@
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1688322751,
"narHash": "sha256-eW62dC5f33oKZL7VWlomttbUnOTHrAbte9yNUNW8rbk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0fbe93c5a7cac99f90b60bdf5f149383daaa615f",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nose": {
"flake": false,
"locked": {
"lastModified": 1400604510,
"narHash": "sha256-daEi8Kta1oGaDEmUUDDQMahTTPOpvNpDKk22rlr7cB0=",
"owner": "emacsattic",
"repo": "nose",
"rev": "f8528297519eba911696c4e68fa88892de9a7b72",
"type": "github"
},
"original": {
"owner": "emacsattic",
"repo": "nose",
"type": "github"
}
},
"nur": {
"locked": {
"lastModified": 1688486175,
@ -121,15 +425,144 @@
"type": "github"
}
},
"ob-racket": {
"flake": false,
"locked": {
"lastModified": 1584656173,
"narHash": "sha256-rBUYDDCXb+3D4xTPQo9UocbTPZ32kWV1Uya/1DmZknU=",
"owner": "xchrishawk",
"repo": "ob-racket",
"rev": "83457ec9e1e96a29fd2086ed19432b9d75787673",
"type": "github"
},
"original": {
"owner": "xchrishawk",
"repo": "ob-racket",
"type": "github"
}
},
"org": {
"flake": false,
"locked": {
"lastModified": 1683136293,
"narHash": "sha256-PMHNr3Qo62uqO5IUDAfxUoqa4Zvb9y2J76pRYDB/6Y4=",
"owner": "emacs-straight",
"repo": "org-mode",
"rev": "080710797ad25e76c4556d2b03cc0aa5313cd187",
"type": "github"
},
"original": {
"owner": "emacs-straight",
"repo": "org-mode",
"type": "github"
}
},
"org-contrib": {
"flake": false,
"locked": {
"lastModified": 1675694242,
"narHash": "sha256-4Fn33CTVTCqh5TyVAggSr8Fm8/hB8Xgl+hkxh3WCrI8=",
"owner": "emacsmirror",
"repo": "org-contrib",
"rev": "fff6c888065588527b1c1d7dd7e41c29ef767e17",
"type": "github"
},
"original": {
"owner": "emacsmirror",
"repo": "org-contrib",
"type": "github"
}
},
"org-yt": {
"flake": false,
"locked": {
"lastModified": 1527381913,
"narHash": "sha256-dzQ6B7ryzatHCTLyEnRSbWO0VUiX/FHYnpHTs74aVUs=",
"owner": "TobiasZawada",
"repo": "org-yt",
"rev": "40cc1ac76d741055cbefa13860d9f070a7ade001",
"type": "github"
},
"original": {
"owner": "TobiasZawada",
"repo": "org-yt",
"type": "github"
}
},
"php-extras": {
"flake": false,
"locked": {
"lastModified": 1573312690,
"narHash": "sha256-r4WyVbzvT0ra4Z6JywNBOw5RxOEYd6Qe2IpebHXkj1U=",
"owner": "arnested",
"repo": "php-extras",
"rev": "d410c5af663c30c01d461ac476d1cbfbacb49367",
"type": "github"
},
"original": {
"owner": "arnested",
"repo": "php-extras",
"type": "github"
}
},
"revealjs": {
"flake": false,
"locked": {
"lastModified": 1681386605,
"narHash": "sha256-9Q7aWgjAV37iJp6oYDz45e8J+RKwKY1Uvgg/BXwf5nQ=",
"owner": "hakimel",
"repo": "reveal.js",
"rev": "0301ce58ab185f7191696e16b1b6389f58df2892",
"type": "github"
},
"original": {
"owner": "hakimel",
"repo": "reveal.js",
"type": "github"
}
},
"root": {
"inputs": {
"emacs-overlay": "emacs-overlay",
"home-manager": "home-manager",
"nix-doom-emacs": "nix-doom-emacs",
"nix-std": "nix-std",
"nixpkgs": "nixpkgs",
"nixpkgs": "nixpkgs_2",
"nur": "nur"
}
},
"rotate-text": {
"flake": false,
"locked": {
"lastModified": 1322962747,
"narHash": "sha256-SOeOgSlcEIsKhUiYDJv0p+mLUb420s9E2BmvZQvZ0wk=",
"owner": "debug-ito",
"repo": "rotate-text.el",
"rev": "48f193697db996855aee1ad2bc99b38c6646fe76",
"type": "github"
},
"original": {
"owner": "debug-ito",
"repo": "rotate-text.el",
"type": "github"
}
},
"sln-mode": {
"flake": false,
"locked": {
"lastModified": 1423727528,
"narHash": "sha256-XqkqPyEJuTtFslOz1fpTf/Klbd/zA7IGpzpmum/MGao=",
"owner": "sensorflo",
"repo": "sln-mode",
"rev": "0f91d1b957c7d2a7bab9278ec57b54d57f1dbd9c",
"type": "github"
},
"original": {
"owner": "sensorflo",
"repo": "sln-mode",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
@ -144,6 +577,53 @@
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"ts-fold": {
"flake": false,
"locked": {
"lastModified": 1681029086,
"narHash": "sha256-z3eVkAPFI6JYZZ+2XM496zBxwnujTp4Y4KNNfqgUC/E=",
"owner": "jcs-elpa",
"repo": "ts-fold",
"rev": "5fd2a5afe2112ac23b58ee1b12730fcf16068df3",
"type": "github"
},
"original": {
"owner": "jcs-elpa",
"repo": "ts-fold",
"type": "github"
}
},
"ws-butler": {
"flake": false,
"locked": {
"lastModified": 1634511126,
"narHash": "sha256-c0y0ZPtxxICPk+eaNbbQf6t+FRCliNY54CCz9QHQ8ZI=",
"owner": "hlissner",
"repo": "ws-butler",
"rev": "572a10c11b6cb88293de48acbb59a059d36f9ba5",
"type": "github"
},
"original": {
"owner": "hlissner",
"repo": "ws-butler",
"type": "github"
}
}
},
"root": "root",

View File

@ -7,14 +7,17 @@
home-manager.url = "github:nix-community/home-manager";
nur.url = "github:nix-community/NUR";
emacs-overlay.url = "github:nix-community/emacs-overlay";
#nix-doom-emacs.url = "github:nix-community/nix-doom-emacs";
nix-doom-emacs.url =
"git+https://codeberg.org/jezcope/nix-doom-emacs?ref=fix/evil-collection";
nix-std.url = "github:chessai/nix-std";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
emacs-overlay.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{ self, nixpkgs, home-manager, nur, emacs-overlay, nix-std, ... }@inputs:
outputs = { self, nixpkgs, home-manager, nur, emacs-overlay, nix-std
, nix-doom-emacs, ... }@inputs:
let
inherit (nixpkgs.lib) genAttrs nixosSystem;
@ -43,7 +46,7 @@
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.jez = import ./home;
users.jez = { imports = [ nix-doom-emacs.hmModule ./home ]; };
extraSpecialArgs = { inherit std; };
};
}

View File

@ -1,4 +1,4 @@
{ config, pkgs, lib, nixosConfig, std, ... }:
{ config, pkgs, lib, nixosConfig, inputs, std, ... }:
with builtins;
let

View File

@ -10,9 +10,9 @@ let
doom = "~/.emacs.d/bin/doom";
};
in {
programs.emacs = {
programs.doom-emacs = {
enable = true;
package = pkgs.emacs-unstable;
doomPrivateDir = ./doom.d;
};
home.packages = with pkgs;
@ -36,17 +36,6 @@ in {
})
];
home.file = {
".doom.d" = {
source = ./doom.d;
recursive = true;
};
".doom.d/snippets".source = ./snippets;
".doom.d/nix.el".text = ''
(add-to-list 'load-path "${pkgs.mu}/share/emacs/site-lisp/mu4e")
'';
};
programs.firefox.profiles.default.settings = {
"network.protocol-handler.expose.org-protocol" = false;
};

View File

@ -0,0 +1,746 @@
(require 'dash) ; lists
(require 's) ; strings
(require 'f) ; paths & files
(defmacro defjoiner (name joiner)
`(defun ,name (&rest lines)
(s-join ,joiner lines)))
(defjoiner spaces " ")
(defjoiner lines "\n")
(defjoiner commas ", ")
(setq user-full-name "Jez Cope"
user-mail-address (rot13 "w.pbcr@renzoyre.pb.hx")
confirm-kill-emacs nil
display-line-numbers-type t
fill-column 120
explicit-shell-file-name (executable-find "xonsh")
shell-file-name (executable-find "bash"))
(setq doom-font (font-spec :family "Iosevka"
:size (let ((wd (display-pixel-width)))
(cond ((< wd 1600) 12.0)
(t 14.0)))
:weight 'light)
doom-variable-pitch-font (font-spec :family "Iosevka Aile")
doom-theme 'doom-gruvbox
doom-themes-treemacs-theme "doom-colors")
(doom-themes-treemacs-config)
(doom-themes-org-config)
(setq avy-keys (string-to-list "aoeuhtnsid',.pgcrlyf")
lispy-avy-keys avy-keys)
(after! ace-window
(setq aw-keys (-slice avy-keys 0 20)))
(add-hook 'focus-out-hook (lambda () (evil-write-all nil)))
(defun clear-popup-rule! (pred)
(assoc-delete-all pred +popup--display-buffer-alist))
(defun clear-popup-rules! (&rest preds)
(dolist (pred preds)
(clear-popup-rule! pred)))
(plist-put! +popup-defaults
:size 0.38 ;; golden ratio!
:side 'right)
(clear-popup-rules! "^\\*info\\*$")
(set-popup-rules!
'(("^\\*\\([Hh]elp\\|Apropos\\)"
:side right :slot 2 :vslot -8 :size 0.38 :select t)
("^\\*info\\*$"
:side right :size 0.38 :slot 2 :vslot 1)
("^\\*\\(?:doom\\)?:scratch"
:side right size 0.38)
("^\\*eww\\*"
:actions (+popup-display-buffer-stacked-side-window-fn)
:side right :size 0.62 :slot 1 :vslot 1)
("^\\*Capture\\*$\\|CAPTURE-.*$"
:side left :size 0.38 :quit nil :select t :autosave ignore)
("^\\*Org Src"
;; :actions (display-buffer-use-some-window)
:side right :size 80
:quit nil :select t :autosave t :modeline t :ttl nil)))
(use-package org-crypt
:after (org)
:config
(org-crypt-use-before-save-magic)
:init
(setq org-tags-exclude-from-inheritance '("crypt")
org-crypt-key "D9DA 3E47 E8BD 377D A317 B3D0 9E42 CE07 1C45 59D1"
auto-save-default nil))
(setq ispell-dictionary "en_GB")
(setq +format-on-save-enabled-modes
'(python-mode nix-mode))
(nconc +doom-dashboard-menu-sections
'(("RSS feeds"
:icon
(all-the-icons-octicon "rss" :face 'doom-dashboard-menu-title)
:when (fboundp 'elfeed)
:action elfeed)))
(defun doom-dashboard-widget-simple-title ()
(insert
"\n\n"
(+doom-dashboard--center
+doom-dashboard--width
"D O O M E M A C S")
"\n"))
(when (< (display-pixel-height) 1080)
(setq +doom-dashboard-functions
(cons 'doom-dashboard-widget-simple-title
(delq 'doom-dashboard-widget-banner
+doom-dashboard-functions))))
(setq doom-scratch-initial-major-mode 'org-mode)
(map! :n "g C-l" #'link-hint-copy-link
:n "g M-l" #'link-hint-open-link)
(use-package! projectile
:config
(add-to-list 'projectile-globally-ignored-directories ".sync"))
(setenv "SSH_AUTH_SOCK" (f-join "/run/user" (prin1-to-string (user-uid)) "gnupg/S.gpg-agent.ssh"))
(setq monky-process-type 'cmdserver)
(after! eww
(require 'ol-eww))
(add-hook! org-mode #'org-indent-mode #'+org-pretty-mode)
(setq org-superstar-headline-bullets-list '("" "" "" "" "")
org-superstar-item-bullet-alist '((?- . ?•)
(?+ . ?⬝)
(?* . ?★)))
(map! :map org-mode-map
:localleader :n "sp" #'org-paste-subtree)
(general-add-hook 'org-insert-heading-hook
'evil-insert-state
t) ;; append instead of prepending
(after! org
(setq jc/notes-dir (f-expand "~/Notes")
jc/logbook-file (f-expand "logbook.org" jc/notes-dir)
org-directory jc/notes-dir
org-roam-directory (f-expand "Roam/" jc/notes-dir)
org-roam-dailies-directory "daily/"
org-id-locations-file (f-expand ".orgids" org-directory)
jc/agenda-file-home (f-expand "Todo/todo-home.org" jc/notes-dir)
jc/agenda-file-work (f-expand "Todo/todo-work.org" jc/notes-dir)
jc/agenda-files-all (list jc/agenda-file-work jc/agenda-file-home)
org-agenda-files jc/agenda-files-all
jc/spark-file (f-expand "spark.org" org-roam-directory)
jc/agenda-file-sets (cons jc/agenda-files-all (mapcar 'list jc/agenda-files-all))
org-archive-location "%s_archive::datetree/"
jc/agenda-file-home-archive (concat jc/agenda-file-home "_archive")
jc/agenda-file-work-archive (concat jc/agenda-file-work "_archive")))
(add-to-list 'auto-mode-alist '("\\.org_archive\\'" . org-mode))
(defvar jc/agenda-file-sets '() "List of agenda file sets")
(defun list-successor (x xs)
(if (null xs) nil
(let ((y (car xs))
(ys (cdr xs)))
(or (catch 'result
(while ys
(if (equal x y)
(throw 'result (car ys))
(setq y (car ys)
ys (cdr ys)))))
(car xs)))))
(defun jc/agenda-file-set-next ()
(interactive)
(let ((next-set (list-successor org-agenda-files jc/agenda-file-sets)))
(setq org-agenda-files next-set))
(message (format "Current agenda files: %s" org-agenda-files)))
(defun jc/agenda-file-set-choose ()
(interactive)
(let ((sets
(--map (cons (s-join "+" it) it)
jc/agenda-file-sets)))
(ivy-read "Set:" sets
:action (lambda (result) (setq org-agenda-files (cdr result))))))
(after! org
(setq org-refile-targets `((,jc/agenda-files-all . (:maxlevel . 3))
(,jc/spark-file . (:maxlevel . 2))
(nil . (:maxlevel . 3)))
org-refile-use-outline-path t))
(use-package! org-protocol)
(add-hook 'org-capture-mode-hook 'evil-insert-state t)
(defun jc/org-id-gen (&optional node)
(org-id-new))
(setq org-capture-templates
`(("t" "Task" entry
(file "/home/jez/Notes/Todo/inbox.org")
"* TODO %?")
("n" "Note" entry
(file "/home/jez/Notes/Todo/inbox.org")
"* %?")
("l" "Link" entry
(file "/home/jez/Notes/Todo/inbox.org")
"* TOREAD %? %:annotation")
("L" "Link task" entry
(file "/home/jez/Notes/Todo/inbox.org")
"* TODO %? %:annotation"))
org-protocol-default-template-key "l"
org-roam-capture-templates
`(("d" "default" plain
,(lines "categories: %?" "related: ")
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
"#+title: ${title}\n")
:empty-lines 1
:unnarrowed t)
("w" "work" plain "%?"
:if-new (file+head "work/%<%Y%m%d%H%M%S>-${slug}.org"
"#+title: ${title}\n")
:empty-lines 1
:unnarrowed t)
("b" "blog" entry
,(lines "* ${title}" "" "%?")
:if-new (file+olp "writing/blog.org" ("Ideas"))
:empty-lines 1
:narrowed t))
org-roam-capture-ref-templates
'(("r" "ref" plain "%?"
:if-new (file+head "${slug}.org"
"#+title: ${title}")
:unnarrowed t))
org-roam-dailies-capture-templates
'(("d" "default" entry "* %?"
:if-new (file+head "%<%Y/%m/%Y-%m-%d>.org"
"#+title: Daily notes: %<%a %d %b %Y>\n\n"))
("c" "clocking" entry nil
:if-new (file+datetree "clocking.org" week)
:clock-in))
orb-templates
'(("r" "ref" plain
#'org-roam-capture--get-point
""
:file-name "bibliography/${citekey}"
:head "#+title: ${title}\n#+roam_key: ${ref}\n"
:unnarrowed t)))
(setq org-todo-keywords
'((sequence "TODO(t)" "COOL(c)" "WARM(w)" "HOT(h)" "DOING(o!)" "|" "DONE(d!)" "DROPPED(x@)")
(sequence "WAITING(a@)" "DELEGATED(l@)" "DISCUSS(s)" "MONITOR(m)" "ONHOLD(H)" "|")
(sequence "TOREAD" "READING" "|" "READ"))
org-enforce-todo-dependencies t)
(setq org-tags-exclude-from-inheritance '("track" "project")
org-id-track-globally t
org-id-link-to-org-use-id t)
(setq org-src-preserve-indentation nil)
(use-package! ob-http
:after org-babel
:commands ob-http-mode)
(setq org-roam-db-update-method 'immediate
org-roam-tag-sources '(prop first-directory)
org-roam-graph-exclude-matcher "daily/"
org-roam-graph-extra-config '(("rankdir" . "LR")
("concentrate" . "true"))
org-roam-graph-edge-extra-config '(("dir" . "none"))
org-roam-node-display-template
"${doom-hierarchy:*} ${doom-subdirs:20} ${tags:20}"
+org-roam-open-buffer-on-find-file nil)
(unless (f-exists? org-roam-directory)
(f-mkdir org-roam-directory))
(defun jc/search-org-roam () "search org-roam with ripgrep"
(interactive)
(counsel-rg nil org-roam-directory
"" "org-roam search: "))
(map! :leader :desc "org-roam search" :n "sR" #'jc/search-org-roam)
(map! :localleader :mode org-mode :n "mx" #'org-roam-extract-subtree)
(require 'org-roam-protocol)
(use-package! citar
:when (featurep! :completion vertico)
:after embark
:defer t
:config
(add-to-list 'embark-keymap-alist '(bib-reference . citar-map)))
(setq bibtex-autokey-names 1
bibtex-autokey-additional-names ".ea"
bibtex-autokey-name-separator "."
bibtex-autokey-name-case-convert 'identity
bibtex-autokey-name-year-separator "_"
bibtex-autokey-year-length 4
bibtex-autokey-year-title-separator "_"
bibtex-autokey-titleword-length 10
bibtex-autokey-titlewords 1
bibtex-autokey-titlewords-stretch 1
bibtex-autokey-titleword-case-convert 'capitalize
bibtex-entry-format '(opts-or-alts
required-fields
numerical-fields
whitespace
sort-fields)
bibtex-completion-notes-path
(f-expand "bibliography" org-roam-directory)
bibtex-completion-bibliography
(f-expand "bibliography.bib" bibtex-completion-notes-path)
bibtex-completion-library-path
(f-expand "files" bibtex-completion-notes-path)
org-ref-default-bibliography (list bibtex-completion-bibliography)
org-ref-pdf-directory bibtex-completion-library-path)
(use-package! bibtex
:defer
:config
(bibtex-set-dialect 'BibTeX))
(use-package! org-ref-ivy
:after (org-ref))
(defvar bibtex-rmapi-destination "/Reading"
"The folder on tablet to send PDFs to (starts with a '/')")
(defun bibtex-completion-rmapi-function (file)
(message "Sending %s to %s on reMarkable" file bibtex-rmapi-destination)
(start-process
"rmapi" "*rmapi*"
"rmapi" "put" file bibtex-rmapi-destination))
(defun bibtex-completion-send-to-rmapi (keys &optional fallback-action)
"Send the PDFs associated with the marked entries to reMarkable tablet
If multiple PDFs are found for an entry, ask for the one to open
using `completion-read'."
(let ((bibtex-completion-pdf-open-function 'bibtex-completion-rmapi-function))
(bibtex-completion-open-pdf keys)))
(with-eval-after-load 'ivy-bibtex
(ivy-bibtex-ivify-action bibtex-completion-send-to-rmapi ivy-bibtex-send-to-rmapi)
(ivy-add-actions
'ivy-bibtex
'(("R" ivy-bibtex-send-to-rmapi "Send to reMarkable tablet"))))
(defun jc/agenda-line-blocked-p (item)
(get-text-property 0 'org-todo-blocked item))
(setq org-agenda-dim-blocked-tasks t)
(use-package! org-super-agenda
:after (org-agenda)
:config
(setq org-super-agenda-groups
'((:name "Future"
:and (:todo t :scheduled future)
:order 6)
(:name "Active projects"
:and (:todo t :children ("TODO" "COOL" "WARM" "HOT" "DOING"))
:order 15)
(:name "Waiting projects"
:and (:todo t :children ("WAITING" "DELEGATED"))
:order 14)
(:name "On hold"
:and (:children nil :todo "ONHOLD")
:order 4)
(:name "On-hold projcts"
:and (:todo t :children "ONHOLD")
:and (:tag "project" :todo "ONHOLD")
:order 14)
(:name "Stuck projects"
:tag "project"
:and (:todo t :children t)
:order 13)
(:name "Overdue"
:and (:todo t :deadline past)
:face (:foreground "red"))
(:name "Due today"
:and (:todo t :deadline today)
:face (:foreground "orange"))
(:name "Due tomorrow"
:and (:todo t :deadline +2))
(:name "Blocked"
:and (:todo t :pred jc/agenda-line-blocked-p)
:order 8)
(:name "Doing (3)"
:todo "DOING")
(:name "Hot (3)"
:todo "HOT")
(:name "Warm (5)"
:todo "WARM")
(:name "Cool (8)"
:todo "COOL")
(:name "Backlog"
:todo "TODO"
:order 1)
(:name "Waiting"
:todo "WAITING"
:order 2)
(:name "Delegated"
:todo "DELEGATED"
:order 4)))
(org-super-agenda-mode 1))
(setq org-ql-views
(let ((kanban-query '(and (todo "DOING" "HOT" "WARM" "COOL" "TODO" "WAITING")
(not (or (scheduled :from tomorrow)
(property "Project" "t")
(children))))))
`(("Working: Contexts"
:title "Tasks by context"
:buffers-files org-agenda-files
:query (and (not (or (done) (todo "ONHOLD" "WAITING" "DELEGATED")) )
(not (scheduled :from tomorrow))
(tags "email" "phone" "online"))
:sort todo
:super-groups ((:auto-tags t)))
("Kanban: work"
:title "Kanban: work"
:buffers-files (,jc/agenda-file-work)
:query ,kanban-query
:super-groups org-super-agenda-groups)
("Kanban: home"
:title "Kanban: home"
:buffers-files (,jc/agenda-file-home)
:query ,kanban-query
:super-groups org-super-agenda-groups)
("Focus: work"
:title "Focus"
:buffers-files (,jc/agenda-file-work)
:query (and (todo "DOING" "HOT")
(not (or (scheduled :from tomorrow)
(property "Project" "t")
(children))))
:super-groups org-super-agenda-groups)
("Working: People agendas"
:title "Agendas"
:buffers-files (,jc/agenda-file-work)
:query (and (todo "DELEGATED" "WAITING" "DISCUSS")
(tags "BlaM" "BluM" "RK"))
:super-groups ((:auto-tags t)))
("Process: Inbox"
:buffers-files ,(f-expand "Todo/inbox.org" jc/notes-dir))
("Review: Recently closed"
:title "Closed in the last 2 weeks"
:buffers-files ,(list jc/agenda-file-work jc/agenda-file-work-archive)
:query (closed :from -14)
:super-groups ((:auto-ts t)))
("Review: Projects"
:buffers-files org-agenda-files
:query (and (todo)
(or (tags "project")
(children)))
:super-groups ((:name "Progressing"
:order 15
:children ("TODO" "COOL" "WARM" "HOT" "DOING"))
(:name "Discussion needed"
:order 4
:children ("DISCUSS"))
(:name "Waiting"
:order 10
:children ("WAITING" "DELEGATED"))
(:name "On hold"
:order 10
:children ("ONHOLD"))
(:name "Stalled"
:order 0
:anything t)))
("Review: Strategic areas"
:buffers-files org-agenda-files
:query (property "Track")
:super-groups ((:name "Progressing"
:order 5
:children ("TODO" "COOL" "WARM" "HOT" "DOING"))
(:name "Discussion needed"
:order 4
:children ("DISCUSS"))
(:name "Waiting"
:order 10
:children ("WAITING" "DELEGATED"))
(:name "On hold"
:order 10
:children ("ONHOLD"))
(:name "Stalled"
:order 0
:anything t))))))
(map! :leader :desc "Org-ql views" :n "oq" #'org-ql-view)
(defhydra jc/agenda-views ()
"agendas"
("f" jc/agenda-file-set-choose
"choose agenda file set")
("ht"
(org-ql-search (list jc/agenda-file-home) '(todo)
:super-groups org-super-agenda-groups)
"home tasks")
("hk"
(org-ql-view "Kanban: home")
"home kanban")
("wt"
(org-ql-search (list jc/agenda-file-work) '(todo)
:super-groups org-super-agenda-groups)
"work tasks")
("wk"
(org-ql-view "Kanban: work")
"work kanban"))
(map! :leader :n "oa" #'jc/agenda-views/body)
(setq org-duration-format 'h:mm)
(defun jc/org-clock-choose-time (&optional select)
(interactive "P")
(let ((at-time (encode-time (parse-time-string (org-read-date t))))
(org-clock-continuously t))
(org-clock-out nil nil at-time)
(org-clock-in select at-time)))
(use-package! deft
:custom
(deft-extensions '("md" "org" "txt"))
(deft-default-extension "md")
(deft-directory "~/Scratch/ZettelTest")
(deft-use-filename-as-title t))
(use-package! zetteldeft
:after deft
:config
(setq zetteldeft-link-indicator "[["
zetteldeft-link-suffix "]]"
zetteldeft-title-prefix "# "
zetteldeft-list-prefix "- ")
(font-lock-add-keywords 'markdown-mode
`((,zetteldeft-id-regex
. font-lock-warning-face))))
(setq browse-url-browser-function #'eww-browse-url
browse-url-generic-program "xdg-open")
(map! :leader :desc "Web search" :n "sw" #'eww-search-words)
(after! elfeed
(setq elfeed-search-filter "@6-month-ago +unread")
(clear-popup-rules! "^\\*elfeed-entry")
(set-popup-rule!
"^\\*elfeed-entry"
:actions '(+popup-display-buffer-stacked-side-window-fn)
:side 'right :size 0.62 :slot 1 :vslot 1))
(setq elfeed-db-directory (f-join jc/notes-dir "Data" "elfeed")
rmh-elfeed-org-files
(list (f-expand "feeds.org" org-roam-directory)))
(map! :map elfeed-show-mode-map
:n "gy" #'link-hint-copy-link
:n "gl" #'link-hint-open-link)
(use-package! elpher
:commands (elpher)
:config
(setq elpher-ipv4-always t))
(setq gnutls-verify-error nil)
(defun jc/fix-python-date (str)
(replace-regexp-in-string "\\([+-][0-9][0-9]\\)\\([0-9][0-9]\\)"
"\\1:\\2"
str))
(defun jc/update-post-date ()
(interactive)
(save-mark-and-excursion
(goto-char (point-min))
(re-search-forward "^date:")
(move-beginning-of-line 1)
(kill-line)
(insert (jc/fix-python-date (format-time-string "date: %FT%T%z")))))
(map! :leader :desc "Run shell command" "!" #'shell-command)
(set-email-account!
"main"
`((user-full-name . "Jez Cope")
(user-mail-address . "j.cope@erambler.co.uk")
(mu4e-compose-signature . "---\nJez Cope")
(mu4e-drafts-folder . "/main/Drafts")
(mu4e-trash-folder . "/main/Trash")
(mu4e-sent-folder . "/main/Sent")
(mu4e-refile-folder . jc/make-refile-folder))
t)
(defun jc/make-refile-folder (msg)
(format-time-string "/main/Archives.%Y"
(mu4e-msg-field msg :date)))
(setq mu4e-split-view 'vertical
mu4e-headers-visible-columns 80
mu4e-headers-sort-direction 'ascending
mu4e-headers-sort-field ':date
mu4e-headers-include-related nil
mu4e-bookmarks
'((:name "Unified Inbox"
:query "m:\"/main/Inbox\" OR m:\"/main/Triage.*\""
:key ?I)
(:name "Inbox"
:query "m:\"/main/Inbox\""
:key ?i)
(:name "Unread messages"
:query "flag:unread AND NOT flag:trashed AND NOT m:/main/Junk"
:key ?u)
(:name "Today's messages"
:query "date:today..now AND NOT m:/main/Junk"
:key ?t)
(:name "Last 7 days"
:query "date:7d..now AND NOT m:/main/Junk"
:hide-unread t
:key ?w)
(:name "Flagged messages"
:query "flag:flagged AND NOT m:/main/Junk"
:key ?f))
mu4e-headers-actions
'(("capture message" . mu4e-action-capture-message)
("show this thread" . mu4e-action-show-thread)))
(after! (mu4e-mark mu4e-headers evil-collection-mu4e)
(setq mu4e-junk-folder "/main/Junk"
mu4e-marks
(append
'((archive
:char ("a" . "")
:prompt "archive"
:dyn-target (lambda (target msg)
(mu4e-get-refile-folder msg))
:action (lambda (docid msg target)
(mu4e~proc-move docid
(mu4e~mark-check-target target)
"+S-u-N")))
(junk
:char ("J" . "🗑")
:prompt "Junk"
:show-target (lambda (target) "junk")
:action (lambda (docid msg target)
(mu4e~proc-move docid
(mu4e~mark-check-target mu4e-junk-folder)
"+S-u-N"))))
mu4e-marks))
(mu4e~headers-defun-mark-for junk)
(mu4e~headers-defun-mark-for archive)
(map! :mode mu4e-headers-mode
:n "zJ" #'mu4e-headers-mark-for-junk
:n "r" #'mu4e-headers-mark-for-archive))
(after! mu4e
(setq sendmail-program (executable-find "msmtp")
send-mail-function #'smtpmail-send-it
message-sendmail-f-is-evil t
message-sendmail-extra-arguments '("--read-envelope-from")
message-send-mail-function #'message-send-mail-with-sendmail
mu4e-compose--org-msg-toggle-next nil))
(setq-default flycheck-disabled-checkers '())
(add-to-list 'auto-mode-alist '("\\.tmpl\\'" . web-mode))
(setq web-mode-engines-alist
'(("go" . "/layouts/.*\\.html\\'"))
web-mode-enable-engine-detection t)
(add-to-list 'auto-mode-alist '("Pipfile\\'" . toml-mode))
(use-package! prism
:custom
(prism-parens t)
(prism-lightens '(0))
(prism-desaturations '(0)))
(after! elisp-mode
(remove-hook! emacs-lisp-mode #'rainbow-delimiters-mode))
(after! tex
(remove-hook! TeX-update-style #'rainbow-delimiters-mode))
(use-package! aggressive-indent
:hook (emacs-lisp-mode . aggressive-indent-mode))
(cl-pushnew 'emacs-lisp-checkdoc
flycheck-disabled-checkers)
(use-package! symex
:custom
(symex-modal-backend 'evil)
(symex-highlight-p t)
:init
(setq symex--user-evil-keyspec
'(("j" . symex-go-up)
("k" . symex-go-down)
("C-j" . symex-climb-branch)
("C-k" . symex-descend-branch)
("M-j" . symex-goto-highest)
("M-k" . symex-goto-lowest)))
:config
(symex-initialize)
:bind (:map evil-normal-state-map
("s-;" . symex-mode-interface)))
(when (equal (system-name) "WXLT203936")
(setq url-proxy-services '(("no_proxy" . "bl\\.uk")
("http" . "public-cache.bl.uk:3128")
("https" . "public-cache.bl.uk:3128"))
spell-checking-enable-by-default nil
jc/notes-dir "f:/Notes"))

View File

@ -4,17 +4,15 @@
* Preamble
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(require 'dash) ; lists
(require 's) ; strings
(require 'f) ; paths & files
(load-file "~/.doom.d/nix.el")
#+end_src
** Utilities
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(defmacro defjoiner (name joiner)
`(defun ,name (&rest lines)
(s-join ,joiner lines)))
@ -26,7 +24,7 @@
* Overall configuration
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq user-full-name "Jez Cope"
user-mail-address (rot13 "w.pbcr@renzoyre.pb.hx")
@ -40,7 +38,7 @@
** Appearance
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq doom-font (font-spec :family "Iosevka"
:size (let ((wd (display-pixel-width)))
(cond ((< wd 1600) 12.0)
@ -58,7 +56,7 @@
** Avy key tweaks
Theory: alternating left/right, 1st to 4th finger then middle column, home row -> upper row -> lower row
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq avy-keys (string-to-list "aoeuhtnsid',.pgcrlyf")
lispy-avy-keys avy-keys)
(after! ace-window
@ -67,7 +65,7 @@ Theory: alternating left/right, 1st to 4th finger then middle column, home row -
** Save all on focus-out
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(add-hook 'focus-out-hook (lambda () (evil-write-all nil)))
#+end_src
@ -75,7 +73,7 @@ Theory: alternating left/right, 1st to 4th finger then middle column, home row -
Most monitors are wide these days: prefer the right-hand side to the bottom for popups.
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(defun clear-popup-rule! (pred)
(assoc-delete-all pred +popup--display-buffer-alist))
(defun clear-popup-rules! (&rest preds)
@ -107,7 +105,7 @@ Most monitors are wide these days: prefer the right-hand side to the bottom for
** Encryption
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package org-crypt
:after (org)
:config
@ -121,7 +119,7 @@ Most monitors are wide these days: prefer the right-hand side to the bottom for
** Spelling
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq ispell-dictionary "en_GB")
#+end_src
@ -129,14 +127,14 @@ Most monitors are wide these days: prefer the right-hand side to the bottom for
Disable format-on-save for Rust, since it seems to complain...
#+BEGIN_SRC elisp
#+BEGIN_SRC emacs-lisp :tangle yes
(setq +format-on-save-enabled-modes
'(python-mode nix-mode))
#+END_SRC
** Dashboard
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(nconc +doom-dashboard-menu-sections
'(("RSS feeds"
:icon
@ -161,13 +159,13 @@ Disable format-on-save for Rust, since it seems to complain...
** Scratch buffer
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq doom-scratch-initial-major-mode 'org-mode)
#+end_src
** Link hints
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(map! :n "g C-l" #'link-hint-copy-link
:n "g M-l" #'link-hint-open-link)
#+end_src
@ -176,7 +174,7 @@ Disable format-on-save for Rust, since it seems to complain...
** Projectile
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package! projectile
:config
(add-to-list 'projectile-globally-ignored-directories ".sync"))
@ -186,26 +184,26 @@ Disable format-on-save for Rust, since it seems to complain...
The environment variable ~SSH_AUTH_SOCK~ needs to be set for git to work within emacs.
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setenv "SSH_AUTH_SOCK" (f-join "/run/user" (prin1-to-string (user-uid)) "gnupg/S.gpg-agent.ssh"))
#+end_src
** Mercurial
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq monky-process-type 'cmdserver)
#+end_src
* Note-taking & organisation
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(after! eww
(require 'ol-eww))
#+end_src
** Appearance
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(add-hook! org-mode #'org-indent-mode #'+org-pretty-mode)
(setq org-superstar-headline-bullets-list '("◉" "○" "●" "⋄" "►")
@ -216,14 +214,14 @@ The environment variable ~SSH_AUTH_SOCK~ needs to be set for git to work within
** Bindings
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(map! :map org-mode-map
:localleader :n "sp" #'org-paste-subtree)
#+end_src
** Behaviour tweaks
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(general-add-hook 'org-insert-heading-hook
'evil-insert-state
t) ;; append instead of prepending
@ -231,7 +229,7 @@ The environment variable ~SSH_AUTH_SOCK~ needs to be set for git to work within
** File locations
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(after! org
(setq jc/notes-dir (f-expand "~/Notes")
jc/logbook-file (f-expand "logbook.org" jc/notes-dir)
@ -258,7 +256,7 @@ The environment variable ~SSH_AUTH_SOCK~ needs to be set for git to work within
*** File sets
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(defvar jc/agenda-file-sets '() "List of agenda file sets")
(defun list-successor (x xs)
@ -290,7 +288,7 @@ The environment variable ~SSH_AUTH_SOCK~ needs to be set for git to work within
** Refiling
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(after! org
(setq org-refile-targets `((,jc/agenda-files-all . (:maxlevel . 3))
(,jc/spark-file . (:maxlevel . 2))
@ -300,7 +298,7 @@ The environment variable ~SSH_AUTH_SOCK~ needs to be set for git to work within
** Capture
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package! org-protocol)
(add-hook 'org-capture-mode-hook 'evil-insert-state t)
@ -311,7 +309,7 @@ The environment variable ~SSH_AUTH_SOCK~ needs to be set for git to work within
:ID: 18709859-c3db-4d0e-a4a0-e797b58a2e07
:END:
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(defun jc/org-id-gen (&optional node)
(org-id-new))
@ -373,7 +371,7 @@ The environment variable ~SSH_AUTH_SOCK~ needs to be set for git to work within
** Todo
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq org-todo-keywords
'((sequence "TODO(t)" "COOL(c)" "WARM(w)" "HOT(h)" "DOING(o!)" "|" "DONE(d!)" "DROPPED(x@)")
(sequence "WAITING(a@)" "DELEGATED(l@)" "DISCUSS(s)" "MONITOR(m)" "ONHOLD(H)" "|")
@ -384,7 +382,7 @@ The environment variable ~SSH_AUTH_SOCK~ needs to be set for git to work within
** Properties
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq org-tags-exclude-from-inheritance '("track" "project")
org-id-track-globally t
@ -393,13 +391,13 @@ The environment variable ~SSH_AUTH_SOCK~ needs to be set for git to work within
** Source blocks
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq org-src-preserve-indentation nil)
#+end_src
*** HTTP
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package! ob-http
:after org-babel
:commands ob-http-mode)
@ -409,7 +407,7 @@ The environment variable ~SSH_AUTH_SOCK~ needs to be set for git to work within
See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq org-roam-db-update-method 'immediate
org-roam-tag-sources '(prop first-directory)
@ -443,7 +441,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package! citar
:when (featurep! :completion vertico)
:after embark
@ -492,7 +490,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
*** reMarkable bibtex-completion integration
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(defvar bibtex-rmapi-destination "/Reading"
"The folder on tablet to send PDFs to (starts with a '/')")
@ -521,7 +519,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
*** Super agenda
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(defun jc/agenda-line-blocked-p (item)
(get-text-property 0 'org-todo-blocked item))
(setq org-agenda-dim-blocked-tasks t)
@ -583,7 +581,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
*** Org query language
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq org-ql-views
(let ((kanban-query '(and (todo "DOING" "HOT" "WARM" "COOL" "TODO" "WAITING")
(not (or (scheduled :from tomorrow)
@ -680,7 +678,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
:ID: 722c24c5-69b8-4397-a853-f713f5e55390
:END:
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(defhydra jc/agenda-views ()
"agendas"
("f" jc/agenda-file-set-choose
@ -705,7 +703,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
** Clocking
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq org-duration-format 'h:mm)
(defun jc/org-clock-choose-time (&optional select)
@ -718,7 +716,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
** Deft
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package! deft
:custom
(deft-extensions '("md" "org" "txt"))
@ -743,7 +741,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
** Web
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq browse-url-browser-function #'eww-browse-url
browse-url-generic-program "xdg-open")
@ -752,7 +750,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
** RSS feeds
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(after! elfeed
(setq elfeed-search-filter "@6-month-ago +unread")
@ -773,7 +771,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
** Gopher & gemini
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package! elpher
:commands (elpher)
:config
@ -786,7 +784,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
** Blogging
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(defun jc/fix-python-date (str)
(replace-regexp-in-string "\\([+-][0-9][0-9]\\)\\([0-9][0-9]\\)"
"\\1:\\2"
@ -804,7 +802,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
** Shell
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(map! :leader :desc "Run shell command" "!" #'shell-command)
#+end_src
@ -812,7 +810,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
*** Accounts
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(set-email-account!
"main"
`((user-full-name . "Jez Cope")
@ -828,7 +826,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
*** Reading
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(defun jc/make-refile-folder (msg)
(format-time-string "/main/Archives.%Y"
(mu4e-msg-field msg :date)))
@ -898,7 +896,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
*** Sending
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(after! mu4e
(setq sendmail-program (executable-find "msmtp")
send-mail-function #'smtpmail-send-it
@ -910,7 +908,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
* Languages/modes
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq-default flycheck-disabled-checkers '())
#+end_src
@ -918,7 +916,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
*** Templating (~web-mode~)
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(add-to-list 'auto-mode-alist '("\\.tmpl\\'" . web-mode))
(setq web-mode-engines-alist
'(("go" . "/layouts/.*\\.html\\'"))
@ -928,7 +926,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
** Python
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(add-to-list 'auto-mode-alist '("Pipfile\\'" . toml-mode))
#+end_src
@ -936,7 +934,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
*** Syntax highlighting
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package! prism
:custom
(prism-parens t)
@ -951,21 +949,21 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
*** Formatting
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package! aggressive-indent
:hook (emacs-lisp-mode . aggressive-indent-mode))
#+end_src
*** Syntax checking (flycheck)
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(cl-pushnew 'emacs-lisp-checkdoc
flycheck-disabled-checkers)
#+end_src
*** Navigation (symex)
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package! symex
:custom
(symex-modal-backend 'evil)
@ -988,7 +986,7 @@ See also [[id:18709859-c3db-4d0e-a4a0-e797b58a2e07][Capture templates]]
** Work laptop
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(when (equal (system-name) "WXLT203936")
(setq url-proxy-services '(("no_proxy" . "bl\\.uk")
("http" . "public-cache.bl.uk:3128")

View File

@ -140,5 +140,5 @@
;;twitter ; twitter client https://twitter.com/vnought
:config
literate
;literate
(default +bindings +smartparens))