aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/init
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/.emacs.d/init')
-rw-r--r--emacs/.emacs.d/init/ycp-basic.el8
-rw-r--r--emacs/.emacs.d/init/ycp-buffer.el2
-rw-r--r--emacs/.emacs.d/init/ycp-complete.el9
-rw-r--r--emacs/.emacs.d/init/ycp-dired.el2
-rw-r--r--emacs/.emacs.d/init/ycp-editing.el25
-rw-r--r--emacs/.emacs.d/init/ycp-gnus.el2
-rw-r--r--emacs/.emacs.d/init/ycp-grep.el32
-rw-r--r--emacs/.emacs.d/init/ycp-help.el5
-rw-r--r--emacs/.emacs.d/init/ycp-org.el11
-rw-r--r--emacs/.emacs.d/init/ycp-pdf.el7
-rw-r--r--emacs/.emacs.d/init/ycp-prog.el49
-rw-r--r--emacs/.emacs.d/init/ycp-project.el1
-rw-r--r--emacs/.emacs.d/init/ycp-system.el19
-rw-r--r--emacs/.emacs.d/init/ycp-time.el2
-rw-r--r--emacs/.emacs.d/init/ycp-vc.el16
15 files changed, 132 insertions, 58 deletions
diff --git a/emacs/.emacs.d/init/ycp-basic.el b/emacs/.emacs.d/init/ycp-basic.el
index 12000e5..160c385 100644
--- a/emacs/.emacs.d/init/ycp-basic.el
+++ b/emacs/.emacs.d/init/ycp-basic.el
@@ -3,8 +3,6 @@
;; Copyright (C) 2023 Free Software Foundation.
;; Author: Yuchen Pei <id@ypei.org>
-;; Protesilaos Stavrou <info@protesilaos.com>
-;; Maintainer: Yuchen Pei <id@ypei.org>
;; Package-Requires: ((emacs "28.2"))
;; This file is part of dotfiles.
@@ -36,8 +34,11 @@
"C-x C-c C-c" #'save-buffers-kill-emacs
"C-x C-z" nil
)
+ (my-keybind special-event-map
+ "<sigusr1>" 'my-quit-emacs)
(setq auth-source-save-behavior nil)
(setq use-short-answers t)
+ (setq use-dialog-box nil)
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
@@ -45,6 +46,9 @@
(set-language-environment 'utf-8)
(setq load-prefer-newer t)
(setq message-log-max 16384)
+ (setq attempt-stack-overflow-recovery nil)
+ (setq confirm-kill-processes nil)
+ (setq attempt-orderly-shutdown-on-fatal-signal nil)
)
(my-configure
diff --git a/emacs/.emacs.d/init/ycp-buffer.el b/emacs/.emacs.d/init/ycp-buffer.el
index 91edec5..3c9f339 100644
--- a/emacs/.emacs.d/init/ycp-buffer.el
+++ b/emacs/.emacs.d/init/ycp-buffer.el
@@ -3,8 +3,6 @@
;; Copyright (C) 2023 Free Software Foundation.
;; Author: Yuchen Pei <id@ypei.org>
-;; Protesilaos Stavrou <info@protesilaos.com>
-;; Maintainer: Yuchen Pei <id@ypei.org>
;; Package-Requires: ((emacs "28.2"))
;; This file is part of dotfiles.
diff --git a/emacs/.emacs.d/init/ycp-complete.el b/emacs/.emacs.d/init/ycp-complete.el
index 8e27f8e..c29b4d2 100644
--- a/emacs/.emacs.d/init/ycp-complete.el
+++ b/emacs/.emacs.d/init/ycp-complete.el
@@ -3,8 +3,6 @@
;; Copyright (C) 2023 Free Software Foundation.
;; Author: Yuchen Pei <id@ypei.org>
-;; Protesilaos Stavrou <info@protesilaos.com>
-;; Maintainer: Yuchen Pei <id@ypei.org>
;; Package-Requires: ((emacs "28.2"))
;; This file is part of dotfiles.
@@ -165,7 +163,12 @@
(my-package company
(:install t)
(:delay 5)
- (add-hook 'message-mode-hook #'company-mode))
+ (add-hook 'message-mode-hook #'company-mode)
+ (setq company-idle-delay .1
+ company-minimum-prefix-length 2
+ company-selection-wrap-around t
+ company-show-numbers t
+ company-require-match 'never))
;;; cape
(my-package cape
diff --git a/emacs/.emacs.d/init/ycp-dired.el b/emacs/.emacs.d/init/ycp-dired.el
index 613bc0b..a0892ab 100644
--- a/emacs/.emacs.d/init/ycp-dired.el
+++ b/emacs/.emacs.d/init/ycp-dired.el
@@ -3,8 +3,6 @@
;; Copyright (C) 2023 Free Software Foundation.
;; Author: Yuchen Pei <id@ypei.org>
-;; Protesilaos Stavrou <info@protesilaos.com>
-;; Maintainer: Yuchen Pei <id@ypei.org>
;; Package-Requires: ((emacs "28.2"))
;; This file is part of dotfiles.
diff --git a/emacs/.emacs.d/init/ycp-editing.el b/emacs/.emacs.d/init/ycp-editing.el
index ab1bc9e..7af3587 100644
--- a/emacs/.emacs.d/init/ycp-editing.el
+++ b/emacs/.emacs.d/init/ycp-editing.el
@@ -3,8 +3,6 @@
;; Copyright (C) 2023 Free Software Foundation.
;; Author: Yuchen Pei <id@ypei.org>
-;; Protesilaos Stavrou <info@protesilaos.com>
-;; Maintainer: Yuchen Pei <id@ypei.org>
;; Package-Requires: ((emacs "28.2"))
;; This file is part of dotfiles.
@@ -40,13 +38,15 @@
(setq show-paren-delay 0)
(setq window-divider-default-bottom-width 1)
(setq window-divider-default-places 'bottom-only)
-(define-key input-decode-map [?\C-m] [C-m]) ; don't interpret C-m as RET
+;; don't interpret C-m as RET
+(define-key input-decode-map [?\C-m] [C-m])
+(setq save-place-file (locate-user-emacs-file "saveplace"))
(my-package my-editing
(:delay 5)
(my-keybind global-map
- "C-k" #'my-kill-forward
- "M-k" #'my-kill-backward
+ "C-k" #'my-kill-line
+ "M-k" #'my-kill-line-backward
"M-w" #'my-copy-line-or-region
"C-o" #'my-new-line-above-or-below
"C-<" #'my-escape-url-dwim
@@ -66,9 +66,9 @@
"C-M-y" #'my-yank-primary
"C-a" #'my-beginning-of-line-or-indentation
"M-c" #'my-copy-buffer-file-name ; override capitalize
- "M-o" #'delete-blank-lines ; alias for C-x C-o
+ "M-o" #'delete-blank-lines ; alias for C-x C-o
"M-SPC" #'cycle-spacing
- "M-z" #'zap-up-to-char ; NOT `zap-to-char'
+ "M-z" #'zap-up-to-char ; NOT `zap-to-char'
"<C-M-backspace>" #'backward-kill-sexp
)
(electric-pair-mode)
@@ -118,7 +118,10 @@
(define-key global-map (kbd "C-x F") 'my-sudo-find-file)
;; find file
-(ffap-bindings)
+(my-package ffap
+ (ffap-bindings)
+ ;; Stop ffap from pinging things that look like domain names
+ (setq ffap-machine-p-known 'accept))
(put 'narrow-to-region 'disabled nil)
@@ -128,8 +131,14 @@
(setq version-control t)
(add-hook 'text-mode-hook #'turn-on-auto-fill)
+
+(my-add-hooks #'my-non-special-modes-setup '(text-mode prog-mode))
+
(add-to-list
'auto-mode-alist
'("\\(README\\|CHANGELOG\\|COPYING\\|LICENSE\\)\\'" . text-mode))
(add-hook 'before-save-hook 'time-stamp)
+
+(save-place-mode 1)
+
(provide 'ycp-editing)
diff --git a/emacs/.emacs.d/init/ycp-gnus.el b/emacs/.emacs.d/init/ycp-gnus.el
index d8ae4ed..f061fcf 100644
--- a/emacs/.emacs.d/init/ycp-gnus.el
+++ b/emacs/.emacs.d/init/ycp-gnus.el
@@ -3,8 +3,6 @@
;; Copyright (C) 2023 Free Software Foundation.
;; Author: Yuchen Pei <id@ypei.org>
-;; Protesilaos Stavrou <info@protesilaos.com>
-;; Maintainer: Yuchen Pei <id@ypei.org>
;; Package-Requires: ((emacs "28.2"))
;; This file is part of dotfiles.
diff --git a/emacs/.emacs.d/init/ycp-grep.el b/emacs/.emacs.d/init/ycp-grep.el
index 3c784f0..2e75e26 100644
--- a/emacs/.emacs.d/init/ycp-grep.el
+++ b/emacs/.emacs.d/init/ycp-grep.el
@@ -3,8 +3,6 @@
;; Copyright (C) 2023 Free Software Foundation.
;; Author: Yuchen Pei <id@ypei.org>
-;; Protesilaos Stavrou <info@protesilaos.com>
-;; Maintainer: Yuchen Pei <id@ypei.org>
;; Package-Requires: ((emacs "28.2"))
;; This file is part of dotfiles.
@@ -40,24 +38,24 @@
(grep-apply-setting 'grep-find-template
"find -H <D> <X> -type f <F> -exec grep <C> -n --null -E -A1 -B1 <R> /dev/null \\{\\} +")
(setq grep-files-aliases
- '(("all" . "* .*")
- ("el" . "*.el")
- ("ch" . "*.[ch]")
- ("c" . "*.c")
- ("cc" . "*.cc *.cxx *.cpp *.C *.CC *.c++")
- ("cchh" . "*.cc *.[ch]xx *.[ch]pp *.[CHh] *.CC *.HH *.[ch]++")
- ("hh" . "*.hxx *.hpp *.[Hh] *.HH *.h++")
- ("h" . "*.h")
- ("l" . "[Cc]hange[Ll]og*")
- ("m" . "[Mm]akefile*")
- ("tex" . "*.tex")
- ("texi" . "*.texi")
- ("asm" . "*.[sS]")
- ("docs" . "*.md *.html *.rst *.org *.txt *.asciidoc *.adoc *.tex *.texi")))
+ '(("all" . "* .*")
+ ("el" . "*.el")
+ ("ch" . "*.[ch]")
+ ("c" . "*.c")
+ ("cc" . "*.cc *.cxx *.cpp *.C *.CC *.c++")
+ ("cchh" . "*.cc *.[ch]xx *.[ch]pp *.[CHh] *.CC *.HH *.[ch]++")
+ ("hh" . "*.hxx *.hpp *.[Hh] *.HH *.h++")
+ ("h" . "*.h")
+ ("l" . "[Cc]hange[Ll]og*")
+ ("m" . "[Mm]akefile*")
+ ("tex" . "*.tex")
+ ("texi" . "*.texi")
+ ("asm" . "*.[sS]")
+ ("docs" . "*.md *.html *.rst *.org *.txt *.asciidoc *.adoc *.tex *.texi")))
(my-keybind global-map
"C-c r f" #'grep-find
"C-c r g" #'grep)
-)
+ )
(my-package my-grep
(:delay 10)
diff --git a/emacs/.emacs.d/init/ycp-help.el b/emacs/.emacs.d/init/ycp-help.el
index b699be9..9ed0831 100644
--- a/emacs/.emacs.d/init/ycp-help.el
+++ b/emacs/.emacs.d/init/ycp-help.el
@@ -3,8 +3,6 @@
;; Copyright (C) 2023 Free Software Foundation.
;; Author: Yuchen Pei <id@ypei.org>
-;; Protesilaos Stavrou <info@protesilaos.com>
-;; Maintainer: Yuchen Pei <id@ypei.org>
;; Package-Requires: ((emacs "28.2"))
;; This file is part of dotfiles.
@@ -56,7 +54,8 @@
(my-package eldoc
(:delay 5)
- (setq eldoc-echo-area-prefer-doc-buffer t)
+ (setq eldoc-echo-area-prefer-doc-buffer t
+ eldoc-idle-delay .1)
)
(my-package man
diff --git a/emacs/.emacs.d/init/ycp-org.el b/emacs/.emacs.d/init/ycp-org.el
index 77c4436..a5917a6 100644
--- a/emacs/.emacs.d/init/ycp-org.el
+++ b/emacs/.emacs.d/init/ycp-org.el
@@ -35,6 +35,8 @@
"C-c a" #'org-agenda
"C-c c" #'org-capture
"<f6>" #'my-org-open-default-notes-file
+ "C-a" #'my-org-beginning-of-line-or-indent
+ "C-k" #'my-org-kill-line
)
(setq org-startup-folded 'overview)
(my-override org-next-link)
@@ -50,7 +52,7 @@
(my-keybind org-mode-map
"C-j" #'org-return-and-maybe-indent)
(my-keybind org-mode-map
- "C-j" #'default-indent-new-line))
+ "C-j" #'default-indent-new-line))
(my-keybind minibuffer-mode-map "M-l" #'org-insert-last-stored-link)
(my-setq-from-local my-org-common-properties org-directory
my-org-doc-dir)
@@ -66,12 +68,14 @@
(setq org-special-ctrl-a/e t)
(setq org-special-ctrl-k t)
(setq org-M-RET-may-split-line '((default . t)))
- (setq org-catch-invisible-edits 'show)
+ (setq org-catch-invisible-edits 'error)
(setq org-modules '(ol-bbdb ol-gnus ol-info))
(setq org-use-sub-superscripts '{})
(setq org-todo-keywords
'((sequence "TODO(t!)" "DOIN(i!)" "WAIT(w!)" "|"
"DONE(d!)" "OBSO(o!)" "DUPL(u!)")))
+ (setq org-enforce-todo-dependencies t
+ org-enforce-todo-checkbox-dependencies t)
(setq org-use-fast-todo-selection 'expert)
(setq org-fontify-quote-and-verse-blocks t)
(setq org-highlight-latex-and-related nil) ; other options affect elisp regexp
@@ -99,7 +103,8 @@
("v" . "verse")))
(setq org-use-tag-inheritance nil)
(my-setq-from-local org-default-notes-file)
- (setq org-export-backends '(ascii beamer html icalendar latex md odt org))
+ (setq org-export-backends '(ascii beamer html latex md odt org))
+ (setq org-export-with-sub-superscripts '{})
(setq org-image-actual-width '(400))
(setq org-log-into-drawer t)
(plist-put org-format-latex-options :scale 1.5)
diff --git a/emacs/.emacs.d/init/ycp-pdf.el b/emacs/.emacs.d/init/ycp-pdf.el
index d90a527..4be7a68 100644
--- a/emacs/.emacs.d/init/ycp-pdf.el
+++ b/emacs/.emacs.d/init/ycp-pdf.el
@@ -31,7 +31,9 @@
(my-package pdf-tools
(:install t)
(:delay 15)
- (pdf-loader-install))
+ (pdf-loader-install)
+ (my-keybind pdf-view-mode-map
+ "M-w" #'pdf-view-kill-ring-save))
(my-package pdf-history
(:delay 15)
@@ -52,7 +54,8 @@
"P" #'my-pdf-view-backward-node-same-depth
"U" #'my-pdf-view-backward-node-lower-depth
"." #'my-pdf-view-enlarge-a-bit
- "," #'my-pdf-view-shrink-a-bit)
+ "," #'my-pdf-view-shrink-a-bit
+ )
)
(provide 'ycp-pdf)
diff --git a/emacs/.emacs.d/init/ycp-prog.el b/emacs/.emacs.d/init/ycp-prog.el
index 6392cf8..0b04509 100644
--- a/emacs/.emacs.d/init/ycp-prog.el
+++ b/emacs/.emacs.d/init/ycp-prog.el
@@ -115,7 +115,7 @@
#'my-comint-send-input-and-return-prompt)
(add-to-list 'my-buffer-create-functions
'(shell-mode . my-shell-with-directory))
- (my-keybind shell-mode-map "<f2>" #'my-restart-shell)
+ (my-keybind comint-mode-map "<f2>" #'my-comint-restart)
(add-hook 'shell-mode-hook 'my-shell-disable-company-if-remote)
(my-keybind global-map "<f10>" #'my-switch-or-create-shell-buffer)
)
@@ -134,10 +134,8 @@
;; (bash-completion-setup)
)
-;;; prog modes: c, c++, elisp, js, css, ts,
(my-package prog-mode
- (add-hook 'prog-mode-hook #'display-line-numbers-mode)
- (add-hook 'prog-mode-hook (lambda () (setq-local tab-width 2))))
+ (add-hook 'prog-mode-hook #'my-prog-modes-setup))
;; cmake
(my-package cmake-mode
@@ -183,6 +181,15 @@
(define-key c-mode-map (kbd "C-c C-c") 'compile)
(define-key c++-mode-map (kbd "C-c C-c") 'project-compile)
(add-to-list 'auto-mode-alist '("\\.inl\\'" . c++-mode))
+ (setq c-default-style
+ '((java-mode . "java")
+ (awk-mode . "awk")
+ (c-mode . "user")
+ (c++-mode . "user")
+ (other . "gnu")))
+ (setq-default c-electric-flag t)
+ ;; prevent backspace from untabifying
+ (setq c-backspace-function 'delete-backward-char)
)
(my-package my-prog
@@ -199,7 +206,9 @@
(my-package elisp-mode
(:delay 10)
(my-keybind emacs-lisp-mode-map
- "C-c C-c" #'eval-buffer)
+ "C-c C-c" #'eval-buffer
+ "C-c C-z" #'ielm
+ "C-," #'my-insert-current-prefix)
(add-hook 'emacs-lisp-mode-hook (lambda () (auto-fill-mode 1)))
(setq print-length 1000)
(my-keybind global-map
@@ -215,11 +224,20 @@
'emacs-lisp-mode)))
;; for deep recursion, e.g. in radix tree
(setq max-specpdl-size 32000)
+ (add-to-list 'auto-mode-alist '("Cask\\'" . emacs-lisp-mode))
(require 'my-prog)
(my-keybind emacs-lisp-mode-map
"C-M-x" #'my-eval-defun-or-region)
)
+(my-package data-debug
+ (:delay 10)
+ (my-keybind global-map
+ "C-:" 'data-debug-eval-expression))
+
+(setq debugger-stack-frame-as-list t)
+(setq display-raw-bytes-as-hex t)
+
;;; paredit
(my-package paredit
(:install t)
@@ -243,6 +261,15 @@
"M-h" #'paredit-convolute-sexp)
)
+(my-package compile
+ (:delay 15)
+ (setq compilation-always-kill t
+ compilation-ask-about-save nil
+ compilation-context-lines 10
+ compilation-scroll-output 'first-error
+ compilation-skip-threshold 2)
+ )
+
;;; flymake
(my-package flymake
(:install t)
@@ -468,5 +495,17 @@
(add-hook 'c++-mode-hook 'my-set-header-line-to-which-func)
)
+;;; nxml
+(my-package nxml-mode
+ (:delay 60)
+ (setq nxml-slash-auto-complete-flag t))
+
+(my-package etags
+ (:delay 60)
+ (setq tags-file-name "TAGS"))
+
+(my-package nroff-mode
+ (add-to-list 'auto-mode-alist '("\\.mdoc\\'" . nroff-mode)))
+
(provide 'ycp-prog)
;;; ycp-prog.el ends here
diff --git a/emacs/.emacs.d/init/ycp-project.el b/emacs/.emacs.d/init/ycp-project.el
index e5442bb..15c7fcc 100644
--- a/emacs/.emacs.d/init/ycp-project.el
+++ b/emacs/.emacs.d/init/ycp-project.el
@@ -36,6 +36,7 @@
"\C-xpD" #'my-project-dired-at
"\C-xpR" #'my-project-rgrep-at
"\C-xpC" #'my-project-code-stats)
+ (my-override project-remember-projects-under)
(my-server-idle-timer
my-project-remember-projects-timer
300 t
diff --git a/emacs/.emacs.d/init/ycp-system.el b/emacs/.emacs.d/init/ycp-system.el
index 3d52d34..6dbcf7d 100644
--- a/emacs/.emacs.d/init/ycp-system.el
+++ b/emacs/.emacs.d/init/ycp-system.el
@@ -3,8 +3,6 @@
;; Copyright (C) 2023 Free Software Foundation.
;; Author: Yuchen Pei <id@ypei.org>
-;; Protesilaos Stavrou <info@protesilaos.com>
-;; Maintainer: Yuchen Pei <id@ypei.org>
;; Package-Requires: ((emacs "28.2"))
;; This file is part of dotfiles.
@@ -45,7 +43,18 @@
(setq tramp-default-method "ssh")
(setq explicit-shell-file-name "/bin/bash")
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
-
+ ;; keep backup files locally rather than remote
+ (setq tramp-backup-directory-alist backup-directory-alist)
+ (with-eval-after-load 'tramp-cache
+ (setq tramp-persistency-file-name (locate-user-emacs-file
+ "tramp")))
+ ;; Use discovered value for ssh options
+ (setq tramp-ssh-controlmaster-options "")
+ ;; Stop tramp from interfering with everything
+ (setq file-name-handler-alist
+ (seq-filter
+ (--remove (string-match-p "^tramp" (symbol-name (cdr it)))
+ file-name-handler-alist)))
(connection-local-set-profile-variables
'termux-bash
'((explicit-shell-file-name . "/data/data/com.termux/files/usr/bin/bash")
@@ -79,7 +88,9 @@
'((explicit-shell-file-name . "/system/bin/sh")))
(connection-local-set-profiles
'(:application tramp :protocol "adb")
- 'adb-shell))
+ 'adb-shell)
+ (require 'my-system)
+ (setq file-name-handler-alist (my-file-handlers-without-tramp)))
(provide 'ycp-system)
;;; ycp-system.el ends here
diff --git a/emacs/.emacs.d/init/ycp-time.el b/emacs/.emacs.d/init/ycp-time.el
index bc43764..f98a9cd 100644
--- a/emacs/.emacs.d/init/ycp-time.el
+++ b/emacs/.emacs.d/init/ycp-time.el
@@ -3,8 +3,6 @@
;; Copyright (C) 2023 Free Software Foundation.
;; Author: Yuchen Pei <id@ypei.org>
-;; Protesilaos Stavrou <info@protesilaos.com>
-;; Maintainer: Yuchen Pei <id@ypei.org>
;; Package-Requires: ((emacs "28.2"))
;; This file is part of dotfiles.
diff --git a/emacs/.emacs.d/init/ycp-vc.el b/emacs/.emacs.d/init/ycp-vc.el
index d9de2ca..66bb06f 100644
--- a/emacs/.emacs.d/init/ycp-vc.el
+++ b/emacs/.emacs.d/init/ycp-vc.el
@@ -52,7 +52,6 @@
(setq ediff-make-buffers-readonly-at-startup nil)
(setq ediff-show-clashes-only t)
(setq ediff-split-window-function 'split-window-horizontally)
- (setq ediff-window-setup-function 'ediff-setup-windows-plain)
)
(my-package vc-git
@@ -61,6 +60,17 @@
'(vc-git-annotate-switches . "-w"))
(setq vc-git-grep-template "git --no-pager grep -n <C> -A1 -B1 -e <R> -- <F>"))
+(my-package diff-hl
+ (:delay 30)
+ (:install t)
+ (global-diff-hl-mode)
+ (diff-hl-flydiff-mode))
+
+(my-package diffview
+ (:delay 30)
+ (:install t)
+ )
+
(my-package git-commit
(:install t)
(:delay 30)
@@ -78,14 +88,14 @@
(require 'magit-repos)
(my-setq-from-local magit-repository-directories)
(put 'magit-clean 'disabled nil)
-)
+ )
(my-package my-magit
(:delay 30)
(my-keybind global-map
"C-x pM" #'my-project-magit-at
"C-x g" #'my-magit-status)
-)
+ )
(my-package magit-annex
(:delay 60))