~thecatster/.emacs.d

6d27ceb665a5eb6e5726db5db53cc3ac7f08279e — Daniil Rose 4 months ago 22afe6e
Various changes to mirror things I like in Doom
2 files changed, 80 insertions(+), 38 deletions(-)

M emacs.org
M init.el
M emacs.org => emacs.org +49 -19
@@ 173,12 173,6 @@ and I pulled out the parts I thought were best and still needed.
  ;; I said, **Zoom** scrolling!
  (setq redisplay-skip-fontification-on-input t)

  ;; Of course Windows does it's own thing D:
  (when IS-WINDOWS
    (setq w32-get-true-file-attributes nil
          w32-pipe-read-delay 0
          w32-pipe-buffer-size (* 64 1024)))

  ;; Remove unnecessary CLI options
  (unless IS-MAC   (setq command-line-ns-option-alist nil))
  (unless IS-LINUX (setq command-line-x-option-alist nil))


@@ 213,20 207,12 @@ and I pulled out the parts I thought were best and still needed.
                           "~/.authinfo"
                           "~/.authinfo.gpg"))

  ;; Of course Windows does it's own thing.
  (when (and IS-WINDOWS (null (getenv-internal "HOME")))
    (setenv "HOME" (getenv "USERPROFILE"))
    (setq abbreviated-home-dir nil))

  ;; UTF-8!
  (when (fboundp 'set-charset-priority)
    (set-charset-priority 'unicode))
  (set-default-coding-systems 'utf-8)
  (prefer-coding-system 'utf-8)
  (setq locale-coding-system 'utf-8)
  ;; Of course Windows does it's own thing.
  (unless IS-WINDOWS
    (setq selection-coding-system 'utf-8))
#+END_SRC

** Package Management


@@ 327,7 313,8 @@ When on macOS, make some tweaks to better the experience.
       (ns-auto-titlebar-mode +1))

  ;; Integrate with Keychain
  ;;(auth-sources 'macos-keychain-internet 'macos-keychain-generic)
  (add-to-list 'auth-sources 'macos-keychain-internet)
  (add-to-list 'auth-sources 'macos-keychain-generic)

  ;; Delete files to trash
  (use-package osx-trash


@@ 335,8 322,7 @@ When on macOS, make some tweaks to better the experience.
    (setq delete-by-moving-to-trash t)
    (and IS-MAC
         (not (fboundp 'system-move-file-to-trash))
         (defalias #'system-move-file-to-trash #'osx-trash-move-file-to-trash)))
  )
         (defalias #'system-move-file-to-trash #'osx-trash-move-file-to-trash))))
#+END_SRC

Add programs to path on macOS.


@@ 470,10 456,14 @@ I love the Jetbrains Mono font, make sure you have it installed or change
this font name! And if we're talking about fonts, you gotta have
emojis.

Also, set the default Emacs window to the size I like on my MacBook.

#+BEGIN_SRC emacs-lisp
(add-to-list 'default-frame-alist '(font . "JetBrainsMono Nerd Font 12"))
(add-to-list 'default-frame-alist '((font . "JetBrainsMono Nerd Font 12") (height . 45) (width . 120)))
(use-package emojify
  :hook (erc-mode . emojify-mode)
  :hook (after-init . global-emojify-mode)
  :custom
  (emojify-set-emoji-style 'unicode)
  :commands emojify-mode)
#+END_SRC



@@ 713,6 703,15 @@ Allows for annotations of commands, files, and more.
  :init
  (marginalia-mode))
#+END_SRC
*** Completion Icons
It's nice to see little icons related to files and whatnot.d

#+BEGIN_SRC emacs-lisp
(use-package all-the-icons-completion
  :init
  (all-the-icons-completion-mode))
#+END_SRC

*** Consult
#+BEGIN_SRC emacs-lisp
(use-package consult


@@ 1103,6 1102,32 @@ modify) PDFs in Emacs.
      (advice-add 'pdf-annot-edit-contents-commit :after 'bjm/save-buffer-no-args))))
#+END_SRC
* Programs and Extensions
** Dashboard
It's nice to have a dashboard when I start Emacs. Not sure if it truly
makes any difference, but it is appealing to look at it.

#+BEGIN_SRC emacs-lisp
(use-package dashboard
  :preface
  (defun my/dashboard-banner ()
    "Set a dashboard banner including information on package initialization
  time and garbage collections."""
    (setq dashboard-banner-logo-title
          (format "Emacs ready in %.2f seconds with %d garbage collections."
                  (float-time (time-subtract after-init-time before-init-time)) gcs-done)))
  :custom
  (dashboard-set-heading-icons t)
  (dashboard-set-file-icons t)
  (dashboard-center-content t)
  :config
  (setq dashboard-startup-banner 'logo)
  (dashboard-setup-startup-hook)
  :hook ((after-init     . dashboard-refresh-buffer)
         (dashboard-mode . my/dashboard-banner)))

(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))
#+END_SRC

** Docker
I often want to write and/or edit Dockerfiles and docker-compose.yml's
for my server or development. Having the ability to seamlessly do this


@@ 2052,3 2077,8 @@ wasn't sure what section to put this in.
      (if (and b e (< (point) e)) (setq rlt nil)))
    (setq ad-return-value rlt)))
#+END_SRC

* Keybindings
I like the Doom idea of binding keybindings in a unified way, however
I dislike the way Doom actually binds them. This is my version,
tailored to my needs.

M init.el => init.el +31 -19
@@ 73,12 73,6 @@
;; I said, **Zoom** scrolling!
(setq redisplay-skip-fontification-on-input t)

;; Of course Windows does it's own thing D:
(when IS-WINDOWS
  (setq w32-get-true-file-attributes nil
        w32-pipe-read-delay 0
        w32-pipe-buffer-size (* 64 1024)))

;; Remove unnecessary CLI options
(unless IS-MAC   (setq command-line-ns-option-alist nil))
(unless IS-LINUX (setq command-line-x-option-alist nil))


@@ 113,20 107,12 @@
                         "~/.authinfo"
                         "~/.authinfo.gpg"))

;; Of course Windows does it's own thing.
(when (and IS-WINDOWS (null (getenv-internal "HOME")))
  (setenv "HOME" (getenv "USERPROFILE"))
  (setq abbreviated-home-dir nil))

;; UTF-8!
(when (fboundp 'set-charset-priority)
  (set-charset-priority 'unicode))
(set-default-coding-systems 'utf-8)
(prefer-coding-system 'utf-8)
(setq locale-coding-system 'utf-8)
;; Of course Windows does it's own thing.
(unless IS-WINDOWS
  (setq selection-coding-system 'utf-8))

;; MELPA!
(require 'package)


@@ 196,7 182,8 @@
       (ns-auto-titlebar-mode +1))

  ;; Integrate with Keychain
  ;;(auth-sources 'macos-keychain-internet 'macos-keychain-generic)
  (add-to-list 'auth-sources 'macos-keychain-internet)
  (add-to-list 'auth-sources 'macos-keychain-generic)

  ;; Delete files to trash
  (use-package osx-trash


@@ 204,8 191,7 @@
    (setq delete-by-moving-to-trash t)
    (and IS-MAC
         (not (fboundp 'system-move-file-to-trash))
         (defalias #'system-move-file-to-trash #'osx-trash-move-file-to-trash)))
  )
         (defalias #'system-move-file-to-trash #'osx-trash-move-file-to-trash))))

(when IS-MAC
  (use-package exec-path-from-shell


@@ 266,9 252,11 @@

(add-hook 'before-save-hook 'delete-trailing-whitespace)

(add-to-list 'default-frame-alist '(font . "JetBrainsMono Nerd Font 12"))
(add-to-list 'default-frame-alist '((font . "JetBrainsMono Nerd Font 12") (height . 45) (width . 120)))
(use-package emojify
  :hook (erc-mode . emojify-mode)
  :hook (after-init . global-emojify-mode)
  :custom
  (emojify-set-emoji-style 'unicode)
  :commands emojify-mode)

(use-package default-text-scale


@@ 420,6 408,10 @@
  :init
  (marginalia-mode))

(use-package all-the-icons-completion
  :init
  (all-the-icons-completion-mode))

(use-package consult
  :bind (;; C-c bindings (mode-specific-map)
         ("C-c h" . consult-history)


@@ 745,6 737,26 @@
      ;; save after adding comment
      (advice-add 'pdf-annot-edit-contents-commit :after 'bjm/save-buffer-no-args))))

(use-package dashboard
  :preface
  (defun my/dashboard-banner ()
    "Set a dashboard banner including information on package initialization
  time and garbage collections."""
    (setq dashboard-banner-logo-title
          (format "Emacs ready in %.2f seconds with %d garbage collections."
                  (float-time (time-subtract after-init-time before-init-time)) gcs-done)))
  :custom
  (dashboard-set-heading-icons t)
  (dashboard-set-file-icons t)
  (dashboard-center-content t)
  :config
  (setq dashboard-startup-banner 'logo)
  (dashboard-setup-startup-hook)
  :hook ((after-init     . dashboard-refresh-buffer)
         (dashboard-mode . my/dashboard-banner)))

(setq initial-buffer-choice (lambda () (get-buffer "*dashboard*")))

(use-package dockerfile-mode
  :mode "Dockerfile\\'")