From e004db0e9aa5c39a804de864961e872de53a8d34 Mon Sep 17 00:00:00 2001 From: Muhammad Nauman Raza Date: Tue, 8 Nov 2022 22:05:28 +0000 Subject: [PATCH] feat: general.el for convenient keybinds --- .org-id-locations | 2 ++ bookmarks | 10 ++++++++++ init.el | 2 ++ lisp/editor.el | 34 ++++++++++++++++++++++++---------- lisp/interface.el | 8 ++++++++ lisp/org-mode.el | 24 ++++++++++++++++++++++++ org-roam.db | Bin 0 -> 53248 bytes 7 files changed, 70 insertions(+), 10 deletions(-) create mode 100644 .org-id-locations create mode 100644 bookmarks create mode 100644 org-roam.db diff --git a/.org-id-locations b/.org-id-locations new file mode 100644 index 0000000..4577dfd --- /dev/null +++ b/.org-id-locations @@ -0,0 +1,2 @@ + +(("~/Org/Roam/voidlinux.org" "109dbb09-0ec2-4222-bdb9-6e8da47afe02") ("~/Org/Roam/20221108190909-campaign.org" "b157f89e-f6a8-4d98-8b45-fb203a25b18a") ("~/Org/Roam/campaign.org" "23669621-3833-4829-8bd4-6347ff3c5d1d")) diff --git a/bookmarks b/bookmarks new file mode 100644 index 0000000..26d6d7d --- /dev/null +++ b/bookmarks @@ -0,0 +1,10 @@ +;;;; Emacs Bookmark Format Version 1;;;; -*- coding: utf-8-emacs; mode: lisp-data -*- +;;; This format is meant to be slightly human-readable; +;;; nevertheless, you probably don't want to edit it. +;;; -*- End Of Bookmark File Format Version Stamp -*- +(("org-capture-last-stored" + (filename . "~/Org/Roam/voidlinux.org") + (front-context-string) + (rear-context-string . "mad Nauman Raza\n") + (position . 149)) +) diff --git a/init.el b/init.el index 35a47da..9cda741 100644 --- a/init.el +++ b/init.el @@ -6,6 +6,8 @@ ;; Disable the modeline. Done in this file for the same reason above (setq-default mode-line-format nil) +(defconst leader-key "SPC") + ;; Straight.el bootstrap (defvar bootstrap-version) (let ((bootstrap-file diff --git a/lisp/editor.el b/lisp/editor.el index 6271702..4f624b7 100644 --- a/lisp/editor.el +++ b/lisp/editor.el @@ -3,21 +3,17 @@ ;; Quit input dialogues after pressing escape once (global-set-key (kbd "") 'keyboard-escape-quit) +;;; Line Wrapping +(global-visual-line-mode 1) ; Prevent wrapping of words + ;;; evil - A Vi Layer inside of Emacs (use-package evil - :init - (setq evil-want-keybinding nil ; Make room for evil-collection - evil-want-integration t ; Same as above - evil-undo-system 'undo-fu) ; Set the undo/redo system + :custom + (evil-want-integration t) ; Same as above + (evil-undo-system 'undo-fu) ; Set the undo/redo system :config (evil-mode 1)) -;; evil-collection - a collection of keybindings for evil-mode -(use-package evil-collection - :after evil ; In order to recognize evil-want-... being set - :init - (evil-collection-init)) ; Enable the evil-collection keybinds - ;; undo-fu, used by evil for undo/redo functionality (use-package undo-fu) @@ -40,5 +36,23 @@ (setq which-key-idle-delay 0.1) ; Make the popup appear faster (setq which-key-separator " - " ) ; Change the seperator which-key uses +;; general - More convenient key definitions for Emacs +(use-package general + :config + (general-evil-setup t) + :init + (general-create-definer diancite/leaders + :prefix "SPC")) + +(diancite/leaders + :keymaps 'normal + "f" '(:which-key "File") + "n" '(:which-key "Org") + "m" '(:which-key "Magit") + "w" '(:which-key "Evil") + "p" '(:which-key "Projects")) + +(set-face-foreground 'vertical-border (face-background 'default)) + ;; Provide this file to init.el (provide 'editor) diff --git a/lisp/interface.el b/lisp/interface.el index 463e748..cd391f6 100644 --- a/lisp/interface.el +++ b/lisp/interface.el @@ -40,5 +40,13 @@ ;; all-the-icons - Icons for various UI elements (use-package all-the-icons) +;; vertico - An amazing search engine! +(use-package vertico + :init + (vertico-mode 1)) + +(use-package diredfl ; Colourise dired! + :hook dired-mode) + ;; Provide this file to init.el (provide 'interface) diff --git a/lisp/org-mode.el b/lisp/org-mode.el index dc21d9a..cdd8a0b 100644 --- a/lisp/org-mode.el +++ b/lisp/org-mode.el @@ -41,5 +41,29 @@ ;; Enable org-superstar-mode in org-mode files (add-hook 'org-mode-hook 'org-superstar-mode) +;;; org-roam - A plain-text personal knowledge management system +(use-package org-roam + :custom + (org-directory file-truename "Org/") ; Set the folder used by org-mode + (org-roam-directory (file-truename "Org/Roam/")) ; Set the folder used by org-roam + (org-roam-databse-connector 'sqlite3) + :init + (org-roam-db-autosync-mode 1)) ; Automatically sync nodes + +(setq org-roam-capture-templates + '(("d" "default" plain + "\n%?" + :if-new (file+head "${slug}.org" "#+title: ${title}\n#+date: %U\n#+author: %n\n") + :unnarrowed t))) + +;; Keybinds for org-mode +(general-create-definer diancite/org + :prefix leader-key) + +(diancite/org + :keymaps 'normal + "n r" '(org-roam-node-find :wk "Find Nodes") + "n a" '(org-table-align :wk "Align Table")) + ;; Provide this file to init.el (provide 'org-mode) diff --git a/org-roam.db b/org-roam.db new file mode 100644 index 0000000000000000000000000000000000000000..4b6dce03dd54143a98d6a7d0aa5233dfd0d5e033 GIT binary patch literal 53248 zcmeI*%TFW89S3mRU>F|8qe#dHAGWqvnZW}d`u$ibQowk2&@wO>n28Sv^`m-dt)YqC zOm>hG1#-y0u!@v_AbZFu*ZcvIRyiem+gmRA3nE2|Qq?wgH;a*XMhLX}S~Bi>Q1$Ci zR~xEo2JdWd1Q8{E*gmo&qGTRsvf0ef3CUzKdG;)@=jCIX9gJTl*lU(Of09UFcbLyS zJt!B7|H;fwKgkrgi{H#uijN9^oc-7AiRmhzT(I?>Y0>50`=qI|{<%PXAys6=6U7Iww|055A!960xR7 zLE^H0u;)~MvQ#c-&so51F!n}k?`0wt^Y=#b05&fA@N0WE7T*}Z>)sggIE=rHr{d_3 z&%O_N*;s$E(rEG_y+r(=mAnU9^et`mt1gi=WfXcL3;d)VgzX@D#|}I0A@xpM)FTml z6Ivo3wLNw((q1wOBGx?rj{dE+M8ej|)wAbOq=q%mV7Em#|NA#qWqhLavr;w_zt41j z+2UisK8?aS9lsBD4y5?h^Jm$Z>AcGnw;O-SrI-@^k-g3J?Y(-M>GDJl?apC>hYj1K zB;QdgU8&@53N!BWK#E_+*bkTo{D%ym;Exx+$`udi{#N*E?#b-`crG3gfB*y_009U< z00Izz00e%70)J?JV%KWI@?m&Hm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