aboutsummaryrefslogtreecommitdiff
path: root/modules/home-manager/emacs/config/lisp/my-functions.el
diff options
context:
space:
mode:
authorDylan <boss@tehbox.org>2026-10-22 13:02:16 +1300
committerDylan <boss@tehbox.org>2026-10-22 17:19:36 +1300
commitcc47c443a3f86aa66d2719ee57c0e6e728ee655e (patch)
tree6e57c4e13cf07486d4a02a3652bf84a9889f97a6 /modules/home-manager/emacs/config/lisp/my-functions.el
parent008b591a0a5942ae42f4c07a5abbee4dbd2d0743 (diff)
downloadnixos-configuration-cc47c443a3f86aa66d2719ee57c0e6e728ee655e.tar.gz
nixos-configuration-cc47c443a3f86aa66d2719ee57c0e6e728ee655e.zip
feat: Included the emacs configdendritic
Some packages are built with nix and some are still built with emacs
Diffstat (limited to 'modules/home-manager/emacs/config/lisp/my-functions.el')
-rw-r--r--modules/home-manager/emacs/config/lisp/my-functions.el48
1 files changed, 48 insertions, 0 deletions
diff --git a/modules/home-manager/emacs/config/lisp/my-functions.el b/modules/home-manager/emacs/config/lisp/my-functions.el
new file mode 100644
index 0000000..52bb72d
--- /dev/null
+++ b/modules/home-manager/emacs/config/lisp/my-functions.el
@@ -0,0 +1,48 @@
+;;; my-functions.el --- My random functions
+;;; Commentary:
+;;; Some random functions
+
+;;; Code:
+
+;;; Karate
+(defun karate-new (timestamp)
+ "Creates new document for karate lesson plans based on a template."
+ (interactive
+ (list (org-read-date nil t)))
+ (let ((date (format-time-string "%d-%m-%Y" timestamp)))
+ (copy-file "~/Documents/karate/lessonPlans/default.org"
+ (concat "~/Documents/karate/lessonPlans/" date ".org") 1)
+ (switch-to-buffer (find-file-noselect (concat "~/Documents/karate/lessonPlans/" date ".org")))
+ (replace-string "DATEHERE" date)
+ (goto-char (point-min))
+ (forward-line 5)
+ (end-of-line)))
+
+;;; Scratch
+(defun start-scratch ()
+ "Function to call when starting the scratch window, or to enter scratchpad mode."
+ (interactive)
+ ;; Make window not transparent
+ (set-frame-parameter (selected-frame) 'alpha '(100 100))
+ ;; Make change WM_NAME to "scratch-emacs"
+ (set-frame-parameter (selected-frame) 'name "scratch-emacs")
+ (org-agenda nil "n")
+ (delete-other-windows)
+ )
+(defun stop-scratch ()
+ "Function to call to stop the scratch window."
+ (interactive)
+ ;; Make window transparent
+ (set-frame-parameter (selected-frame) 'alpha '(80 80))
+ (set-frame-parameter (selected-frame) 'name nil))
+
+;;; Terminal
+(require 'multi-vterm)
+(defun start-terminal ()
+ "Function to call to start a terminal and switch to insert mode, usually used for the keybind $mod+Shift+Return."
+ (interactive)
+ (multi-vterm))
+
+(provide 'my-functions)
+
+;;; my-functions.el ends here