Relocating logic from General UI & Keybinds

This commit is contained in:
James Patrick 2024-02-03 19:52:30 -05:00 committed by James Patrick
parent bab73a96ef
commit eae7b32b23
5 changed files with 31 additions and 61 deletions

View File

@ -2,11 +2,6 @@
;;; This file is generated via tangles from the config.org file. Do not modify this file.
;;; Any modifications here will be clobbered and versioned over. Seriously just don't.
;;; +keybinds.el -*- lexical-binding: t; -*-
;;; This file is generated via tangles from the config.org file. Do not modify this file.
;;; Any modifications here will be clobbered and versioned over. Seriously just don't.
(setq doom-localleader-key ",")
(map! :leader

View File

@ -2,11 +2,6 @@
;;; This file is generated via tangles from the config.org file. Do not modify this file.
;;; Any modifications here will be clobbered and versioned over. Seriously just don't.
;;; +orgmode.el -*- lexical-binding: t; -*-
;;; This file is generated via tangles from the config.org file. Do not modify this file.
;;; Any modifications here will be clobbered and versioned over. Seriously just don't.
(require 'org)
(custom-set-variables '(org-directory "~/org/"))

View File

@ -12,8 +12,6 @@
(setq ispell-dictionary "en"
ispell-personal-dictionary "~/org/.ispell.en.pws")
(setq which-key-idle-delay 0.1)
(setq doom-fallback-buffer-name "Doom"
+doom-dashboard-name "Doom Dashboard")
@ -34,11 +32,13 @@
doom-variable-pitch-font (font-spec :family "Alegreya" :height 1.3)
doom-big-font (font-spec :family "Hasklig" :size 18))
(load! "+keybinds")
(setq which-key-idle-delay 0.1)
(add-to-list 'auto-mode-alist '("/\\(tmp\\|private/var\\)/.*/tmp_.*.greenfiling.com.*\\.txt" . markdown-mode))
(add-to-list 'auto-mode-alist '("/\\(tmp\\|private/var\\)/.*/tmp_.*.github.com.*\\.txt" . markdown-mode))
(load! "+keybinds")
(load! "+orgmode")
(use-package! gptel)

View File

@ -140,6 +140,8 @@ find ~/.doom.d/* -iname '*.el' | sed "s/.*\///"
: init.el
: packages.el
Since we've used a named these blocks we can use [[*Noweb Reference][Noweb Reference]] for all of the files.
=+keybinds.el=
#+begin_src emacs-lisp :tangle "+keybinds.el" :noweb no-export :comments no
<<lexical-binding>>
@ -172,16 +174,12 @@ find ~/.doom.d/* -iname '*.el' | sed "s/.*\///"
* Doom Modules
The configuration is below is pulled from the template =init.example.el= provided by doom. This one is based off commit [[https://github.com/doomemacs/doomemacs/blob/e96624926d724aff98e862221422cd7124a99c19/templates/init.example.el][e966249]].
#+name: init.el
#+attr_html: :collapsed t
#+begin_src emacs-lisp :tangle "init.el" :noweb no-export :comments no
;;; init.el -*- lexical-binding: t; -*-
<<modification-warning>>
;; This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!
@ -523,16 +521,10 @@ literate
(default +bindings +smartparens)
#+end_src
* Doom Configuration
** Configuration
*** Speedup =whichkey= response
=whichkey= is slow to respond, lets make it a bit faster.
#+begin_src emacs-lisp
(setq which-key-idle-delay 0.1)
#+end_src
*** Window Titlebar
* General UI Tweaks
** Window Titlebar
The titlebar display string will display =♢= if there exist unsaved buffer modifications & =♦= otherwise.
#+begin_src emacs-lisp
@ -553,7 +545,7 @@ The titlebar display string will display =♢= if there exist unsaved buffer mod
(format (if (buffer-modified-p) " ♢ %s" " ♦ %s") project-name))))))
#+end_src
*** Fonts
** Fonts
I use the [[https://www.nerdfonts.com/][nerdfont]]'s [[https://github.com/i-tu/Hasklig][Hasklig]] for my monospace font & Huerta Tipografica's [[https://www.huertatipografica.com/en/fonts/alegreya-ht-pro][ Alegreya]] serif font.
#+begin_src emacs-lisp
@ -562,21 +554,14 @@ I use the [[https://www.nerdfonts.com/][nerdfont]]'s [[https://github.com/i-tu/H
doom-big-font (font-spec :family "Hasklig" :size 18))
#+end_src
*** Tridactyl
I am currently using Firefox with [[https://github.com/tridactyl/tridactyl][Tridactyl]]. The =editorcmd= creates a temporary file & opens it with the editor of choice. The domain is included in the temporary file name. We can use this to set the syntax of the file in question. This likely just be markdown.
#+begin_src emacs-lisp
(add-to-list 'auto-mode-alist '("/\\(tmp\\|private/var\\)/.*/tmp_.*.greenfiling.com.*\\.txt" . markdown-mode))
(add-to-list 'auto-mode-alist '("/\\(tmp\\|private/var\\)/.*/tmp_.*.github.com.*\\.txt" . markdown-mode))
#+end_src
** Additional Keybinds
Keybinds custom keybinds can be located at =$DOOMDIR/+keybinds.el=.
* Keys
Keybinds should be centralized in =$DOOMDIR/+keybinds.el=. This is loaded from =$DOOMDIR/config.el= file via
#+begin_src emacs-lisp
(load! "+keybinds")
#+end_src
Doom comes with some good keybind macros (see [[https://github.com/doomemacs/doomemacs/blob/master/docs/faq.org#bind-my-own-keys-or-change-existing-ones][here]] for why). Documentation for this can be found [[https://github.com/doomemacs/doomemacs/blob/master/docs/faq.org#bind-my-own-keys-or-change-existing-ones][here]], but in broad strokes:
1. Start with a =map!= macro. You can use
@ -593,23 +578,23 @@ Below is a sample snippet from Rameez Khan's [[https://rameezkhan.me/posts/2020/
:desc "Search journal entry" "s" #'org-journal-search)))
#+end_src
*** Add the lexical bindings magic comment
#+begin_src emacs-lisp :tangle "+keybinds.el" :noweb no-export :comments no
;;; +keybinds.el -*- lexical-binding: t; -*-
#+end_src
Note: Keybinds should be defined with in the context that they are being used, not here
*** Modification warning message.
#+begin_src emacs-lisp :tangle "+keybinds.el" :noweb no-export :comments no
<<modification-warning>>
#+end_src
*** Local Leader
** Local Leader
Lets set the local leader to =,=. We may want to remap this to =;= later. Both of these seem to have issues with potential key conflicts with evil-snipe. This seems to primarily exists with regards to org-mode. Github issue can be found [[https://github.com/doomemacs/doomemacs/issues/4242][here]].
#+begin_src emacs-lisp :tangle "+keybinds.el" :noweb no-export :comments no
(setq doom-localleader-key ",")
#+end_src
*** Roam Keybinds
** Speedup =whichkey= response
=whichkey= is slow to respond, lets make it a bit faster.
#+begin_src emacs-lisp
(setq which-key-idle-delay 0.1)
#+end_src
** Roam Keybinds
:PROPERTIES:
:ID: f9ffe9df-a417-45c4-8bf2-6ee655140648
:END:
@ -628,22 +613,21 @@ The standard keybind for getting to Roam's daily capture is pretty long. To cap
#+end_src
=:leader r= is used by =:tools upload= for "remote", but since I'm not using this lets just not care about that.
* Configuration
** Tridactyl
I am currently using Firefox with [[https://github.com/tridactyl/tridactyl][Tridactyl]]. The =editorcmd= creates a temporary file & opens it with the editor of choice. The domain is included in the temporary file name. We can use this to set the syntax of the file in question. This likely just be markdown.
#+begin_src emacs-lisp
(add-to-list 'auto-mode-alist '("/\\(tmp\\|private/var\\)/.*/tmp_.*.greenfiling.com.*\\.txt" . markdown-mode))
(add-to-list 'auto-mode-alist '("/\\(tmp\\|private/var\\)/.*/tmp_.*.github.com.*\\.txt" . markdown-mode))
#+end_src
** Orgmode
This file will be needed for emacs batch automation, where its not reasonable to start up my entire working env. This file can be located at =$DOOMDIR/+orgmode.el=.
#+begin_src emacs-lisp
(load! "+orgmode")
#+end_src
*** Lexical bindings
#+begin_src emacs-lisp :tangle "+orgmode.el" :noweb no-export :comments no
;;; +orgmode.el -*- lexical-binding: t; -*-
#+end_src
*** Modification warning message.
#+begin_src emacs-lisp :tangle "+orgmode.el" :noweb no-export :comments no
<<modification-warning>>
#+end_src
*** Importing org
This file may get consumed via emacs batch scripting, so we need ot make sure the orgmode is actually loaded.

View File

@ -2,10 +2,6 @@
;;; This file is generated via tangles from the config.org file. Do not modify this file.
;;; Any modifications here will be clobbered and versioned over. Seriously just don't.
;;; init.el -*- lexical-binding: t; -*-
;;; This file is generated via tangles from the config.org file. Do not modify this file.
;;; Any modifications here will be clobbered and versioned over. Seriously just don't.
;; This file controls what Doom modules are enabled and what order they load
;; in. Remember to run 'doom sync' after modifying it!