diff options
Diffstat (limited to 'home/dots')
-rw-r--r-- | home/dots/.emacs | 102 | ||||
-rw-r--r-- | home/dots/.emacs.d/BOGO-theme.el | 2 |
2 files changed, 76 insertions, 28 deletions
diff --git a/home/dots/.emacs b/home/dots/.emacs index 65c4ad1..5ffe486 100644 --- a/home/dots/.emacs +++ b/home/dots/.emacs @@ -32,8 +32,6 @@ rec-mode tldr transpose-frame - yasnippet - yasnippet-snippets ws-butler) package-archives '(("elpa" . "https://elpa.gnu.org") ("gnu" . "http://elpa.gnu.org/packages/") @@ -67,6 +65,8 @@ (number-sequence 0 9)))) (exwm-input-set-key (kbd "s-f") 'exwm-layout-toggle-fullscreen) + (exwm-input-set-key (kbd "s-t") + 'exwm-floating-toggle-floating) (exwm-input-set-key (kbd "<print>") (lambda () (interactive) (shell-command "scrot -F '/home/mccd/screenshots/%Y-%m-%d_$wx$h.png'"))) @@ -252,7 +252,8 @@ :ensure t :init (with-eval-after-load 'geiser-guile - (add-to-list 'geiser-guile-load-path "~/dev/nonguix"))) + (add-to-list 'geiser-guile-load-path "~/dev/nonguix") + (keymap-set geiser-mode-map "C-." nil))) (use-package corfu ;; Optional customizations @@ -445,7 +446,7 @@ ("b" . backward-word) :repeat-map undo-redo-repeat-map ("/" . undo) - ("?" . redo) + ("?" . undo-redo) :repeat-map kill-lines-repeat-map ("k" . kill-line) :repeat-map kill-lines-org-repeat-map @@ -664,8 +665,8 @@ (use-package devdocs :ensure t - :init - (global-set-key (kbd "C-h D") 'devdocs-lookup)) + :bind + ("C-h D" . devdocs-lookup)) (use-package custom-keymaps :load-path "elisp" @@ -731,8 +732,8 @@ :demand t :hook (eglot-managed-mode . #'eldoc-box-hover-mode) - :config - (global-set-key (kbd "C-h .") #'eldoc-box-help-at-point)) + :bind + ("C-h ." . eldoc-box-help-at-point)) (use-package markdown-mode :ensure t @@ -749,12 +750,12 @@ (use-package elec-pair :init (electric-pair-mode 1) - :config - (global-set-key (kbd "M-{") 'insert-pair) - (global-set-key (kbd "M-\"") 'insert-pair) - (global-set-key (kbd "M-\'") 'insert-pair) - (global-set-key (kbd "M-<") 'insert-pair) - (global-set-key (kbd "M-[") 'insert-pair)) + :bind + ("M-{" . insert-pair) + ("M-\"" . insert-pair) + ("M-\'" . insert-pair) + ("M-<" . insert-pair) + ("M-[" . insert-pair)) (use-package dbus :config @@ -807,7 +808,6 @@ :custom (calendar-week-start-day 1) :config - (global-set-key (kbd "C-c d") 'calendar) (calendar-set-date-style 'european) (setq calendar-week-start-day 1)) @@ -881,9 +881,8 @@ "#netbsd" "#nonguix" "#guix"))) - :init - (global-set-key - "\C-ceo" + :bind + ("\C-ceo" . (lambda () "erc - join osm" (interactive) @@ -891,8 +890,7 @@ :server "irc.oftc.net" :port "6667" :nick "mccd"))) - (global-set-key - "\C-cel" + ("\C-cel" . (lambda () "erc - join libera chat" (interactive) @@ -1030,9 +1028,9 @@ entry (file+headline "~/personal-db/notes/notes.org" "References") "* %?\n%i\n%a\n " :empty-lines 1) - ("s" "Schedule" + ("e" "Event" entry (file+headline "~/personal-db/notes/notes.org" "Event") - "* TODO %?\nSCHEDULED: %^T" + "* %?\n%^T" :empty-lines 1) ("a" "Article" entry (file+olp "~/personal-db/notes/notes.org" "References" "Articles") @@ -1127,11 +1125,50 @@ :demand t :ensure magit) -(use-package yasnippet - :diminish yas-minor-mode - :ensure t +(use-package skeleton + :custom + (skeleton-end-hook nil) :init - (yas-global-mode 1)) + (define-skeleton golang-new-function + "New function" + "Function name: " + > "func " str " (" - @ ") {" \n + \n + -1 "}") + + (define-skeleton golang-if-nil-err + "If err != nil" nil + > "if err != nil {" \n + @ - \n + -1 "}") + + (define-skeleton golang-new-struct + "New struct" + "Struct name: " + > "type " str " struct {" \n + \n + -1 "}") + + (define-skeleton golang-for-loop + "For loop" + > "for _, v := range " - @ "{" \n + \n + -1 "}")) + +(use-package abbrev + :after skeleton go-mode + :init + (setq-default abbrev-mode t) + :config + (define-abbrev go-mode-abbrev-table "2err" + "" 'golang-if-nil-err) + (define-abbrev go-mode-abbrev-table "2fu" + "" 'golang-new-function) + (define-abbrev go-mode-abbrev-table "2st" + "" 'golang-new-struct) + (define-abbrev go-mode-abbrev-table "2fo" + "" 'golang-for-loop) + ) (use-package flyspell :diminish flyspell-mode @@ -1175,6 +1212,8 @@ (message-send-mail-function 'message-send-mail-with-sendmail) (mail-user-agent 'message-user-agent)) +(use-package tempo) + (use-package rmail :init (defvar selected-rmail-account "") @@ -1189,7 +1228,7 @@ (rmail-output-as-seen "/tmp/new-patch.patch")) :bind (("C-c m" . rmail-open) - ("C-c M" . rmail-no-check) + ("C-c M" . rmail-open-no-check) :map rmail-mode-map ("r" . rmail-reply-t) ("R" . rmail-reply) @@ -1250,6 +1289,15 @@ ["Home" mail-home] ["Work" mail-work])) + (defun rmail-open-no-check () + (interactive) + (let ((prev selected-rmail-account)) + (tmm-prompt rmail-prompt-account) + (unless (eq selected-rmail-account prev) + ;; First kill all RMAIL buffers to not leave any dangling + (kill-matching-buffers "\\.mbox\\|RMAIL"))) + (rmail-no-check)) + (defun rmail-open () (interactive) (let ((prev selected-rmail-account)) diff --git a/home/dots/.emacs.d/BOGO-theme.el b/home/dots/.emacs.d/BOGO-theme.el index 12d95e8..7d09fd3 100644 --- a/home/dots/.emacs.d/BOGO-theme.el +++ b/home/dots/.emacs.d/BOGO-theme.el @@ -101,7 +101,7 @@ '(tldr-command-itself ((t (:background "khaki" :foreground "#111111" :weight bold)))) '(tldr-introduction ((t (:foreground "#111111" :slant italic)))) '(tldr-title ((t (:inherit variable-pitch :foreground "#111111" :weight bold)))) - '(variable-pitch ((t (:family "Iosevka Etoile" :height 1.0)))) + '(variable-pitch ((t (:family "Iosevka Aile" :height 1.0)))) '(window-divider ((t (:foreground "gray90"))))) (provide-theme 'BOGO) |