@ -66,7 +66,7 @@ All of the available modules are defined in the ~dotfiles/modules-available~ con
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(defconst dotfiles/modules-available
(defconst dotfiles/modules-available
'(core desktop writing projects interface)
'(core editor desktop writing projects interface)
"All of the available modules for hosts to load.")
"All of the available modules for hosts to load.")
#+end_src
#+end_src
@ -214,7 +214,7 @@ Breaking down the project into logical units or chapters to keep the code more m
Minimal configuration to make Emacs usable for my own personal workflow. This does very little in the ways of improving the visuals, only removing what is included by default and not required.
Minimal configuration to make Emacs usable for my own personal workflow. This does very little in the ways of improving the visuals, only removing what is included by default and not required.
***Cleanup
***Startup
Emacs creates a lot of files relative to ~user-emacs-directory~, these files are not part of this immutable configuration and do not belong in the emacs directory. How can we solve this issue? Shortly after initialization, before most packages are loaded, we change the value to ~dotfiles/cache~. I elaborate more on the technique in my post [[https://chrishayward.xyz/posts/immutable-emacs/][Immutable Emacs]].
Emacs creates a lot of files relative to ~user-emacs-directory~, these files are not part of this immutable configuration and do not belong in the emacs directory. How can we solve this issue? Shortly after initialization, before most packages are loaded, we change the value to ~dotfiles/cache~. I elaborate more on the technique in my post [[https://chrishayward.xyz/posts/immutable-emacs/][Immutable Emacs]].
@ -334,6 +334,13 @@ Build all of the =org= files within a given directory.
Download [[https://github.com/justbur/emacs-which-key][which-key]], a package that displays the current incomplete keybinding input in a mini-buffer, showing available completion options.
Download [[https://github.com/justbur/emacs-which-key][which-key]], a package that displays the current incomplete keybinding input in a mini-buffer, showing available completion options.
#+begin_src emacs-lisp
#+begin_src emacs-lisp
@ -353,28 +358,6 @@ Download [[https://github.com/justbur/emacs-which-key][which-key]], a package th
:config (which-key-mode))
:config (which-key-mode))
#+end_src
#+end_src
**** Leader
Implement the *leader* key using [[https://github.com/noctuid/general.el][general.el]], letting us easily configure prefixed keybindings in a much cleaner manner than the default methods.
#+begin_src emacs-lisp
(use-package general
:config
(general-create-definer dotfiles/leader
:states '(normal motion)
:keymaps 'override
:prefix dotfiles/leader-key
:global-prefix dotfiles/leader-key-global))
#+end_src
Use [[https://github.com/abo-abo/hydra][hydra]] for transient keybindings sharing a common prefix.
#+begin_src emacs-lisp
(use-package hydra)
#+end_src
**** Evil
After a few hour with =vim= I knew it was game over, I cannot even think of another way I would feel comfortable editing text. Luckily, there exist packages to emulate this within Emacs. [[https://evil.readthedocs.io/en/latest/index.html][evil-mode]] is the extensible VI layer for Emacs.
After a few hour with =vim= I knew it was game over, I cannot even think of another way I would feel comfortable editing text. Luckily, there exist packages to emulate this within Emacs. [[https://evil.readthedocs.io/en/latest/index.html][evil-mode]] is the extensible VI layer for Emacs.
Implement the *leader* key using [[https://github.com/noctuid/general.el][general.el]], letting us easily configure prefixed keybindings in a much cleaner manner than the default methods.
Again cherry picked from =Doom=, I want to continue utilizing the muscle memory I have developed from a year of mainlining the framework.
#+begin_src emacs-lisp
(use-package general
:config
(general-create-definer dotfiles/leader
:states '(normal motion)
:keymaps 'override
:prefix dotfiles/leader-key
:global-prefix dotfiles/leader-key-global))
#+end_src
+ Close buffers with =SPC c=
+ Find files with =SPC . (period)=
Use [[https://github.com/abo-abo/hydra][hydra]] for transient keybindings sharing a common prefix.
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(dotfiles/leader
"." '(find-file :which-key "Files")
"c" '(kill-buffer-and-window :which-key "Close"))
(use-package hydra)
#+end_src
#+end_src
*** Help
Run helper functions with =SPC h=.
Run helper functions with =SPC h=.
+ Packages =p=
+ Packages =p=
+ Variables =v=
+ Variables =v=
@ -433,68 +423,48 @@ Run helper functions with =SPC h=.
"hf" '(describe-function :which-key "Function"))
"hf" '(describe-function :which-key "Function"))
#+end_src
#+end_src
Quit emacs with =SPC q=.
+ Saving =q=
+ Without =w=
+ Frame (daemon) =f=
*** Files
#+begin_src emacs-lisp
(dotfiles/leader
"q" '(:ignore t :which-key "Quit")
"qq" '(save-buffers-kill-emacs :which-key "Save")
"qw" '(kill-emacs :which-key "Now")
"qf" '(delete-frame :which-key "Frame"))
#+end_src
Emacs' can feel more modern when icon-fonts are installed and prioritized. I feel that this makes navigation of folders much faster, given that file types may be quickly identified by their corresponding icons.
Window management with =SPC w=.
+ Swap with =w=
+ Close with =c=
+ Motions with =h,j,k,l=
+ Split with =s + <MOTION>=
https://github.com/domtronn/all-the-icons.el
+ Collects various icon fonts
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(dotfiles/leader
"w" '(:ignore t :which-key "Window")
"ww" '(window-swap-states :which-key "Swap")
"wc" '(delete-window :which-key "Close")
"wh" '(windmove-left :which-key "Left")
"wj" '(windmove-down :which-key "Down")
"wk" '(windmove-up :which-key "Up")
"wl" '(windmove-right :which-key "Right")
"ws" '(:ignore t :which-key "Split")
"wsj" '(split-window-below :which-key "Down")
"wsl" '(split-window-right :which-key "Right"))
(use-package all-the-icons)
#+end_src
#+end_src
Place runtime tweaks behind =SPC t=.
https://github.com/jtbm37/all-the-icons-dired
+ Integration with dired
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(dotfiles/leader
"t" '(:ignore t :which-key "Tweaks"))
(use-package all-the-icons-dired
:hook (dired-mode . all-the-icons-dired-mode))
#+end_src
#+end_src
*** Git
Another hallmark feature is [[https://github.com/magit/magit][Magit]], a complete git porcelain within Emacs.
When opening =dired=, I don't want to have to press =RET= twice to navigate to the current directory. This can be avoided with ~dired-jump~, included in the =dired-x= package shipped with =dired=.
Work directly with github issues / pull requests using [[https://github.com/magit/forge][Forge]].
+ Requires a valid ~$GITHUB_TOKEN~
By default =dired= will create a new buffer everytime you press =RET= over a directory. In my workflow this leads to many unwanted =dired= buffers that have to be cleaned up manually. [[https://github.com/crocket/dired-single][Dired-single]] lets us reuse the same dired buffer.
Open the *status* page for the current repository with =SPC g=.
Open a dired buffer with =SPC d=.
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(dotfiles/leader
(dotfiles/leader
"g" '(magit-status :which-key "Magit"))
"d" '(dired-jump :which-key "Dired"))
#+end_src
#+end_src
*** Shell
*** Shell
@ -517,48 +487,83 @@ Open an =eshell= buffer with =SPC e=.
"e" '(eshell :which-key "Shell"))
"e" '(eshell :which-key "Shell"))
#+end_src
#+end_src
***Files
***Source
Emacs' can feel more modern when icon-fonts are installed and prioritized. I feel that this makes navigation of folders much faster, given that file types may be quickly identified by their corresponding icons.
Another hallmark feature is [[https://github.com/magit/magit][Magit]], a complete git porcelain within Emacs.
Work directly with github issues / pull requests using [[https://github.com/magit/forge][Forge]].
+ Requires a valid ~$GITHUB_TOKEN~
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(use-package all-the-icons)
(use-package forge)
#+end_src
#+end_src
https://github.com/jtbm37/all-the-icons-dired
+ Integration with dired
Open the *status* page for the current repository with =SPC g=.
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(use-package all-the-icons-dired
:hook (dired-mode . all-the-icons-dired-mode))
(dotfiles/leader
"g" '(magit-status :which-key "Magit"))
#+end_src
#+end_src
When opening =dired=, I don't want to have to press =RET= twice to navigate to the current directory. This can be avoided with ~dired-jump~, included in the =dired-x= package shipped with =dired=.
*** Windows
Window management with =SPC w=.
+ Swap with =w=
+ Close with =c=
+ Motions with =h,j,k,l=
+ Split with =s + <MOTION>=
#+begin_src emacs-lisp
#+begin_src emacs-lisp
(require 'dired-x)
(dotfiles/leader
"w" '(:ignore t :which-key "Window")
"ww" '(window-swap-states :which-key "Swap")
"wc" '(delete-window :which-key "Close")
"wh" '(windmove-left :which-key "Left")
"wj" '(windmove-down :which-key "Down")
"wk" '(windmove-up :which-key "Up")
"wl" '(windmove-right :which-key "Right")
"ws" '(:ignore t :which-key "Split")
"wsj" '(split-window-below :which-key "Down")
"wsl" '(split-window-right :which-key "Right"))
#+end_src
#+end_src
By default =dired= will create a new buffer everytime you press =RET= over a directory. In my workflow this leads to many unwanted =dired= buffers that have to be cleaned up manually. [[https://github.com/crocket/dired-single][Dired-single]] lets us reuse the same dired buffer.
*** Shortcuts
+ Move up a directory with =h=
+ Open a single buffer with =l=
Implement a few shortcut bindings, cherry picked from Doom emacs.