commit b5ba4f0560574b1d59569a573900f889262b42c0
parent 30d71a09562f820118a0e3c75d05a14bc758d696
Author: dwrz <dwrz@dwrz.net>
Date: Sat, 2 Sep 2023 13:25:40 +0000
Update emacs init
Diffstat:
M | emacs/init.el | | | 105 | ++++++++++++++++++++++++++++++++++++++----------------------------------------- |
1 file changed, 51 insertions(+), 54 deletions(-)
diff --git a/emacs/init.el b/emacs/init.el
@@ -49,7 +49,7 @@
(when buffer-file-name
(let ((filename (file-name-nondirectory buffer-file-name)))
(when filename (kill-new filename)
- (message "Copied buffer name '%s' to the clipboard." filename)))))
+ (message "Copied buffer name '%s' to the clipboard." filename)))))
(defun dwrz-org-capture-at-point ()
"Insert an org capture template at point."
@@ -60,8 +60,8 @@
"Create or switch to a shell buffer for the current directory."
(interactive)
(let* ((default-directory (if (buffer-file-name)
- (file-name-directory (buffer-file-name))
- default-directory))
+ (file-name-directory (buffer-file-name))
+ default-directory))
(dir-path (expand-file-name default-directory))
(shell-buffer-name (concat "*shell:" dir-path "*"))
(existing-shell-buffer (get-buffer shell-buffer-name)))
@@ -154,7 +154,7 @@
(with-eval-after-load 'emacs-lisp-mode
(add-hook 'emacs-lisp-mode-hook 'eldoc-mode)
(add-hook 'emacs-lisp-mode-hook
- '(lambda () (setq indent-tabs-mode nil)))
+ #'(lambda () (setq indent-tabs-mode nil)))
(font-lock-add-keywords 'emacs-lisp-mode '(("\\<\\(FIX\\|TODO\\|NB\\)" 1
font-lock-warning-face t))))
@@ -183,10 +183,10 @@
(setq go-tag-args (list "-transform" "camelcase"))
(add-hook 'go-mode-hook 'lsp)
(add-hook 'go-mode-hook
- '(lambda ()
- (set (make-local-variable 'before-save-hook)
- '(lsp-organize-imports
- lsp-format-buffer))))
+ #'(lambda ()
+ (set (make-local-variable 'before-save-hook)
+ '(lsp-organize-imports
+ lsp-format-buffer))))
(define-key go-mode-map (kbd "C-c C-b") 'pop-tag-mark)
(define-key go-mode-map (kbd "C-c t") 'go-tag-add)
(define-key go-mode-map (kbd "C-c T") 'go-tag-remove)
@@ -200,8 +200,11 @@
go-playground-init-command "go mod init"))
(with-eval-after-load 'ido
- (setq ido-enable-flex-matching t)
- (setq ido-everywhere t))
+ (setq ido-enable-flex-matching t
+ ido-default-buffer-method 'selected-window
+ ido-everywhere t))
+
+(with-eval-after-load 'isearch (setq isearch-allow-scroll t))
(with-eval-after-load 'ispell
(setq ispell-program-name "/usr/bin/aspell"
@@ -243,43 +246,43 @@
(:name "todo" :query "tag:todo" :key "t")))
;; Keybindings
(define-key notmuch-search-mode-map "D"
- (lambda ()
- "mark message as deleted"
- (interactive)
- (notmuch-search-tag (list "-new" "-unread" "-inbox" "+deleted"))
- (forward-line)))
+ (lambda ()
+ "mark message as deleted"
+ (interactive)
+ (notmuch-search-tag (list "-new" "-unread" "-inbox" "+deleted"))
+ (forward-line)))
(define-key notmuch-show-mode-map "D"
- (lambda ()
- "mark message as deleted"
- (interactive)
- (notmuch-show-tag (list "-new" "-unread" "-inbox" "+deleted"))))
+ (lambda ()
+ "mark message as deleted"
+ (interactive)
+ (notmuch-show-tag (list "-new" "-unread" "-inbox" "+deleted"))))
(define-key notmuch-search-mode-map "S"
- (lambda ()
- "mark message as spam"
- (interactive)
- (notmuch-search-tag (list "-new" "-unread" "-inbox" "+spam"))
- (forward-line)))
+ (lambda ()
+ "mark message as spam"
+ (interactive)
+ (notmuch-search-tag (list "-new" "-unread" "-inbox" "+spam"))
+ (forward-line)))
(define-key notmuch-show-mode-map "S"
- (lambda ()
- "mark message as spam"
- (interactive)
- (notmuch-show-tag (list "-new" "-unread" "-inbox" "+spam"))))
+ (lambda ()
+ "mark message as spam"
+ (interactive)
+ (notmuch-show-tag (list "-new" "-unread" "-inbox" "+spam"))))
(define-key notmuch-search-mode-map "N"
- (lambda ()
- "unmark message as new and unread"
- (interactive)
- (notmuch-search-tag (list "-new" "-unread"))
- (forward-line)))
+ (lambda ()
+ "unmark message as new and unread"
+ (interactive)
+ (notmuch-search-tag (list "-new" "-unread"))
+ (forward-line)))
(define-key notmuch-show-mode-map "N"
- (lambda ()
- "unmark message as new and unread"
- (interactive)
- (notmuch-show-tag (list "-new" "-unread"))))
+ (lambda ()
+ "unmark message as new and unread"
+ (interactive)
+ (notmuch-show-tag (list "-new" "-unread"))))
(define-key notmuch-show-mode-map "r" 'notmuch-show-reply)
(define-key notmuch-show-mode-map "R" 'notmuch-show-reply-sender)
(define-key notmuch-search-mode-map "r" 'notmuch-search-reply-to-thread)
(define-key notmuch-search-mode-map "R"
- 'notmuch-search-reply-to-thread-sender))
+ 'notmuch-search-reply-to-thread-sender))
(with-eval-after-load 'novice ())
@@ -345,7 +348,6 @@
(cond ((string-equal (system-name) "main.dwrz.net")
(setq org-agenda-files '("~/org/dwrz.org"
"~/org/someday-maybe.org"
- "~/projects/brz/brz.org"
"~/projects/career/career.org"
"~/projects/chimerical/chimerical.org"
"~/projects/chinese/chinese.org"
@@ -432,9 +434,6 @@
mail-specify-envelope-from t
send-mail-function 'sendmail-send-it))
-(with-eval-after-load 'shell
- (setq-default explicit-shell-file-name (getenv "SHELL")))
-
(with-eval-after-load 'sh-script (setq sh-basic-offset 2))
(with-eval-after-load 'simple
@@ -483,15 +482,15 @@
;; HOOKS
(add-hook 'after-init-hook 'doom-modeline-mode)
(add-hook 'after-init-hook
- '(lambda ()
- (setq base16-theme-256-color-source 'colors)
- (load-theme 'base16-tomorrow t)
- (set-face-attribute 'fringe t :background "#ffffff")
- (setq base16-distinct-fringe-background nil)
- (when (fboundp 'menu-bar-mode)(menu-bar-mode -1))
- (when (fboundp 'scroll-bar-mode)(scroll-bar-mode -1))
- (when (fboundp 'tool-bar-mode)(tool-bar-mode -1))
- (when (fboundp 'window-divider-mode)(window-divider-mode -1))))
+ #'(lambda ()
+ (setq base16-theme-256-color-source 'colors)
+ (load-theme 'base16-tomorrow t)
+ (set-face-attribute 'fringe t :background "#ffffff")
+ (setq base16-distinct-fringe-background nil)
+ (when (fboundp 'menu-bar-mode)(menu-bar-mode -1))
+ (when (fboundp 'scroll-bar-mode)(scroll-bar-mode -1))
+ (when (fboundp 'tool-bar-mode)(tool-bar-mode -1))
+ (when (fboundp 'window-divider-mode)(window-divider-mode -1))))
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; PACKAGE ENABLE
@@ -581,11 +580,9 @@
(global-set-key (kbd "C-c y") nil)
(global-set-key (kbd "C-c z") nil)
(global-set-key (kbd "C-c #") 'display-line-numbers-mode)
-(global-set-key (kbd "C-r") nil)
-(global-set-key (kbd "C-s") 'swiper)
+(global-set-key (kbd "C-r") 'rgrep)
(global-set-key (kbd "C-x 9") 'dwrz-split-window-two-thirds)
(global-set-key (kbd "C-x C-b") 'ibuffer)
-(global-set-key (kbd "C-x C-f") nil)
(global-set-key (kbd "C-x g") 'magit-status)
(global-set-key (kbd "C-x m") 'notmuch)
(global-set-key (kbd "C-x t") 'dwrz-shell-in-current-directory)