Skip to content

Commit

Permalink
refactor: revamp whole Emacs.org
Browse files Browse the repository at this point in the history
This is the first part of consolidating my Emacs and NixOS config
into a single file. This commit refactors the whole of Emacs.org
and adds more bits of prose to the configuration sections.
  • Loading branch information
Swarsel committed Jun 19, 2024
1 parent 5e9c3c3 commit bc8c525
Show file tree
Hide file tree
Showing 8 changed files with 7,029 additions and 2,900 deletions.
4,076 changes: 4,076 additions & 0 deletions Emacs.html

Large diffs are not rendered by default.

3,568 changes: 1,982 additions & 1,586 deletions Emacs.org

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions Nix.org
Original file line number Diff line number Diff line change
Expand Up @@ -5347,6 +5347,10 @@ As for the `home.sessionVariables`, it should be noted that environment variable
source = ../../programs/config/.aspell.conf;
target = ".aspell.conf";
};
".gitmessage" = {
source = ../../programs/git/.gitmessage;
target = ".gitmessage";
};
};

home.sessionVariables = {
Expand Down Expand Up @@ -5416,6 +5420,20 @@ As for the `home.sessionVariables`, it should be noted that environment variable
};
userEmail = "leon.schwarzaeugl@gmail.com";
userName = "Swarsel";
difftastic.enable = true;
lfs.enable = true;
includes = [
{
contents = {
github = {
user = "Swarsel";
};
commit = {
template = "~/.gitmessage";
};
};
}
];
};

#+end_src
Expand Down
18 changes: 18 additions & 0 deletions profiles/common/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,10 @@ home.file = {
source = ../../programs/config/.aspell.conf;
target = ".aspell.conf";
};
".gitmessage" = {
source = ../../programs/git/.gitmessage;
target = ".gitmessage";
};
};

home.sessionVariables = {
Expand Down Expand Up @@ -606,6 +610,20 @@ programs.git = {
};
userEmail = "leon.schwarzaeugl@gmail.com";
userName = "Swarsel";
difftastic.enable = true;
lfs.enable = true;
includes = [
{
contents = {
github = {
user = "Swarsel";
};
commit = {
template = "~/.gitmessage";
};
};
}
];
};

