about summary refs log tree commit diff
path: root/nix/hosts
diff options
context:
space:
mode:
authorEmile <git@emile.space>2025-01-23 16:17:09 +0100
committerEmile <git@emile.space>2025-01-23 16:17:09 +0100
commit7dde7c2a15c1f468ad54887d9ab2db4563c7d407 (patch)
tree6afb6f96d1c8a70defa6c373efb8fb216e17040c /nix/hosts
parent41088d5449e3e163159d536f437ca16d826058b6 (diff)
caladan: emacs changes
Diffstat (limited to 'nix/hosts')
-rw-r--r--nix/hosts/caladan/home_emile.nix106
1 files changed, 101 insertions, 5 deletions
diff --git a/nix/hosts/caladan/home_emile.nix b/nix/hosts/caladan/home_emile.nix
index 698b5d0..2b9ccce 100644
--- a/nix/hosts/caladan/home_emile.nix
+++ b/nix/hosts/caladan/home_emile.nix
@@ -1,4 +1,3 @@
-
 { pkgs, ... }:
 
 {
@@ -66,10 +65,11 @@
       package = pkgs.emacs;
       extraPackages =
         epkgs: with epkgs; [
-          nix-mode
-          magit
-          parinfer-rust-mode
-          tuareg
+          nix-mode # Nix
+          magit # Git
+          parinfer-rust-mode # Lisp Parens
+          tuareg # OCaml
+          howm # Notes
         ];
       extraConfig = ''
         (require 'package)
@@ -244,6 +244,33 @@
           :ensure nil ; no need to install it as it is built-in, but needs to be activated
           :hook (after-init . delete-selection-mode))
 
+        ; howm mode
+        ; (require 'howm)
+        (use-package howm
+          :ensure t
+          :init
+          ;; Where to store the files?
+          (setq howm-file-name-format "%Y/%m/%Y-%m-%d-%H%M%S.md")
+          (setq howm-view-title-header "#") ; markdown mode!
+          (setq howm-directory "~/Notes")
+          (setq howm-home-directory howm-directory)
+          (setq howm-keyword-file (expand-file-name ".howm-keys" howm-home-directory))
+          (setq howm-history-file (expand-file-name ".howm-history" howm-home-directory))
+
+          ;; Use ripgrep as grep
+          (setq howm-view-use-grep t)
+          (setq howm-view-grep-command "rg")
+          (setq howm-view-grep-option "-nH --no-heading --color never")
+          (setq howm-view-grep-extended-option nil)
+          (setq howm-view-grep-fixed-option "-F")
+          (setq howm-view-grep-expr-option nil)
+          (setq howm-view-grep-file-stdin-option nil))
+
+
+        ;; Rename buffers to their title
+        (add-hook 'howm-mode-hook 'howm-mode-set-buffer-name)
+        (add-hook 'after-save-hook 'howm-mode-set-buffer-name)
+
         ; OCaml mode
         (use-package tuareg)
         (setq tuareg-indent-align-with-first-arg t)
@@ -264,6 +291,75 @@
         (add-hook 'emacs-lisp-mode 'parinfer-rust-mode)
         (add-hook 'emacs-lisp-mods (lambda () (lispy-mode 1)))
 
+        ;; erc (emacs irc) settings
+        (use-package erc
+            :config
+            (setopt erc-modules
+                (seq-union '(sals nicks bufbar nickbar scrolltobottom)
+                           etc-modules))
+            (setopt erc-sasl-mechanism 'external)
+
+
+            :custom
+            (erc-prompt-for-nickserv-password nil)
+            (erc-inhibit-multiline-input t)
+            (erc-send-whitespace-lines t)
+            (erc-ask-about-multiline-input t)
+            (erc-server-reconnect-timeout 30)
+            (erc-interactive-display 'buffer)
+
+            (erc-autojoin-timing 'ident)
+            (erc-autojoin-channels-alist '((Libera.Chat "#r2wars")))
+
+            :bind
+            ;; Insert \n when hitting <RET> and send messages using C-c C-c
+            (:map erc-mode-map
+                  ("RET" . nil)
+                  ("C-c C-c" . #'erc-send-current-line)))
+
+        (use-package ultra-scroll
+             ; if you git clone'd instead of package-vc-install
+             ;:load-path "~/code/emacs/ultra-scroll"
+
+             :init
+             (setq scroll-conservatively 101 ; important!
+                 scroll-margin 0) 
+             :config
+                 (ultra-scroll-mode 1))
+        
+        (global-set-key (kbd "C-c e l") (lambda ()
+            (interactive)
+            (if (get-buffer "irc.libera.chat")
+                (erc-track-switch-buffer 1)
+                (when (y-or-n-p "Start ERC? ")
+                  (erc-tls :server "irc.libera.chat"
+                           :port 6697
+                           :nick "hanemile"
+                           :client-certificate
+                             '(,(expand-file-name "~/libera.key")
+                               ,(expand-file-name "~/libera.crt")))))))
+
+        (use-package org-roam
+          :ensure t
+          :custom
+          (org-roam-directory (file-truename "/Users/emile/notes"))
+          :bind (("C-c n l" . org-roam-buffer-toggle)
+                 ("C-c n f" . org-roam-node-find)
+                 ("C-c n g" . org-roam-graph)
+                 ("C-c n i" . org-roam-node-insert)
+                 ("C-c n c" . org-roam-capture)
+                 ;; Dailies
+                 ("C-c n j" . org-roam-dailies-capture-today))
+          :config
+
+          ;; If you're using a vertical completion framework, you might want a more informative completion interface
+          (setq org-roam-node-display-template
+            (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
+          (org-roam-db-autosync-mode)
+
+          ;; If using org-roam-protocol
+          (require 'org-roam-protocol))
+
         (provide '.emacs)                       ; makes flycheck happy
       '';
     };