config

Personal configuration.
git clone git://code.dwrz.net/config
Log | Files | Refs

commit 2fe223a431fa583c7f6b5d66bae4c65edee0cc9c
parent f2a27f25f98e9411441aa82fbe8c17a9abbc0b65
Author: dwrz <dwrz@dwrz.net>
Date:   Mon,  2 Jan 2023 12:05:39 +0000

Update emacs init

Diffstat:
Memacs/init.el | 69++++++++++++---------------------------------------------------------
1 file changed, 12 insertions(+), 57 deletions(-)

diff --git a/emacs/init.el b/emacs/init.el @@ -1,5 +1,5 @@ ;; C source code variables. -(setq auto-save-interval 30 +(setq auto-save-interval 24 delete-by-moving-to-trash t echo-keystrokes 0.1 enable-recursive-minibuffers t @@ -44,13 +44,6 @@ (when filename (kill-new filename) (message "Copied buffer file name '%s' to the clipboard." filename)))) -(defun dwrz-open-calendar () - "Open a calfw calendar." - (interactive) - (cfw:open-calendar-buffer - :contents-sources - (list (cfw:org-create-source "forest green") (cfw:cal-create-source "red")))) - (defun dwrz-org-capture-at-point () "Insert an org capture template at point." (interactive) @@ -81,9 +74,6 @@ ("gnu" . "https://elpa.gnu.org/packages/") ("melpa" . "https://melpa.org/packages/"))) -(require 'calfw) -(require 'calfw-cal) -(require 'calfw-org) (autoload 'notmuch "notmuch" "Notmuch mail" t) ;; PACKAGE CONFIGURATION @@ -108,12 +98,7 @@ (with-eval-after-load 'cc-vars (setq-default c-basic-offset 8)) (with-eval-after-load 'company - (setq company-backends - '((company-yasnippet company-clang company-cmake - company-capf company-files company-gtags - company-etags company-keywords) - (company-abbrev company-dabbrev company-dabbrev-code)) - company-idle-delay 0 + (setq company-idle-delay 0 company-minimum-prefix-length 1 company-show-numbers t company-tooltip-align-annotations t) @@ -152,9 +137,6 @@ (with-eval-after-load 'emacs-lisp-mode (add-hook 'emacs-lisp-mode-hook 'eldoc-mode) (add-hook 'emacs-lisp-mode-hook - '(lambda () (set (make-local-variable 'company-backends) - '((company-capf company-files))))) - (add-hook 'emacs-lisp-mode-hook '(lambda () (setq indent-tabs-mode nil))) (font-lock-add-keywords 'emacs-lisp-mode '(("\\<\\(FIX\\|TODO\\|NB\\)" 1 font-lock-warning-face t)))) @@ -185,12 +167,9 @@ (add-hook 'go-mode-hook 'lsp) (add-hook 'go-mode-hook '(lambda () - (set (make-local-variable 'company-backends) - '((company-capf company-files))) (set (make-local-variable 'before-save-hook) '(lsp-organize-imports - lsp-format-buffer - delete-trailing-whitespace)))) + 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,11 +179,9 @@ (with-eval-after-load 'go-playground (setq go-playground-ask-file-name nil go-playground-basedir "/home/dwrz/.local/share/go/src/playground/" - go-playground-go-command "GO111MODULE=on go" + go-playground-go-command "GO111MODULE=auto go" go-playground-init-command "go mod init")) -(with-eval-after-load 'holiday (setq holiday-bahai-holidays nil)) - (with-eval-after-load 'ivy (setq ivy-initial-inputs-alist nil ivy-wrap t @@ -223,10 +200,7 @@ (with-eval-after-load 'js-mode (setq js-indent-level 2) - (add-hook 'js-mode-hook 'lsp) - (add-hook 'js-mode-hook - '(lambda () (set (make-local-variable 'company-backends) - '((company-capf company-files)))))) + (add-hook 'js-mode-hook 'lsp)) (with-eval-after-load 'message (setq message-directory "drafts" @@ -323,7 +297,8 @@ org-todo-keywords '((sequence "NEXT(n)" "IN-PROGRESS(i)" "RECURRING(r)" "WAITING(w)" "|" "SOMEDAY-MAYBE(s)" - "DELEGATED(e)" "CANCELED(c)" "DONE(d)"))) + "EVENT(v)" "DELEGATED(e)" "CANCELED(c)" + "DONE(d)"))) (add-hook 'org-babel-after-execute-hook (lambda () (when org-inline-image-overlays (org-redisplay-inline-images)))) @@ -356,12 +331,13 @@ "~/org/someday-maybe.org" "~/projects/chinese/chinese.org" "~/projects/community/community.org" - "~/projects/src/dwrz.org" + "~/projects/src/src.org" "~/projects/career/career.org" "~/projects/finances/finances.org" "~/projects/health/health.org" "~/projects/home/home.org" "~/projects/recurse-center/recurse-center.org" + "~/projects/mwb/mwb.org" "~/projects/rz/rz.org") org-archive-location "/home/dwrz/org/archive.org::")))) @@ -404,6 +380,7 @@ ("RECURRING" . "#f5871f") ("WAITING" . "#eab700") ("DONE" . "#4271ae") + ("EVENT" . "#3e999f") ("DELEGATED" . "#969896") ("CANCELED" . "#a3685a") ("SOMEDAY-MAYBE" . "#8959a8")))) @@ -420,10 +397,8 @@ (add-hook 'prog-mode-hook 'rainbow-mode) (add-hook 'prog-mode-hook 'visual-line-mode)) -(with-eval-after-load 'pyim (pyim-basedict-enable)) - (with-eval-after-load 'register - (set-register ?j '(file . "~/journal/2022/2022.org")) + (set-register ?j '(file . "~/journal/2023/2023.org")) (set-register ?i '(file . "~/.config/emacs/init.el")) (set-register ?g '(file . "~/org/gtd.org")) (set-register ?o '(file . "~/org/dwrz.org"))) @@ -450,17 +425,12 @@ shift-select-mode nil) (add-hook 'visual-line-mode-hook 'visual-fill-column-mode)) -(with-eval-after-load 'super-save (setq super-save-auto-save-when-idle t)) - (with-eval-after-load 'subr-x (defalias 'yes-or-no-p 'y-or-n-p)) (with-eval-after-load 'text-mode (add-hook 'text-mode-hook 'flyspell-mode) (add-hook 'text-mode-hook 'rainbow-mode) - (add-hook 'text-mode-hook 'visual-line-mode) - (add-hook 'text-mode-hook - '(lambda () (set (make-local-variable 'company-backends) - '((company-capf company-files)))))) + (add-hook 'text-mode-hook 'visual-line-mode)) (with-eval-after-load 'time (setq display-time-mode nil)) @@ -474,12 +444,6 @@ web-mode-indent-style 2 web-mode-markup-indent-offset 2) (add-hook 'web-mode-hook 'electric-pair-mode) - (add-hook 'web-mode-hook - '(lambda () (set (make-local-variable 'company-backends) - '((company-web-html - company-capf - company-yasnippet - company-files))))) (add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode)) (add-to-list 'auto-mode-alist '("\\.gohtml\\'" . web-mode))) @@ -487,8 +451,6 @@ (setq split-height-threshold nil split-width-threshold 160)) -(with-eval-after-load 'yasnippet (define-key yas-keymap (kbd "<tab>") nil)) - ;; CUSTOMIZE (customize-set-variable 'face-font-family-alternatives '(("hans" "adobe-source-han-sans-cn-font"))) @@ -513,7 +475,6 @@ (column-number-mode) (company-quickhelp-mode t) (delete-selection-mode nil) -(global-anzu-mode t) (global-auto-revert-mode t) (global-company-mode t) (global-hl-line-mode t) @@ -521,9 +482,6 @@ (ivy-mode t) (show-paren-mode t) (size-indication-mode) -(super-save-mode t) -(yas-global-mode t) -(yas-load-directory "/home/dwrz/.config/emacs/snippets") ;; HYDRAS (defhydra hydra-highlight (:color blue) @@ -572,8 +530,6 @@ ("w" hydra-windows/body "windows" :column "hydras")) ;; KEYBINDINGS -(global-set-key [remap query-replace] 'anzu-query-replace) -(global-set-key [remap query-replace-regexp] 'anzu-query-replace-regexp) (global-set-key (kbd "C-c a") 'org-agenda) (global-set-key (kbd "C-c b") 'ibuffer) (global-set-key (kbd "C-c c") 'dwrz-org-capture-at-point) @@ -608,7 +564,6 @@ (global-set-key (kbd "C-x C-b") 'ibuffer) (global-set-key (kbd "C-x C-f") 'counsel-find-file) (global-set-key (kbd "C-x b") 'ivy-switch-buffer) -(global-set-key (kbd "C-x c") 'dwrz-open-calendar) (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-terminal)