programs.fuzzel = {
Expand Down
24 changes: 12 additions & 12 deletions programs/emacs/custom.el
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
(custom-set-variables
;; (custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
'("7ec8fd456c0c117c99e3a3b16aaf09ed3fb91879f6601b1ea0eeaee9c6def5d9"
"badd1a5e20bd0c29f4fe863f3b480992c65ef1fa63951f59aa5d6b129a3f9c4c"
"2e05569868dc11a52b08926b4c1a27da77580daa9321773d92822f7a639956ce"
default))
'(send-mail-function 'sendmail-send-it))
;; '(custom-safe-themes
;; '("7ec8fd456c0c117c99e3a3b16aaf09ed3fb91879f6601b1ea0eeaee9c6def5d9"
;; "badd1a5e20bd0c29f4fe863f3b480992c65ef1fa63951f59aa5d6b129a3f9c4c"
;; "2e05569868dc11a52b08926b4c1a27da77580daa9321773d92822f7a639956ce"
;; default))
;; '(send-mail-function 'sendmail-send-it))
;; (custom-set-faces
;; ;; custom-set-faces was added by Custom.
;; ;; If you edit it by hand, you could mess it up, so be careful.
Expand All @@ -25,12 +25,12 @@
;; '(ivy-current-match ((t (:extend t :background "dark cyan" :foreground "black"))))
;; '(org-block ((t (:inherit fixed-pitch :extend t :background "#20282F"))))
;; '(org-block-begin-line ((t (:inherit org-block :extend t :background "#20282F" :foreground "DeepSkyBlue4" :weight bold)))))
(custom-set-faces
;; (custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(highlight-indent-guides-even-face ((t (:background "gray10"))))
'(highlight-indent-guides-odd-face ((t (:background "gray20"))))
'(highlight-indent-guides-stack-even-face ((t (:background "gray40"))))
'(highlight-indent-guides-stack-odd-face ((t (:background "gray50")))))
;; '(highlight-indent-guides-even-face ((t (:background "gray10"))))
;; '(highlight-indent-guides-odd-face ((t (:background "gray20"))))
;; '(highlight-indent-guides-stack-even-face ((t (:background "gray40"))))
;; '(highlight-indent-guides-stack-odd-face ((t (:background "gray50")))))
81 changes: 51 additions & 30 deletions programs/emacs/early-init.el
Original file line number Diff line number Diff line change
@@ -1,39 +1,60 @@
(defvar swarsel-file-name-handler-alist file-name-handler-alist)
(defvar swarsel-vc-handled-backends vc-handled-backends)

(setq gc-cons-threshold most-positive-fixnum
gc-cons-percentage 0.6)
gc-cons-percentage 0.6
file-name-handler-alist nil
vc-handled-backends nil)

(add-hook 'emacs-startup-hook
(lambda ()
(progn
(setq gc-cons-threshold (* 1000 1000 8)
gc-cons-percentage 0.1
file-name-handler-alist swarsel-file-name-handler-alist
vc-handled-backends swarsel-vc-handled-backends)
(fset 'epg-wait-for-status 'ignore)
)))

(tool-bar-mode 0)
(menu-bar-mode 0)
(scroll-bar-mode 0)

(setq frame-inhibit-implied-resize t)

(setq default-frame-alist
(append
(list
'(undecorated . t)
'(min-height . 1)
'(height . 42)
'(min-width . 1)
'(width . 100)
'(vertical-scroll-bars . nil)
'(internal-border-width . 10)
'(tool-bar-lines . 0)
'(menu-bar-lines . 0))))

(setq-default left-margin-width 1
right-margin-width 1)
(setq frame-inhibit-implied-resize t
ring-bell-function 'ignore
use-dialog-box nil
use-file-dialog nil
use-short-answers t
inhibit-startup-message t
inhibit-splash-screen t
inhibit-startup-screen t
inhibit-x-resources t
inhibit-startup-buffer-menu t
inhibit-startup-echo-area-message user-login-name ; this needs to be set to the username or it will not have an effect
comp-deferred-compilation nil ; compile all Elisp to native code immediately
)

(add-hook
'after-make-frame-functions
(defun setup-blah-keys (frame)
(with-selected-frame frame
(when (display-graphic-p)
(define-key input-decode-map (kbd "C-i") [C-i])
(define-key input-decode-map (kbd "C-[") [C-lsb])
(define-key input-decode-map (kbd "C-m") [C-m])
))))
(setq-default left-margin-width 1
right-margin-width 1)

(defun swarsel/last-buffer () (interactive) (switch-to-buffer nil))
(global-set-key (kbd "<C-m>") #'swarsel/last-buffer)
(setq-default default-frame-alist
(append
(list
'(undecorated . t) ; no title bar, borders etc.
'(background-color . "#1D252C") ; load doom-citylight colors to avoid white flash
'(foreground-color . "#A0B3C5") ; load doom-citylight colors to avoid white flash
'(vertical-scroll-bars . nil)
'(horizontal-scroll-bars . nil)
'(internal-border-width . 5)
'(tool-bar-lines . 0)
'(menu-bar-lines . 0))))

(setq comp-deferred-compilation nil)
(add-hook
'after-make-frame-functions
(lambda (frame)
(with-selected-frame frame
(when (display-graphic-p)
(define-key input-decode-map (kbd "C-i") [DUMMY-i])
(define-key input-decode-map (kbd "C-[") [DUMMY-lsb])
(define-key input-decode-map (kbd "C-m") [DUMMY-m])
))))
Loading

0 comments on commit bc8c525

Please sign in to comment.