feat: general.el for convenient keybinds

This commit is contained in:
Muhammad Nauman Raza 2022-11-08 22:05:28 +00:00
parent 836d92b59f
commit e004db0e9a
No known key found for this signature in database
GPG key ID: A9A36C429C9CAE31
7 changed files with 70 additions and 10 deletions

2
.org-id-locations Normal file
View file

@ -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"))

10
bookmarks Normal file
View file

@ -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))
)

View file

@ -6,6 +6,8 @@
;; Disable the modeline. Done in this file for the same reason above ;; Disable the modeline. Done in this file for the same reason above
(setq-default mode-line-format nil) (setq-default mode-line-format nil)
(defconst leader-key "SPC")
;; Straight.el bootstrap ;; Straight.el bootstrap
(defvar bootstrap-version) (defvar bootstrap-version)
(let ((bootstrap-file (let ((bootstrap-file

View file

@ -3,21 +3,17 @@
;; Quit input dialogues after pressing escape once ;; Quit input dialogues after pressing escape once
(global-set-key (kbd "<escape>") 'keyboard-escape-quit) (global-set-key (kbd "<escape>") 'keyboard-escape-quit)
;;; Line Wrapping
(global-visual-line-mode 1) ; Prevent wrapping of words
;;; evil - A Vi Layer inside of Emacs ;;; evil - A Vi Layer inside of Emacs
(use-package evil (use-package evil
:init :custom
(setq evil-want-keybinding nil ; Make room for evil-collection (evil-want-integration t) ; Same as above
evil-want-integration t ; Same as above (evil-undo-system 'undo-fu) ; Set the undo/redo system
evil-undo-system 'undo-fu) ; Set the undo/redo system
:config :config
(evil-mode 1)) (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 ;; undo-fu, used by evil for undo/redo functionality
(use-package undo-fu) (use-package undo-fu)
@ -40,5 +36,23 @@
(setq which-key-idle-delay 0.1) ; Make the popup appear faster (setq which-key-idle-delay 0.1) ; Make the popup appear faster
(setq which-key-separator " - " ) ; Change the seperator which-key uses (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 this file to init.el
(provide 'editor) (provide 'editor)

View file

@ -40,5 +40,13 @@
;; all-the-icons - Icons for various UI elements ;; all-the-icons - Icons for various UI elements
(use-package all-the-icons) (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 this file to init.el
(provide 'interface) (provide 'interface)

View file

@ -41,5 +41,29 @@
;; Enable org-superstar-mode in org-mode files ;; Enable org-superstar-mode in org-mode files
(add-hook 'org-mode-hook 'org-superstar-mode) (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 this file to init.el
(provide 'org-mode) (provide 'org-mode)

BIN
org-roam.db Normal file

Binary file not shown.