summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorTCCQ <thomasmulmer02@gmail.com>2025-02-14 15:40:29 -0800
committerTCCQ <thomasmulmer02@gmail.com>2025-02-14 15:40:29 -0800
commit2576f016153baa11c6e62deeb329dd72f0aa89c8 (patch)
treeafd9e5c4cd42a67a4cacd82fc4f63622c1a26990 /emacs
parent5b23587f638dde8faf821edd50d72cb988af5387 (diff)
emacs full rework from laptop
Diffstat (limited to 'emacs')
-rw-r--r--emacs/coding-config.el364
-rw-r--r--emacs/init.el345
-rwxr-xr-xemacs/personal-lisp/coding-config.el165
-rw-r--r--emacs/single-header.el131
-rw-r--r--emacs/site-lisp/chinese.el (renamed from emacs/personal-lisp/chinese.el)0
-rwxr-xr-xemacs/site-lisp/coding-config.el127
-rw-r--r--emacs/site-lisp/evil-config.el (renamed from emacs/personal-lisp/evil-conf.el)50
-rw-r--r--emacs/site-lisp/exwm-pref.el284
-rw-r--r--emacs/site-lisp/general-text.el (renamed from emacs/personal-lisp/general-text.el)19
-rw-r--r--emacs/site-lisp/maze.el64
-rw-r--r--emacs/site-lisp/modeline-config.el63
-rw-r--r--emacs/site-lisp/my-binds.el (renamed from emacs/personal-lisp/custom-binds.el)22
-rw-r--r--emacs/site-lisp/my-funcs.el (renamed from emacs/personal-lisp/custom-funcs.el)20
-rwxr-xr-xemacs/site-lisp/single-header.el (renamed from emacs/personal-lisp/single-header.el)28
-rw-r--r--emacs/site-lisp/tex-conf.el (renamed from emacs/personal-lisp/tex-conf.el)0
-rwxr-xr-xemacs/site-lisp/tmu-custom-theme.el (renamed from emacs/personal-lisp/tmu-custom-theme.el)2
-rw-r--r--emacs/tmu-custom-theme.el60
17 files changed, 879 insertions, 865 deletions
diff --git a/emacs/coding-config.el b/emacs/coding-config.el
deleted file mode 100644
index e054b52..0000000
--- a/emacs/coding-config.el
+++ /dev/null
@@ -1,364 +0,0 @@
-;;; project-stuff --- Things I want for coding mostly
-
-;;; Commentary:
-
-;;; Just want to seperate the coding stuff from my other init stuff
-
-
-(add-hook 'xref-backend-functions 'gxref-xref-backend)
-
-;; don't forget that eglot exists
-;; (global-company-mode 1)
-;; (setq company-idle-delay 0.1)
-
-;; (require 'semantic/sb)
-;; (setq semantic-default-submodes
-;; '(global-semantic-idle-scheduler-mode
-;; semantic-db-minor-mode
-;; global-semantic-idle-summary-mode
-;; global-semantic-idle-completions-mode
-;; global-semantic-highlight-func-mode
-;; global-semantic-mru-bookmark-mode
-;; global-semantic-idle-local-symbol-highlight-mode)
-;; semantic-idle-scheduler-work-idle-time 5)
-;; (semantic-mode 1
-;; (global-ede-mode t)
-
-;; better commenting stuff
-(global-set-key (kbd "C-x C-;") 'comment-or-uncomment-region)
-(global-set-key (kbd "C-x ;") 'comment-line)
-(global-set-key (kbd "C-x :") 'comment-set-column) ;never gonna use but whatever
-
-(setq asm-comment-char ?#)
-
-(add-hook 'asm-mode-hook
- (lambda ()
- (add-hook 'after-save-hook
- (lambda ()
- (shell-command
- "find . -iregex '.*\\.[sS]' -exec etags -l none -r '/\\([a-zA-Z0-9\\-_]+\\):/\1/' {} +"))
- 0 t)))
-
-;; nice eglot binds
-(global-set-key (kbd "C-c f") 'eglot-code-action-quickfix)
-(global-set-key (kbd "C-c C-f") 'eglot-code-actions)
-
-;; deal white whitespace better
-(setq whitespace-style
- '(face trailing tabs missing-newline-at-eof indentation space-after-tab space-before-tab tab-mark))
-(setq fill-column 80)
-(global-hl-todo-mode 1)
-
-
-;; (require 'sr-speedbar "~/.emacs.d/sr-speedbar.el" nil)
-;; (defun speedbar-switch-and-setup ()
-;; "Switch in and out of the speedbar, opening as necessary."
-;; (interactive)
-;; (if (eq major-mode 'speedbar-mode)
-;; (select-window (previous-window))
-;; (let ((cur (current-buffer))
-;; (win (get-buffer-window "*SPEEDBAR*")))
-;; (if win
-;; (select-window win)
-;; (sr-speedbar-toggle)
-;; (select-window (get-buffer-window "*SPEEDBAR*")))
-;; (sr-speedbar-refresh)
-;; (speedbar-find-selected-file (buffer-file-name cur))
-;; (speedbar-expand-line))))
-
-;; (define-key speedbar-mode-map (kbd "q") 'sr-speedbar-toggle)
-;; (global-unset-key (kbd "M-i"))
-(global-set-key (kbd "M-i") 'imenu)
-
-(global-set-key (kbd "M-Z") 'suspend-frame)
-
-;; indent code when pasting, from
-;; https://trey-jackson.blogspot.com/2008/03/emacs-tip-15-indent-yanked-code.html
-
-;; automatically indenting yanked text if in programming-modes
-(defvar yank-indent-modes '(emacs-lisp-mode
- c-mode c++-mode
- tcl-mode sql-mode
- perl-mode cperl-mode
- java-mode jde-mode
- lisp-interaction-mode
- LaTeX-mode TeX-mode
- rust-mode
- rustic-mode)
- "Modes in which to indent regions that are yanked (or yank-popped).")
-
-(defun yank-advised-indent-function (beg end)
- "Do indentation, as long as the region isn't too large.
-BEG and END define the region."
- (indent-region beg end nil))
-
-(defadvice yank (after yank-indent activate)
- "If current mode is one of 'yank-indent-modes, indent yanked text (with prefix arg don't indent)."
- (if (and (not (ad-get-arg 0))
- (member major-mode yank-indent-modes))
- (let ((transient-mark-mode nil))
- (yank-advised-indent-function (region-beginning) (region-end)))))
-
-(defadvice yank-pop (after yank-pop-indent activate)
- "If current mode is one of 'yank-indent-modes, indent yanked text (with prefix arg don't indent)."
- (if (and (not (ad-get-arg 0))
- (member major-mode yank-indent-modes))
- (let ((transient-mark-mode nil))
- (yank-advised-indent-function (region-beginning) (region-end)))))
-
-(defadvice evil-paste-before (after yank-indent activate)
- "If current mode is one of 'yank-indent-modes, indent yanked text (with prefix arg don't indent)."
- (if (and (not (ad-get-arg 0))
- (member major-mode yank-indent-modes))
- (let ((transient-mark-mode nil))
- (yank-advised-indent-function (region-beginning) (region-end)))))
-
-(defadvice evil-paste-after (after yank-indent activate)
- "If current mode is one of 'yank-indent-modes, indent yanked text (with prefix arg don't indent)."
- (if (and (not (ad-get-arg 0))
- (member major-mode yank-indent-modes))
- (let ((transient-mark-mode nil))
- (yank-advised-indent-function (region-beginning) (region-end)))))
-
-
-;; make ibuffer play with projectile
-(require 'ibuffer)
-(add-hook 'ibuffer-hook
- (lambda ()
- (ibuffer-projectile-set-filter-groups)
- (unless (eq ibuffer-sorting-mode 'alphabetic)
- (ibuffer-do-sort-by-alphabetic))))
-
-;; make shells and whatnot slightly better
-(require 'comint)
-(setq comint-scroll-to-bottom-on-input t)
-(setq comint-scroll-to-bottom-on-output t)
-
-;; code folding
-
-(add-to-list 'load-path "~/.emacs.d/")
-;; (require 'ts-foldV)
-
-(autoload 'hide-lines "hide-lines" "Hide lines based on a regexp" t)
-(global-set-key (kbd "C-c /") 'hide-lines)
-
-;; region folding
-(autoload 'fold-this "fold-this" "arbitrary folding" t)
-(autoload 'fold-this-unfold-at-point "fold-this" "arbitrary folding" t)
-
-;; folding keybinds
-(defun fold-this-fold-forward (&optional arg)
- "Fold forward ARG number of sexps, defaulting to one."
- (interactive "p")
- (push-mark)
- (forward-sexp arg)
- (fold-this (mark) (point))
- (pop-mark))
-(defun fold-this-fold-backward (&optional arg)
- "Fold backward ARG number of sexps, defaulting to one."
- (interactive "p")
- (push-mark)
- (backward-sexp arg)
- (fold-this (point) (mark))
- (pop-mark))
-
-(define-prefix-command 'fold-map)
-(global-set-key (kbd "M-F") 'fold-map)
-
-(define-keymap :full nil
- :parent nil
- :suppress nil
- :keymap nil
- :name "fold-map"
- :prefix 'fold-map
- (kbd "c") 'fold-this
- (kbd "e") 'fold-this-unfold-at-point
- (kbd "t") 'hs-toggle-hiding
- (kbd "f") 'fold-this-fold-forward
- (kbd "b") 'fold-this-fold-backward
- (kbd "l") 'hs-hide-level)
-
-;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; ;;;;;;;;;;;;;;;; LaTeX ;;;;;;;;;;;;;;;;;
-;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-;; ##### Don't forget to configure
-;; ##### Okular to use emacs in
-;; ##### "Configuration/Configure Okular/Editor"
-;; ##### => Editor => Emacsclient. (you should see
-;; ##### emacsclient -a emacs --no-wait +%l %f
-;; ##### in the field "Command".
-
-(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
-(setq reftex-plug-into-AUCTeX t)
-
-;; ##### Always ask for the master file
-;; ##### when creating a new TeX file.
-(setq-default TeX-master nil)
-
-;; ##### Enable synctex correlation. From Okular just press
-;; ##### Shift + Left click to go to the good line.
-(setq TeX-source-correlate-mode t
- TeX-source-correlate-start-server t)
-
-;; ### Set Okular as the default PDF viewer.
-(eval-after-load "tex"
- '(setcar (cdr (assoc 'output-pdf TeX-view-program-selection)) "Okular"))
-
-(add-hook 'tex-mode-hook (lambda ()
- (setq spell-fu-faces-exclude
- '(tex-math
- font-lock-builtin-face
- font-lock-keyword-face
- font-lock-function-name-face
- font-lock-variable-name-face
- font-latex-sedate-face))
- (outline-minor-mode 1)))
-
-(defun clean-prog-file (buffer)
- "Fixes whitespace in buffer"
- (save-excursion
- (with-current-buffer buffer
- (untabify (point-min) (point-max))
- (goto-char (point-min))
- (while (re-search-forward " +$" nil t)
- (replace-match "" nil nil)))))
-
-(add-hook 'prog-mode-hook (lambda ()
- (hs-minor-mode 1)
- ;; (flymake-mode 1)
- (spell-fu-mode 0)
- (superword-mode 1)
- (whitespace-mode 1)
- (display-fill-column-indicator-mode 1)
- (add-hook 'before-save-hook
- (lambda ()
- (if (not (eq major-mode 'makefile-gmake-mode))
- (clean-prog-file (current-buffer)))))))
-
-
-;; (add-hook 'haskell-mode-hook (lambda ()
-;; (evil-define-key 'normal local-map (kbd "M-.") 'haskell-jump-to-def)
-;; ))
-(setq haskell-tags-on-save t)
-(add-hook 'haskell-mode-hook (lambda ()
- (hindent 1)
- (interactive-haskell-mode 1)
- (eldoc-mode 1)))
-(setq haskell-process-type 'cabal-repl)
-;; (speedbar-add-supported-extension ".hs")
-(eval-after-load 'haskell-mode
- '(define-key haskell-mode-map (kbd "C-c C-o") 'haskell-compile))
-(eval-after-load 'haskell-cabal
- '(define-key haskell-cabal-mode-map (kbd "C-c C-o") 'haskell-compile))
-
-;; (use-package flymake-diagnostic-at-point
-;; :after flymake
-;; :config
-;; (setq flymake-diagnostic-at-point-timer-delay 1)
-;; (add-hook 'flymake-mode-hook #'flymake-diagnostic-at-point-mode))
-
-(use-package sideline
- :init
- (setq sideline-backends-skip-current-line t ; don't display on current line
- sideline-order-left 'down ; or 'up
- sideline-order-right 'up ; or 'down
- sideline-format-left "%s " ; format for left aligment
- sideline-format-right " %s" ; format for right aligment
- sideline-priority 100 ; overlays' priority
- sideline-display-backend-name t) ; display the backend name
- :hook ((flycheck-mode . sideline-mode) ; for `sideline-flycheck`
- (flymake-mode . sideline-mode)) ; for `sideline-flymake`
- :init
- (setq sideline-backends-right '(sideline-flymake)))
-
-
-;; eshell stuff
-(require 'eshell)
-(require 'esh-help)
-(setup-esh-help-eldoc)
-(add-hook 'eshell-mode-hook (lambda () (eldoc-mode 1)))
-(add-hook 'eshell-mode-hook 'eshell-fringe-status-mode)
-(require 'em-smart)
-(setq eshell-where-to-jump 'begin)
-(setq eshell-review-quick-commands 'not-even-short-output)
-(setq eshell-smart-space-goes-to-end t)
-(add-to-list 'eshell-modules-list 'eshell-smart)
-(eshell-vterm-mode 1)
-(setq eshell-visual-commands
- (append eshell-visual-commands
- '("ytfzf" "nmtui" "w3m")))
-
-(add-hook 'vterm-mode-hook (lambda ()
- (hl-line-mode 0)))
-(add-hook 'eshell-mode-hook (lambda ()
- (hl-line-mode 0)))
-
-(define-key vterm-mode-map (kbd "M-W") 'persp-switch-to-buffer)
-(define-key vterm-mode-map (kbd "M-k") 'persp-kill-buffer)
-(define-key vterm-mode-map (kbd "M-p") 'persp-key-map)
-
-(require 'evil)
-(evil-set-initial-state 'vterm-mode 'emacs)
-
-(define-key eshell-mode-map (kbd "M-o") 'other-window)
-(define-key eshell-mode-map (kbd "M-W") 'switch-buffer)
-(define-key eshell-mode-map (kbd "C-l") (lambda ()
- (interactive)
- (recenter-top-bottom 0)))
-
-;; compilation stuff
-(global-set-key (kbd "M-m") (lambda ()
- (interactive)
- (if flymake-mode
- (flymake-goto-next-error)
- (next-error))))
-(global-set-key (kbd "M-M") 'recompile)
-(setq compilation-always-kill t
- compilation-scroll-output t)
-;; Allow compilation buffer to be dedicated across frames
-(push '("\\*compilation\\*" . (nil (reusable-frames . t))) display-buffer-alist)
-
-
-;; better searching
-(setq counsel-grep-base-command
- "rg -i -M 120 --no-heading --line-number --color never '%s' %s")
-(global-set-key (kbd "C-s") 'counsel-grep-or-swiper)
-(global-set-key (kbd "C-S-s") 'isearch-forward)
-(define-key evil-normal-state-map (kbd "C-r") 'counsel-rg)
-
-(require 'persp-mode)
-;; (persp-mode 1)
-
-
-(with-eval-after-load "persp-mode"
- (defvar after-switch-to-buffer-functions nil)
- (defvar after-display-buffer-functions nil)
-
- (if (fboundp 'advice-add)
- ;;Modern way
- (progn
- (defun after-switch-to-buffer-adv (&rest r)
- (apply #'run-hook-with-args 'after-switch-to-buffer-functions r))
- (defun after-display-buffer-adv (&rest r)
- (apply #'run-hook-with-args 'after-display-buffer-functions r))
- (advice-add #'switch-to-buffer :after #'after-switch-to-buffer-adv)
- (advice-add #'display-buffer :after #'after-display-buffer-adv))
-
- (add-hook 'after-switch-to-buffer-functions
- #'(lambda (bn) (when (and persp-mode
- (not persp-temporarily-display-buffer))
- (persp-add-buffer bn)))))
-
- (setq persp-add-buffer-on-after-change-major-mode 'free
- persp-autokill-buffer-on-remove t
- persp-kill-foreign-buffer-behaviour 'dont-ask)
- (global-set-key (kbd "M-p") 'persp-key-map)
- (global-set-key (kbd "C-x b") #'persp-switch-to-buffer)
- (global-set-key (kbd "C-x B") #'switch-to-buffer)
- (global-set-key (kbd "C-x C-b") (lambda ()
- (interactive)
- (with-persp-buffer-list () (ibuffer))))
- (global-set-key (kbd "M-W") #'persp-switch-to-buffer)
- (global-set-key (kbd "C-x k") #'persp-kill-buffer))
-
diff --git a/emacs/init.el b/emacs/init.el
index bf53b52..6c29450 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -5,20 +5,11 @@
;; 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.
- '(TeX-source-correlate-method 'synctex)
- '(TeX-source-correlate-mode t t)
- '(TeX-source-correlate-start-server t t)
- '(TeX-view-program-selection
- '(((output-dvi has-no-display-manager)
- "dvi2tty")
- ((output-dvi style-pstricks)
- "dvips and gv")
- (output-dvi "Okular")
- (output-pdf "Okular")
- (output-html "xdg-open")))
'(comment-style 'extra-line)
'(connection-local-criteria-alist
- '(((:application tramp :protocol "kubernetes")
+ '(((:application vc-git)
+ vc-git-connection-default-profile)
+ ((:application tramp :protocol "kubernetes")
tramp-kubernetes-connection-local-default-profile)
((:application tramp :protocol "flatpak")
tramp-container-connection-local-default-flatpak-profile tramp-flatpak-connection-local-default-profile)
@@ -27,7 +18,9 @@
((:application eshell)
eshell-connection-default-profile)))
'(connection-local-profile-alist
- '((tramp-flatpak-connection-local-default-profile
+ '((vc-git-connection-default-profile
+ (vc-git--program-version))
+ (tramp-flatpak-connection-local-default-profile
(tramp-remote-path "/app/bin" tramp-default-remote-path "/bin" "/usr/bin" "/sbin" "/usr/sbin" "/usr/local/bin" "/usr/local/sbin" "/local/bin" "/local/freeware/bin" "/local/gnu/bin" "/usr/freeware/bin" "/usr/pkg/bin" "/usr/contrib/bin" "/opt/bin" "/opt/sbin" "/opt/local/bin"))
(tramp-kubernetes-connection-local-default-profile
(tramp-config-check . tramp-kubernetes--current-context-data)
@@ -116,53 +109,27 @@
(null-device . "/dev/null"))
(eshell-connection-default-profile
(eshell-path-env-list))))
- '(custom-enabled-themes '(tmu-custom))
'(custom-safe-themes
- '("9f2e4e8b2ddbfdd392eedbc123649d94654278dee5a53b899557224416413d35" "6dafb31ade9ff07229faaf05c41c2ae475c44731362b792f65f3930b1a2c9cfd" "dc77e008092a5a4aa6b6ed8e4826bebf8f2fb930a8de073bf7f458efd884cca8" "d1ff3e66028f9c527298580d2a64f9e3280f07f9e94d4dada72b67ef15069441" "3d4e3644e237a95683daa73e397c4c0d1ae06bbaaf8040104232591a28bc1315" "12a07bc38295e4b06a8965db261f51ea7ea61fbf91b3ef41298bbb549d1d9403" default))
- '(custom-theme-directory "~/.emacs.d/personal-lisp")
+ '("6f5e3fd2b4245ffe660da69ea5c13ab392337e94776dfb23cc1d8d0f80e3baa2" "1b8c2fd98bf6777d8b95f8cf98fdaede88feee3419ec3e5008f94b56618ac6ca" "0cc5046b7981609166c28b64f6185fa5f73bcb00d21e037f304794c6aaa1f340" "9f2e4e8b2ddbfdd392eedbc123649d94654278dee5a53b899557224416413d35" "6dafb31ade9ff07229faaf05c41c2ae475c44731362b792f65f3930b1a2c9cfd" "dc77e008092a5a4aa6b6ed8e4826bebf8f2fb930a8de073bf7f458efd884cca8" "d1ff3e66028f9c527298580d2a64f9e3280f07f9e94d4dada72b67ef15069441" "3d4e3644e237a95683daa73e397c4c0d1ae06bbaaf8040104232591a28bc1315" "12a07bc38295e4b06a8965db261f51ea7ea61fbf91b3ef41298bbb549d1d9403" default))
'(ede-project-directories
'("/home/tmu/Desktop/eway/sway" "/home/tmu/Desktop/eway/cage" "/home/tmu/Desktop/eway/wlroots" "/home/tmu/Desktop/eway/comp" "/home/tmu/Desktop/eway"))
- '(evil-collection-mode-list
- '(2048-game ag alchemist anaconda-mode apropos arc-mode atomic-chrome auto-package-update beginend bluetooth bm bookmark
- (buff-menu "buff-menu")
- calendar cider cmake-mode color-rg comint company compile consult corfu crdt
- (custom cus-edit)
- cus-theme dashboard daemons deadgrep debbugs debug devdocs dictionary diff-hl diff-mode dired dired-sidebar disk-usage distel doc-view docker ebib ebuku edbi edebug ediff eglot elpaca ement explain-pause-mode eldoc elfeed elisp-mode elisp-refs elisp-slime-nav embark emms emoji epa ert eshell eval-sexp-fu evil-mc eww fanyi finder flycheck flymake forge free-keys geiser ggtags git-timemachine gited gnus go-mode grep guix hackernews helm help helpful hg-histedit hungry-delete ibuffer
- (image image-mode)
- image-dired image+ imenu imenu-list
- (indent "indent")
- indium info ivy js2-mode leetcode lispy lms log-edit log-view lsp-ui-imenu lua-mode kotlin-mode macrostep man
- (magit magit-repos magit-submodule)
- magit-section magit-todos markdown-mode monky mpc mpdel mu4e mu4e-conversation neotree newsticker notmuch nov omnisharp org org-present org-roam osx-dictionary outline p4
- (package-menu package)
- pass
- (pdf pdf-view)
- popup proced
- (process-menu simple)
- prodigy profiler python quickrun racer racket-describe realgud reftex replace restclient rg ripgrep rjsx-mode robe rtags ruby-mode scheme scroll-lock selectrum sh-script shortdoc simple simple-mpc slime sly snake so-long speedbar tab-bar tablist tabulated-list tar-mode telega
- (term term ansi-term multi-term)
- tetris thread tide timer-list transmission trashed tuareg typescript-mode vc-annotate vc-dir vc-git vdiff vertico view vlf vterm vundo w3m wdired wgrep which-key woman xref xwidget yaml-mode youtube-dl zmusic
- (ztree ztree-diff ztree-dir)))
+ '(eglot-events-buffer-config '(:size 0 :format full))
+ '(gdb-non-stop-setting nil)
'(helm-minibuffer-history-key "M-p")
'(menu-bar-mode nil)
'(package-selected-packages
- '(counsel hide-lines 2048-game async auctex benchmark-init bongo buffer-move calc-prog-utils chinese-conv company-cabal company-go dumb-jump eat emms emms-player-simple-mpv emms-state esh-help eshell-fringe-status eshell-vterm esup evil evil-collection evil-commentary evil-easymotion evil-snipe evil-surround exwm eyebrowse fish-mode flymake-diagnostic-at-point fold-this folding free-keys frog-jump-buffer gdscript-mode gxref haskell-mode helm-hoogle highlight hindent hydra ibuffer-project imenu-anywhere ivy-prescient oauth2 persp-mode persp-mode-projectile-bridge popwin pyim-basedict pyim-cangjiedict pyim-wbdict rustic shm sideline-flymake sideline-lsp solarized-theme tree-sitter unicode-fonts volume workgroups xelb))
- '(persp-restore-window-conf-method nil)
- '(pyim-assistant-scheme 'quanpin)
+ '(em-term em-hist embark-consult embark eat em-smart all-the-icons-completion all-the-icons marginalia visible-mark benchmark-init sideline-lsp sideline-flymake sideline-flycheck sideline lsp-haskell lsp-sourcekit emacs-lsp elisp-sandbox elsa lsp-mode corfu evil-config which-key orderless vertico evil))
+ '(pyim-assistant-scheme 'cangjie)
'(safe-local-variable-values '((LEXICAL-binding . t)))
'(scroll-bar-mode nil)
'(tags-revert-without-query t)
'(tool-bar-mode nil)
'(transient-mark-mode nil)
'(whitespace-style
- '(face trailing tabs lines-tail missing-newline-at-eof indentation space-after-tab space-before-tab tab-mark))
- '(xref-show-definitions-function 'xref-show-definitions-buffer-at-bottom))
+ '(face trailing tabs lines-tail missing-newline-at-eof indentation space-after-tab space-before-tab tab-mark) t))
-;; (use-package benchmark-init
-;; :ensure t
-;; :config
-;; ;; To disable collection of benchmark data after init is done.
-;; (add-hook 'after-init-hook 'benchmark-init/deactivate))
+;; ---------------------------------------------------------------------
+;; non-package specific config
;; performance stuff
(setq gc-cons-threshold most-positive-fixnum)
@@ -171,87 +138,265 @@
(setq gc-cons-threshold (expt 2 23))))
;; allow using emacsclient
-(load "server")
+(require 'server)
(unless (server-running-p) (server-start))
;; buffer preferences
(with-current-buffer "*scratch*" (emacs-lock-mode 'kill))
-(setq kill-buffer-query-functions (delq 'process-kill-buffer-query-function kill-buffer-query-functions)) ;; don't ask about killing buffers
-(setq confirm-kill-processes nil) ;; don't ask about kill processes
+(setq kill-buffer-query-functions
+ (delq 'process-kill-buffer-query-function kill-buffer-query-functions))
+;; don't ask about killing buffers
+(setq confirm-kill-processes nil)
+;; don't ask about kill processes
+
+
+(setq async-shell-command-buffer 'new-buffer)
+;; start additional async shell commands in new buffers without asking
+(setq-default proced-auto-update-flag t)
+;; always auto update proced
+
+;; --------------------------------------------------------------------
+;; external packages
+
+(use-package benchmark-init
+ :config
+ ;; To disable collection of benchmark data after init is done.
+ (add-hook 'after-init-hook 'benchmark-init/deactivate))
;; enable external packages
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
+(push "~/.emacs.d/site-lisp/" load-path)
(package-initialize)
-
-;; general editing config for everywhere
-(electric-pair-mode 1)
-(global-hl-line-mode 1)
-(global-hl-todo-mode 1)
-(global-auto-revert-mode 1)
-(setq-default indent-tabs-mode nil) ;; no tabs
-(setq fill-column 80)
-(setq whitespace-style
- '(face trailing tabs missing-newline-at-eof indentation space-after-tab space-before-tab tab-mark))
-
-;; nice startup
-(add-to-list 'default-frame-alist '(alpha-background . 90)) ;; transparancy
-(require 'iimage)
-(setq inhibit-startup-screen t)
-(setq initial-scratch-message (concat (propertize ";; " 'invisible t)
- "</home/tmu/.emacs.d/splashLaputa.png>
-;; scratch for lisp evaluation and unsaved text
-
-"))
-(add-hook 'emacs-startup-hook (lambda ()
- (with-current-buffer "*scratch*"
- (iimage-mode 1))))
+(require 'use-package-ensure)
+(setq use-package-always-ensure t)
+;; (setq use-package-always-demand t)
(use-package vertico
;; better minibuffer complete
:init
(vertico-mode)
- (vertico-flat-mode)
+ ;; (vertico-flat-mode)
(setq vertico-cycle t))
+(use-package marginalia
+ :init
+ (marginalia-mode)
+ (keymap-set minibuffer-local-map "M-A" 'marginalia-cycle)
+ :custom
+ (marginalia-max-relative-age 0)
+ (marginalia-align 'right))
+
+(use-package embark
+ :bind
+ (("C-." . embark-act) ;; pick some comfortable binding
+ ("C-," . embark-dwim) ;; good alternative: M-.
+ ("C-h B" . embark-bindings) ;; alternative for `describe-bindings'
+ )
+ :init
+ (add-hook 'eldoc-documentation-functions #'embark-eldoc-first-target)
+ :config
+ ;; Hide the mode line of the Embark live/completions buffers
+ (add-to-list 'display-buffer-alist
+ '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
+ nil
+ (window-parameters (mode-line-format . none)))))
+
+(use-package all-the-icons)
+(use-package all-the-icons-completion
+ :after (marginalia all-the-icons)
+ :hook (marginalia-mode . all-the-icons-completion-marginalia-setup)
+ :init (all-the-icons-completion-mode))
+
(use-package orderless
- ;; ordering minibuffer completions
- :ensure t
+ ;; ordering (minibuffer) completions
:custom
- (completion-styles '(orderless partial-completion flex basic))
- (orderless-matching-styles '(orderless-literal orderless-regexp orderless-prefixes))
+ (completion-styles '(orderless basic))
+ (orderless-matching-styles '(orderless-prefixes orderless-initialism orderless-literal orderless-regexp))
;; (orderless-skip-highlighting t)
- ;; (selectrum-highlight-candidates-function #'orderless-highlight-matches)
)
+(use-package corfu
+ ;; in buffer completion
+ :init
+ (global-corfu-mode 1)
+ (defun corfu-commit-single ()
+ "Complete without asking if there is only one candidate."
+ (when (and (corfu--popup-visible-p)
+ (= (length corfu--candidates) 1))
+ (corfu-accept)))
+ (add-hook 'corfu-post-command-hook 'corfu-commit-single)
+ :custom
+ (corfu-cycle t)
+ (corfu-quit-no-match t)
+ :bind (("M-/" . completion-at-point)))
+
+(use-package cape
+ ;; extend completion frameworks
+ :bind ("C-c p" . cape-prefix-map)
+ :config
+ (advice-add 'pcomplete-completions-at-point :around 'cape-wrap-silent)
+ (advice-add 'pcomplete-completions-at-point :around 'cape-wrap-purify)
+ :custom
+ (completion-at-point-functions . '(cape-dict
+ tags-completion-at-point-function
+ cape-keyword
+ cape-dabbrev
+ cape-symbol)))
+
+(use-package dabbrev
+ ;; Swap M-/ and C-M-/
+ :bind ( ;; ("M-/" . completion-at-point)
+ ("C-M-/" . dabbrev-expand))
+ :config
+ (add-to-list 'dabbrev-ignored-buffer-regexps "\\` ")
+ ;; Since 29.1, use `dabbrev-ignored-buffer-regexps' on older.
+ (add-to-list 'dabbrev-ignored-buffer-modes 'doc-view-mode)
+ (add-to-list 'dabbrev-ignored-buffer-modes 'pdf-view-mode)
+ (add-to-list 'dabbrev-ignored-buffer-modes 'tags-table-mode))
+
+(use-package tempel
+ :after (cape)
+ :custom
+ (tempel-path "~/.emacs.d/templates/*.eld")
+ ;; (tempel-trigger-prefix "<")
+
+ :bind (("M-+" . tempel-complete) ;; Alternative tempel-expand
+ ("M-*" . tempel-insert))
+
+ :config
+ ;; Setup completion at point
+ (defun tempel-setup-capf ()
+ ;; Add the Tempel Capf to `completion-at-point-functions'.
+ ;; `tempel-expand' only triggers on exact matches. Alternatively use
+ ;; `tempel-complete' if you want to see all matches, but then you
+ ;; should also configure `tempel-trigger-prefix', such that Tempel
+ ;; does not trigger too often when you don't expect it. NOTE: We add
+ ;; `tempel-expand' *before* the main programming mode Capf, such
+ ;; that it will be tried first.
+ (setq-local completion-at-point-functions
+ (cons #'tempel-expand
+ completion-at-point-functions)))
+
+ (add-hook 'conf-mode-hook 'tempel-setup-capf)
+ (add-hook 'prog-mode-hook 'tempel-setup-capf)
+ (add-hook 'text-mode-hook 'tempel-setup-capf)
+
+ ;; Optionally make the Tempel templates available to Abbrev,
+ ;; either locally or globally. `expand-abbrev' is bound to C-x '.
+ ;; (add-hook 'prog-mode-hook #'tempel-abbrev-mode)
+ ;; (global-tempel-abbrev-mode)
+ )
+
+;; (use-package tempel-collection
+;; :after tempel)
+
(use-package which-key
- :ensure t
:init
(which-key-mode))
-;; frog jump stuff
-(add-hook 'frog-menu-after-init-hook (lambda ()
- (setq-local avy-background nil)))
-
-(load-file "~/.emacs.d/personal-lisp/custom-funcs.el")
-(load-file "~/.emacs.d/personal-lisp/evil-conf.el")
-(load-file "~/.emacs.d/personal-lisp/general-text.el")
-(load-file "~/.emacs.d/personal-lisp/tex-conf.el")
-(load-file "~/.emacs.d/personal-lisp/coding-config.el")
-(load-file "~/.emacs.d/personal-lisp/single-header.el")
-(load-file "~/.emacs.d/personal-lisp/chinese.el")
-(load-file "~/.emacs.d/personal-lisp/custom-binds.el")
-;; (load-file "~/.emacs.d/exwm-pref.el")
-
-;; emacs mechanically set stuff
+(use-package ibuffer
+ :custom
+ (ibuffer-formats
+ '((mark modified read-only " "
+ (name 50 50 :left :elide) ; was originally 18
+ " "
+ (size 9 -1 :right)
+ " "
+ (mode 16 16 :left :elide)
+ " " filename-and-process)
+ (mark " "
+ (name 16 -1)
+ " " filename))))
+
+(use-package buffer-move
+ :bind ("C-x -" . buf-move-right))
+
+(use-package consult
+ :custom (consult-preview-excluded-buffers '(major-mode . exwm-mode))
+ :bind ("C-x b" . consult-buffer))
+
+;; (use-package beacon
+;; :init
+;; (beacon-mode 1)
+;; (push 'vterm-mode beacon-dont-blink-major-modes))
+
+(use-package visible-mark
+ :init
+ (global-visible-mark-mode 1)
+ (set-face-attribute 'visible-mark-active nil
+ :foreground 'unspecified
+ :background 'unspecified
+ :box '(:line-width (-1 . -1)
+ :color "deep pink"
+ :style nil))
+ :custom
+ (visible-mark-max 1)
+ )
+
+;; eshell stuff
+(use-package eshell
+ :init
+ (use-package esh-help)
+ (setup-esh-help-eldoc)
+ (require 'em-hist)
+ (require 'em-term)
+ (keymap-set eshell-hist-mode-map "C-p" 'eshell-previous-input)
+ (keymap-set eshell-hist-mode-map "C-n" 'eshell-next-input)
+ (keymap-set eshell-hist-mode-map "C-c C-n" 'next-line)
+ (keymap-set eshell-hist-mode-map "C-c C-p" 'previous-line)
+ (keymap-set eshell-mode-map "C-l" 'eshell/clear)
+ (add-hook 'eshell-mode-hook 'eldoc-mode))
+
+(use-package eat
+ :init
+ (add-hook 'eshell-load-hook #'eat-eshell-mode)
+ (add-hook 'eshell-load-hook #'eat-eshell-visual-command-mode)
+ (push "pass" eshell-visual-commands))
+
+;; ----------------------------------------------------------------------
+;; my custom stuff
+
+;; (require 'evil-config)
+(require 'my-funcs)
+(require 'my-binds)
+(require 'coding-config)
+(require 'modeline-config)
+(require 'general-text)
+(require 'exwm-pref)
+
+;; ----------------------------------------------------------------------
+;; theme stuff
+
+(require 'tmu-custom-theme)
+(push "~/.emacs.d/site-lisp/" custom-theme-load-path)
+(load-theme 'tmu-custom t)
+
+;; comfy scratch buffer
+(require 'iimage)
+(setq inhibit-startup-screen t)
+(setq initial-scratch-message (concat (propertize ";; " 'invisible t)
+ "</home/tmu/.emacs.d/splashLaputa.png>
+;; scratch for lisp evaluation and unsaved text
+
+"))
+(add-hook 'emacs-startup-hook (lambda ()
+ (with-current-buffer "*scratch*"
+ (iimage-mode 1))))
+
+;; ----------------------------------------------------------------------
+;; Things emacs sets programatically
+(put 'dired-find-alternate-file 'disabled nil)
+(put 'upcase-region 'disabled nil)
+(put 'downcase-region 'disabled nil)
+(put 'list-timers 'disabled nil)
+(put 'narrow-to-region 'disabled nil)
+
+(load-theme 'tmu-custom t)
+
(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.
)
-(put 'dired-find-alternate-file 'disabled nil)
-(put 'upcase-region 'disabled nil)
-(put 'downcase-region 'disabled nil)
-(put 'list-timers 'disabled nil)
-(put 'narrow-to-region 'disabled nil)
diff --git a/emacs/personal-lisp/coding-config.el b/emacs/personal-lisp/coding-config.el
deleted file mode 100755
index 2ddfbd6..0000000
--- a/emacs/personal-lisp/coding-config.el
+++ /dev/null
@@ -1,165 +0,0 @@
-;; Various config specifically for programming
-
-(add-hook 'xref-backend-functions 'gxref-xref-backend)
-
-;; better commenting binds
-(global-set-key (kbd "C-x C-;") 'comment-or-uncomment-region)
-(global-set-key (kbd "C-x ;") 'comment-line)
-(global-set-key (kbd "C-x :") 'comment-set-column) ;never gonna use but whatever
-
-(setq asm-comment-char ?#) ; prefer # over ; for asm comments
-
-;; generate tags for label names in asm files, based on asm files in the current directory
-(add-hook 'asm-mode-hook
- (lambda ()
- (add-hook 'after-save-hook
- (lambda ()
- (shell-command
- "find . -iregex '.*\\.[sS]' -exec etags -l none -r '/\\([a-zA-Z0-9\\-_]+\\):/\1/' {} +"))
- 0 t)))
-
-;; nice eglot binds
-(global-set-key (kbd "C-c f") 'eglot-code-action-quickfix)
-(global-set-key (kbd "C-c C-f") 'eglot-code-actions)
-
-;; Find defs in various ways
-(global-set-key (kbd "M-i") 'imenu)
-(global-set-key (kbd "M-I") 'xref-find-definitions)
-
-
-;; make ibuffer play with projectile
-(require 'ibuffer)
-(add-hook 'ibuffer-hook
- (lambda ()
- (ibuffer-projectile-set-filter-groups)
- (unless (eq ibuffer-sorting-mode 'alphabetic)
- (ibuffer-do-sort-by-alphabetic))))
-
-;; make shells and whatnot slightly better
-(require 'comint)
-(setq comint-scroll-to-bottom-on-input t)
-(setq comint-scroll-to-bottom-on-output t)
-
-;; various folding types and binds
-(autoload 'hide-lines "hide-lines" "Hide lines based on a regexp" t)
-(global-set-key (kbd "C-c /") 'hide-lines)
-(autoload 'fold-this "fold-this" "arbitrary folding" t)
-(autoload 'fold-this-unfold-at-point "fold-this" "arbitrary folding" t)
-(define-prefix-command 'fold-map)
-(global-set-key (kbd "M-F") 'fold-map)
-(define-keymap :full nil
- :parent nil
- :suppress nil
- :keymap nil
- :name "fold-map"
- :prefix 'fold-map
- (kbd "c") 'fold-this
- (kbd "e") 'fold-this-unfold-at-point
- (kbd "t") 'hs-toggle-hiding
- (kbd "f") 'fold-this-fold-forward
- (kbd "b") 'fold-this-fold-backward
- (kbd "l") 'hs-hide-level)
-
-;; global prog stuff that differs from global/text
-(add-hook 'prog-mode-hook (lambda ()
- (hs-minor-mode 1)
- ;; (flymake-mode 1)
- (spell-fu-mode 0)
- (superword-mode 1)
- (whitespace-mode 1)
- (modify-syntax-entry ?_ "w") )
- (display-fill-column-indicator-mode 1)
- (add-hook 'before-save-hook
- (lambda ()
- (if (not (eq major-mode 'makefile-gmake-mode))
- (clean-prog-file (current-buffer))))))
-
-;; haskell flavor and tags
-(setq haskell-tags-on-save t)
-(add-hook 'haskell-mode-hook (lambda ()
- (hindent 1)
- (interactive-haskell-mode 1)
- (eldoc-mode 1)))
-(setq haskell-process-type 'cabal-repl)
-
-;; eshell stuff
-(require 'eshell)
-(require 'esh-help)
-(setup-esh-help-eldoc)
-(add-hook 'eshell-mode-hook (lambda () (eldoc-mode 1)))
-(add-hook 'eshell-mode-hook 'eshell-fringe-status-mode)
-(require 'em-smart)
-(setq eshell-where-to-jump 'begin)
-(setq eshell-review-quick-commands 'not-even-short-output)
-(setq eshell-smart-space-goes-to-end t)
-(add-to-list 'eshell-modules-list 'eshell-smart)
-(eshell-vterm-mode 1)
-(setq eshell-visual-commands
- (append eshell-visual-commands
- '("ytfzf" "nmtui" "w3m")))
-
-(add-hook 'vterm-mode-hook (lambda () (hl-line-mode 0)))
-(add-hook 'eshell-mode-hook (lambda () (hl-line-mode 0)))
-
-(define-key vterm-mode-map (kbd "M-W") 'persp-switch-to-buffer)
-(define-key vterm-mode-map (kbd "M-k") 'persp-kill-buffer)
-(define-key vterm-mode-map (kbd "M-p") 'persp-key-map)
-
-(define-key eshell-mode-map (kbd "M-o") 'other-window)
-(define-key eshell-mode-map (kbd "M-W") 'switch-buffer)
-(define-key eshell-mode-map (kbd "C-l") (lambda () (interactive) (recenter-top-bottom 0)))
-
-;; scuffed compilation binds and prefs
-(global-set-key (kbd "M-m") (lambda ()
- (interactive)
- (if flymake-mode
- (flymake-goto-next-error)
- (next-error))))
-(global-set-key (kbd "M-M") 'recompile)
-(setq compilation-always-kill t
- compilation-scroll-output t)
-;; Allow compilation buffer to be dedicated across frames
-(push '("\\*compilation\\*" . (nil (reusable-frames . t))) display-buffer-alist)
-
-
-;; better searching
-(setq counsel-grep-base-command
- "rg -i -M 120 --no-heading --line-number --color never '%s' %s")
-(global-set-key (kbd "C-s") 'counsel-grep-or-swiper)
-(global-set-key (kbd "C-S-s") 'isearch-forward)
-(define-key evil-normal-state-map (kbd "C-r") 'counsel-rg)
-
-(require 'persp-mode)
-(persp-mode 1)
-
-(with-eval-after-load "persp-mode"
- (defvar after-switch-to-buffer-functions nil)
- (defvar after-display-buffer-functions nil)
-
- (if (fboundp 'advice-add)
- ;;Modern way
- (progn
- (defun after-switch-to-buffer-adv (&rest r)
- (apply #'run-hook-with-args 'after-switch-to-buffer-functions r))
- (defun after-display-buffer-adv (&rest r)
- (apply #'run-hook-with-args 'after-display-buffer-functions r))
- (advice-add #'switch-to-buffer :after #'after-switch-to-buffer-adv)
- (advice-add #'display-buffer :after #'after-display-buffer-adv))
-
- (add-hook 'after-switch-to-buffer-functions
- #'(lambda (bn) (when (and persp-mode
- (not persp-temporarily-display-buffer))
- (persp-add-buffer bn)))))
-
- (setq persp-add-buffer-on-after-change-major-mode 'free
- persp-autokill-buffer-on-remove t
- persp-kill-foreign-buffer-behaviour 'dont-ask)
- (global-set-key (kbd "M-p") 'persp-key-map)
- (global-set-key (kbd "C-x b") #'persp-switch-to-buffer)
- (global-set-key (kbd "C-x B") #'switch-to-buffer)
- (global-set-key (kbd "C-x C-b") (lambda ()
- (interactive)
- (with-persp-buffer-list () (ibuffer))))
- (global-set-key (kbd "M-W") #'persp-switch-to-buffer)
- (global-set-key (kbd "C-x k") #'persp-kill-buffer))
-
diff --git a/emacs/single-header.el b/emacs/single-header.el
deleted file mode 100644
index 5ca4afc..0000000
--- a/emacs/single-header.el
+++ /dev/null
@@ -1,131 +0,0 @@
-(defvar single-header--current-header-buffer nil "Read the name")
-
-(defvar single-header-format '(make-header-info-string) "evaluated to fill the header")
-
-(defface single-header '((default . (:background "#000000" :family "Source Code Pro"))) "Face for top line")
-
-(require 'battery)
-(defun with-face (str &rest face-plist)
- (add-face-text-property 0 (length str) face-plist t str)
- str)
-
-;; disable normal emms-state and move it to the header
-;; (require 'emms-state)
-;; (setq single-header-emms-state-format-string
-;; '(emms-state
-;; (" " emms-state
-;; (emms-state-current-playing-time
-;; (" "
-;; (:propertize emms-state-current-playing-time
-;; face emms-state-current-playing-time)))
-;; (emms-state-total-playing-time
-;; ("("
-;; (:propertize emms-state-total-playing-time
-;; face emms-state-total-playing-time)
-;; ")"))
-;; emms-mode-line-string)))
-;; (setq emms-state-mode-line-string "")
-
-(defun make-header-info-string ()
- "generates the mode line string that contains all the info to the right"
- (let ((win (when (buffer-live-p single-header--current-header-buffer)
- (get-buffer-window single-header--current-header-buffer)))
- (str (concat
- (format-time-string "%a, %b %+4Y-%0m-%0d ")
- (with-face (format-time-string "%R ")
- :weight 'bold)
- (with-face (format "<%03.2f> " (car (load-average 1)))
- :foreground "#da70d6")
- (with-face (let* ((mi (memory-info))
- (tm (float (car mi)))
- (fm (float (car (cdr mi))))
- (ts (float (car (cdr (cdr mi)))))
- (fs (float (car (cdr (cdr (cdr mi)))))))
- (format "{%.2f %.2f} " (- 1 (/ fm tm)) (- 1 (/ fs ts))))
- :foreground "#00ced1")
- (with-face (battery-format "[%b%p%%] " (and battery-status-function (funcall battery-status-function)))
- :weight 'bold)
- ;; (format-mode-line single-header-emms-state-format-string)
- )))
- (setq str (concat str
- (cond (win (make-string
- (- (window-max-chars-per-line win 'single-header) (length str)) ? ))
- (t ""))
- ))
- (with-face str 'single-header)))
-
-
-(setq global-mode-string '("" (:eval (concat (with-face (format " [%s] " default-directory)
- :weight 'bold
- :foreground "green2")))))
-
-(defun single-header-init-buffer (buf)
- (with-current-buffer buf
- (insert "header test")
- (jit-lock-mode nil)
- (font-lock-mode -1)
- (buffer-disable-undo)
- (setq-local mode-line-format nil)
- (setq-local header-line-format nil)
- (setq-local cursor-type nil)
- (setq-local cursor-in-non-selected-windows nil)
- (setq-local overflow-newline-into-fringe nil)
- (setq-local word-wrap nil)
- (setq-local show-trailing-whitespace nil)))
-
-(defun single-header-init-window (win)
- (with-selected-window win
- (set-window-dedicated-p win t)
- (set-window-parameter win 'no-other-window t)
- (set-window-parameter win 'no-delete-other-windows t)
- (set-window-margins win 0 0)
- (set-window-fringes win 0 0)
- (set-window-scroll-bars win 0 nil 0 nil)
- (setq-local window-min-height 1)
- (setq-local window-safe-min-height 1)
- (let
- (window-size-fixed)
- (fit-window-to-buffer win 1))
- (setq-local window-size-fixed t)
- (when
- (fboundp 'window-preserve-size)
- (window-preserve-size win nil t))))
-
-(defun single-header-show (buf)
- "show / make a header"
- (if (buffer-live-p buf)
- (let ((win (display-buffer-in-side-window buf '((side . top)
- (slot . -100)))))
- (single-header-init-window win))
- (single-header-make)))
-
-(defun single-header-make ()
- "create the fake header line"
- (interactive)
- (unless (buffer-live-p single-header--current-header-buffer)
- (let ((buf (generate-new-buffer "*header*")))
- (single-header-init-buffer buf)
- (setq single-header--current-header-buffer buf)
- (single-header-show buf))))
-
-(defun single-header-delete ()
- "remove an existing header buffer"
- (interactive)
- (when (buffer-live-p single-header--current-header-buffer)
- (kill-buffer single-header--current-header-buffer)))
-
-(defun single-header-update ()
- "update the contents of the header line according to `single-header-format'"
- (when (buffer-live-p single-header--current-header-buffer)
- (with-current-buffer single-header--current-header-buffer
- (erase-buffer)
- (insert (eval single-header-format)))))
-
-(add-hook 'after-make-frame-functions (lambda (frame)
- (with-selected-frame frame
- (single-header-show single-header--current-header-buffer))))
-
-;; do init frame seperately
-(single-header-show single-header--current-header-buffer)
-(run-with-timer 0 1 'single-header-update)
-
diff --git a/emacs/personal-lisp/chinese.el b/emacs/site-lisp/chinese.el
index 4b01594..4b01594 100644
--- a/emacs/personal-lisp/chinese.el
+++ b/emacs/site-lisp/chinese.el
diff --git a/emacs/site-lisp/coding-config.el b/emacs/site-lisp/coding-config.el
new file mode 100755
index 0000000..9d228f0
--- /dev/null
+++ b/emacs/site-lisp/coding-config.el
@@ -0,0 +1,127 @@
+;;; The config specifically for editing code
+
+(provide 'coding-config)
+
+;; (add-hook 'xref-backend-functions 'gxref-xref-backend)
+
+;; better commenting binds
+(global-set-key (kbd "C-x C-;") 'comment-or-uncomment-region)
+(global-set-key (kbd "C-x ;") 'comment-line)
+(global-set-key (kbd "C-x :") 'comment-set-column) ;never gonna use but whatever
+
+(setq asm-comment-char ?#) ; prefer # over ; for asm comments
+
+;; generate tags for label names in asm files, based on asm files in the current directory
+(add-hook 'asm-mode-hook
+ (lambda ()
+ (add-hook 'after-save-hook
+ (lambda ()
+ (shell-command
+ "find . -iregex '.*\\.[sS]' -exec etags -l none -r '/\\([a-zA-Z0-9\\-_]+\\):/\1/' {} +"))
+ 0 t)))
+
+(use-package lsp-mode)
+
+(use-package lsp-haskell)
+
+(use-package sideline
+ :init
+ (setq sideline-backends-right '()))
+(use-package sideline-flycheck
+ :init
+ (push 'sideline-flycheck sideline-backends-right))
+(use-package sideline-flymake
+ :init
+ (push 'sideline-flymake sideline-backends-right))
+(use-package sideline-lsp
+ :init
+ (push 'sideline-lsp sideline-backends-right))
+
+(use-package flycheck
+ :config
+ ;; flymake stuff to be less annoying
+ ;; (face-spec-set 'flycheck-note '((t :underline nil)))
+ ;; (face-spec-set 'flycheck-info '((t :underline nil)))
+ ;; (face-spec-set 'flycheck-warning '((t :underline nil)))
+ ;; (face-spec-set 'flycheck-error '((t :underline nil)))
+ (add-hook 'prog-mode-hook (lambda () flycheck-mode 1)))
+
+;; Find defs in various ways
+(global-set-key (kbd "M-i") 'imenu)
+(global-set-key (kbd "M-I") 'xref-find-definitions)
+
+(setq imenu-auto-rescan t)
+
+;; make ibuffer play with projectile
+(use-package ibuffer
+ :bind
+ ("C-x C-b" . ibuffer)
+ :hook
+ (ibuffer . (lambda ()
+ (ibuffer-projectile-set-filter-groups)
+ (unless (eq ibuffer-sorting-mode 'alphabetic)
+ (ibuffer-do-sort-by-alphabetic)))))
+
+;; make shells and whatnot slightly better
+(require 'comint)
+(setq comint-scroll-to-bottom-on-input t)
+(setq comint-scroll-to-bottom-on-output t)
+
+;; ediff
+(setq ediff-window-setup-function 'ediff-setup-windows-plain)
+
+;; various folding types and binds
+;;(autoload 'hide-lines "hide-lines" "Hide lines based on a regexp" t)
+;;(global-set-key (kbd "C-c /") 'hide-lines)
+(use-package fold-this
+ :init
+ (define-prefix-command 'fold-map)
+ (global-set-key (kbd "M-F") 'fold-map)
+ (define-keymap :full nil
+ :parent nil
+ :suppress nil
+ :keymap nil
+ :name "fold-map"
+ :prefix 'fold-map
+ (kbd "c") 'fold-this
+ (kbd "e") 'fold-this-unfold-at-point
+ (kbd "t") 'hs-toggle-hiding
+ (kbd "f") 'fold-this-fold-forward
+ (kbd "b") 'fold-this-fold-backward
+ (kbd "l") 'hs-hide-level))
+
+;; global prog stuff that differs from global/text
+(require 'my-funcs)
+(add-hook 'prog-mode-hook (lambda ()
+ (hs-minor-mode 1)
+ (superword-mode 1)
+ (modify-syntax-entry ?_ "w") )
+ (display-fill-column-indicator-mode 1)
+ (add-hook 'before-save-hook
+ (lambda ()
+ (if (not (eq major-mode 'makefile-gmake-mode))
+ (clean-prog-file (current-buffer))))))
+
+;; haskell flavor and tags
+(use-package haskell-mode
+ :custom
+ (haskell-tags-on-save t)
+ (haskell-process-type 'cabal-repl)
+ :hook
+ (haskell-mode . (lambda ()
+ ;; (hindent-mode 1)
+ (interactive-haskell-mode 1))))
+
+(global-set-key (kbd "M-m") 'goto-next-locus)
+(global-set-key (kbd "M-M") 'recompile)
+(setq compilation-always-kill t
+ compilation-scroll-output t)
+;; Allow compilation buffer to be dedicated across frames
+(push '("\\*compilation\\*" . (nil (reusable-frames . t))) display-buffer-alist)
+
+;; better searching
+(require 'counsel)
+(setq counsel-grep-base-command
+ "rg -i -M 120 --no-heading --line-number --color never '%s' %s")
+(global-set-key (kbd "C-s") 'counsel-grep-or-swiper)
+(global-set-key (kbd "C-S-s") 'isearch-forward)
diff --git a/emacs/personal-lisp/evil-conf.el b/emacs/site-lisp/evil-config.el
index 7c389fe..b019146 100644
--- a/emacs/personal-lisp/evil-conf.el
+++ b/emacs/site-lisp/evil-config.el
@@ -1,38 +1,38 @@
+;;; evil config
+(provide 'evil-config)
-;; evil mode stuff
-(setq
- evil-want-keybinding nil
- evil-want-integration t)
-;; evil-want-C-d-scroll nil
-;; evil-want-C-w-delete nil
-;; evil-disable-insert-state-bindings t
-;; evil-respect-visual-line-mode t
-(require 'evil)
-(when (require 'evil-collection nil t)
+(use-package evil
+ :custom
+ (evil-want-keybinding nil)
+ (evil-want-integration t)
+ :init
+ (evil-mode 1))
+(use-package evil-collection
+ :init
(evil-collection-init))
-(evil-mode 1)
-(evilem-default-keybindings "SPC")
-(define-key evil-motion-state-map (kbd "TAB") 'indent-for-tab-command)
-(evil-set-initial-state 'vterm-mode 'emacs)
+(use-package evil-easymotion
+ :init
+ (evilem-default-keybindings "SPC"))
(use-package evil-surround
- :ensure t
:config
(global-evil-surround-mode 1))
(use-package evil-snipe
- :ensure t
:config
- (evil-snipe-mode +1)
- (evil-snipe-override-mode +1)
- (setq evil-snipe-scope 'buffer)
+ (evil-snipe-mode 1)
+ (evil-snipe-override-mode 1)
(evil-define-key 'visual evil-snipe-local-mode-map "z" 'evil-snipe-s)
- (evil-define-key 'visual evil-snipe-local-mode-map "Z" 'evil-snipe-S))
+ (evil-define-key 'visual evil-snipe-local-mode-map "Z" 'evil-snipe-S)
+ :custom
+ (evil-snipe-scope 'buffer))
(define-key evil-insert-state-map (kbd "C-d") 'delete-char)
(define-key evil-insert-state-map (kbd "C-e") 'move-end-of-line)
(define-key evil-insert-state-map (kbd "C-a") 'move-beginning-of-line)
(define-key evil-normal-state-map (kbd "M-.") 'xref-find-definitions)
-(define-key evil-normal-state-map (kbd "C-t") 'transpose-chars)
(define-key evil-normal-state-map (kbd "M-Z") 'suspend-frame)
+(define-key evil-motion-state-map (kbd "TAB") 'indent-for-tab-command)
+(evil-set-initial-state 'vterm-mode 'emacs)
+
;;; sasha bindings
(defun evil-window-split-and-switch ()
"Split the window vertically and switch to the new buffer."
@@ -46,7 +46,11 @@
(evil-window-vsplit)
(other-window 1))
+(define-key evil-insert-state-map (kbd "C-t") 'transpose-chars)
+(define-key evil-normal-state-map (kbd "C-t") 'transpose-chars)
(evil-define-key 'normal global-map (kbd "SPC i") 'imenu)
+(evil-define-key 'normal global-map (kbd "SPC o") 'other-window)
+(evil-define-key 'normal global-map (kbd "SPC q") 'kill-current-buffer)
(evil-define-key 'normal global-map (kbd "SPC RET") 'vterm)
(evil-define-key 'normal global-map (kbd "SPC v") 'vterm)
(evil-define-key 'normal global-map (kbd "SPC !") 'abort-recursive-edit)
@@ -60,6 +64,10 @@
(evil-define-key 'normal global-map (kbd "SPC SPC j") 'evil-window-down)
(evil-define-key 'normal global-map (kbd "SPC SPC k") 'evil-window-up)
(evil-define-key 'normal global-map (kbd "SPC SPC l") 'evil-window-right)
+(evil-define-key 'normal global-map (kbd "M-h") 'evil-window-left)
+(evil-define-key 'normal global-map (kbd "M-j") 'evil-window-down)
+(evil-define-key 'normal global-map (kbd "M-k") 'evil-window-up)
+(evil-define-key 'normal global-map (kbd "M-l") 'evil-window-right)
(evil-define-key 'normal global-map (kbd "SPC SPC w") 'delete-window)
(evil-define-key 'normal global-map (kbd "SPC SPC q") 'delete-window)
(evil-define-key 'normal global-map (kbd "SPC SPC b") 'balance-windows)
diff --git a/emacs/site-lisp/exwm-pref.el b/emacs/site-lisp/exwm-pref.el
new file mode 100644
index 0000000..fee729f
--- /dev/null
+++ b/emacs/site-lisp/exwm-pref.el
@@ -0,0 +1,284 @@
+;;; My full EXWM config
+(provide 'exwm-pref)
+
+;; stuff for exwm
+(use-package exwm)
+(require 'exwm-randr)
+(require 'exwm-xim)
+(require 'exwm-systemtray)
+
+(setq exwm-workspace-number 1)
+;; (setq exwm-randr-workspace-monitor-plist '(0 "DP-0" 1 "HDMI-0" 2 "DVI-I-1"))
+(setq exwm-workspace-show-all-buffers t)
+(setq exwm-layout-show-all-buffers t)
+
+(use-package exwm-modeline)
+(setq exwm-modeline-randr t)
+(setq exwm-modeline-short nil)
+(setq exwm-modeline-urgent t)
+;; (add-hook 'exwm-init-hook (lambda () (exwm-modeline-mode 1)))
+
+;; (require exwm-firefox-evil)
+;; (require 'exwm-firefox)
+;; (exwm-firefox-mode)
+
+(setq persp-auto-resume-time 0)
+
+(setq exwm-title-length 70)
+
+(defun b3n-exwm-set-buffer-name ()
+ (if (and exwm-title (string-match "\\`http[^ ]+" exwm-title))
+ (let ((url (match-string 0 exwm-title)))
+ (setq-local buffer-file-name url)
+ (setq-local exwm-title (replace-regexp-in-string
+ (concat (regexp-quote url) " - ")
+ ""
+ exwm-title))))
+
+ (setq-local exwm-title
+ (concat
+ exwm-class-name
+ "<"
+ ;; (if (<= (length exwm-title) exwm-title-length)
+ exwm-title
+ ;; (concat (substring exwm-title 0 exwm-title-length) "…"))
+ ">"))
+
+ (exwm-workspace-rename-buffer exwm-title))
+
+(add-hook 'exwm-update-class-hook 'b3n-exwm-set-buffer-name)
+(add-hook 'exwm-update-title-hook 'b3n-exwm-set-buffer-name)
+
+(defun exwm-assign-workspace (index)
+ "switch to workspace without changing monitor"
+ (interactive "p")
+ (let* ((current-index exwm-workspace-current-index)
+ (current-monitor (plist-get exwm-randr-workspace-monitor-plist current-index))
+ (displaced-monitor (plist-get exwm-randr-workspace-monitor-plist index)))
+ ;; if not associated, copy current association
+ (unless displaced-monitor
+ (setq displaced-monitor current-monitor))
+ ;; (message "%s, %s" current-monitor displaced-monitor)
+ ;; swapping prevents a monitor losing all of its associations
+ (plist-put exwm-randr-workspace-monitor-plist current-index displaced-monitor)
+ (plist-put exwm-randr-workspace-monitor-plist index current-monitor)
+
+ (exwm-workspace-switch-create index)
+
+ (exwm-randr-refresh)
+ ;; (message "%s, %s, %s" exwm-randr-workspace-monitor-plist current-index index)
+ ))
+
+(defun exwm-other-assigned-workspace ()
+ "focus other monitor's workspace. Assumes 2 monitors"
+ (interactive)
+ ;; super hacky, assumes that there are only two active workspaces
+ (exwm-workspace-switch-create (exwm-workspace--workspace-from-frame-or-index
+ (let* ((workspace-list (seq-filter 'exwm-workspace--active-p exwm-workspace--list))
+ (active-workspaces workspace-list))
+ (while (not (eq (car active-workspaces) (selected-frame)))
+ (setq active-workspaces (cdr active-workspaces)))
+ (setq active-workspaces (cdr active-workspaces))
+ (if (eq active-workspaces nil)
+ (car workspace-list)
+ (car active-workspaces))))))
+
+;; (add-hook 'exwm-randr-screen-change-hook
+;; (lambda ()
+;; (let ((connected (shell-command-to-string "xrandr")))
+;; (if (and (string-match "HDMI-0 connected" connected) (string-match "DP-0 connected" connected) (string-match "DVI-I-1 connected" connected))
+;; (start-process-shell-command
+;; "xrandr" nil "xrandr --output HDMI-0 --rotate right --pos 0x240 --output DP-0 --auto --pos 1080x0 --output DVI-I-1 --auto --pos 1080x1080")
+;; ;;else
+;; (start-process-shell-command
+;; "xrandr" nil "xrandr --output DP-0 --auto --primary --output HDMI-0 --auto")))
+;; (exwm-randr-refresh)))
+(exwm-randr-mode)
+
+;;(exwm-config-default)
+(exwm-systemtray-mode)
+(push ?\C-\\ exwm-input-prefix-keys) ;;C-\ to switch input method
+
+;; All buffers created in EXWM mode are named "*EXWM*". You may want to
+;; change it in `exwm-update-class-hook' and `exwm-update-title-hook', which
+;; are run when a new X window class name or title is available. Here's
+;; some advice on this topic:
+;; + Always use `exwm-workspace-rename-buffer` to avoid naming conflict.
+;; + For applications with multiple windows (e.g. GIMP), the class names of
+ ; all windows are probably the same. Using window titles for them makes
+;; more sense.
+;; In the following example, we use class names for all windows except for
+;; Java applications and GIMP.
+;; (add-hook 'exwm-update-class-hook
+;; (lambda ()
+;; (unless (or (string-prefix-p "sun-awt-X11-" exwm-instance-name)
+;; (string= "gimp" exwm-instance-name))
+;; (exwm-workspace-rename-buffer exwm-class-name))))
+;; (add-hook 'exwm-update-title-hook
+;; (lambda ()
+;; (when (or (not exwm-instance-name)
+;; (string-prefix-p "sun-awt-X11-" exwm-instance-name)
+;; (string= "gimp" exwm-instance-name))
+;; (exwm-workspace-rename-buffer exwm-title))))
+
+
+;; store the buffer we were at before a jump
+(setq exwm-marked-buffer "*scratch*")
+
+;; Global keybindings can be defined with `exwm-input-global-keys'.
+;; Here are a few examples:
+(setq exwm-input-global-keys
+ `(
+ ;; Bind "s-r" to exit char-mode and fullscreen mode.
+ ([?\s-r] . exwm-reset)
+ ([?\M-r] . exwm-reset)
+ ;; Bind "s-w" to window switcher
+ ([?\s-w] . consult-buffer)
+ ;; ([?\M-w] . open-window-by-buffer)
+ ([?\M-W] . consult-buffer)
+
+ ;;quicker 2-split swtiching
+ ([?\s-o] . (lambda ()
+ (interactive)
+ (other-window 1)))
+ ([?\M-o] . (lambda ()
+ (interactive)
+ (other-window 1)))
+
+ ;;fast workspace switch
+ ([?\s-O] . exwm-other-assigned-workspace)
+ ;; ([?\M-O] . exwm-other-assigned-workspace)
+
+ ;;quick calc switching
+ ;; ([?\s-c] . switch-to-calc)
+
+ ;;mark the buffer
+ ;; ([?\s- ] . (lambda ()
+ ;; (interactive)
+ ;; (setq exwm-marked-buffer (current-buffer))
+ ;; (message "Marked the current buffer, return (across workspaces) with s-x")))
+
+ ;;return to marked buffer
+ ;; ([?\s-x] . (lambda ()
+ ;; (interactive)
+ ;; (let ((hold exwm-marked-buffer))
+ ;; (setq exwm-marked-buffer (current-buffer))
+ ;; (exwm-workspace-switch-to-buffer hold))))
+
+ ;; Bind "s-0" to "s-9" to switch to a layout.
+ ;; ,@(mapcar
+ ;; (lambda (digit)
+ ;; ;; `(,(kbd (concat "s-" (int-to-string digit))) . (lambda () (interactive) (exwm-assign-workspace ,digit)))
+ ;; `(,(kbd (concat "s-" (int-to-string digit))) . (lambda ()
+ ;; (interactive)
+ ;; (exwm-workspace-switch-create ,digit)))
+ ;; )
+ ;; (number-sequence 0 9))
+
+ ([?\s-d] . (lambda (command)
+ (interactive (list (read-shell-command "$ ")))
+ (start-process-shell-command command nil command)))
+ ;; ([?\M-d] . (lambda (command)
+ ;; (interactive (list (read-shell-command "$ ")))
+ ;; (start-process-shell-command command nil command)))
+ ;; browser
+ ([?\s-e] . (lambda ()
+ (interactive)
+ (start-process-shell-command "vimb" nil "vimb")))
+ ;; ([?\M-e] . (lambda ()
+ ;; (interactive)
+ ;; (start-process-shell-command "vimb" nil "vimb")))
+
+ ;;terminal
+ ([s-return] . 'eshell)
+ ;; ([M-return] . (lambda ()
+ ;; (interactive)
+ ;;if we are already there, switch back
+ ;; (if (string= (buffer-name (current-buffer)) "*vterm*")
+ ;; (exwm-workspace-switch-to-buffer exwm-last-buffer)
+ ;; (progn
+ ;; (setq exwm-last-buffer (current-buffer))
+ ;; (vterm)))))
+
+ ;; return to the last window
+ ;; ([s-tab] . (lambda ()
+ ;; (interactive)
+ ;; (exwm-workspace-switch-to-buffer (other-buffer))))
+
+ ;; kill the current window and close the buffer if possible
+ ([?\s-Q] . kill-buffer-and-window)
+
+ ;; kill current buffer but leave window
+ ([?\s-q] . (lambda () (interactive) (kill-buffer nil)))
+
+ ;; suspend
+ ([?\s-`] . (lambda ()
+ (interactive)
+ (start-process "" nil "loginctl" "suspend")))
+ ))
+
+;; requires some custom shell scripts not included in my emacs config
+(defun my/brightnessdown () (interactive) (start-process "" nil "brightnessdown"))
+(defun my/brightnessup () (interactive) (start-process "" nil "brightnessup"))
+(defun my/mute () (interactive) (start-process "" nil "amixer" "set" "Master" "toggle"))
+(defun my/voldown () (interactive) (start-process "" nil "amixer" "set" "Master" "5%-"))
+(defun my/volup () (interactive) (start-process "" nil "amixer" "set" "Master" "5%+"))
+
+;; To add a key binding only available in line-mode, simply define it in
+;; `exwm-mode-map'. The following example shortens 'C-c q' to 'C-q'.
+(define-key exwm-mode-map [?\C-q] #'exwm-input-send-next-key)
+(define-key exwm-mode-map [?\M-!] #'shell-command)
+(define-key exwm-mode-map [?\s-d] (lambda (command)
+ (interactive (list (read-shell-command "$ ")))
+ (start-process-shell-command command nil command)))
+(define-key exwm-mode-map [?\M-o] #'other-window)
+
+(global-set-key (kbd "<XF86MonBrightnessDown>") 'my/brightnessdown)
+(global-set-key (kbd "<XF86MonBrightnessUp>") 'my/brightnessup)
+(global-set-key (kbd "<XF86AudioMute>") 'my/mute)
+(global-set-key (kbd "<XF86AudioLowerVolume>") 'my/voldown)
+(global-set-key (kbd "<XF86AudioRaiseVolume>") 'my/volup)
+
+(define-key exwm-mode-map (kbd "<XF86MonBrightnessDown>") 'my/brightnessdown)
+(define-key exwm-mode-map (kbd "<XF86MonBrightnessUp>") 'my/brightnessup)
+(define-key exwm-mode-map (kbd "<XF86AudioMute>") 'my/mute)
+(define-key exwm-mode-map (kbd "<XF86AudioLowerVolume>") 'my/voldown)
+(define-key exwm-mode-map (kbd "<XF86AudioRaiseVolume>") 'my/volup)
+
+;; The following example demonstrates how to use simulation keys to mimic
+;; the behavior of Emacs. The value of `exwm-input-simulation-keys` is a
+;; list of cons cells (SRC . DEST), where SRC is the key sequence you press
+;; and DEST is what EXWM actually sends to application. Note that both SRC
+;; and DEST should be key sequences (vector or string).
+;; (setq exwm-input-simulation-keys
+;; '(
+;; ;; movement
+;; ([?\C-b] . [left])
+;; ([?\M-b] . [C-left])
+;; ([?\C-f] . [right])
+;; ([?\M-f] . [C-right])
+;; ([?\C-p] . [up])
+;; ([?\C-n] . [down])
+;; ([?\C-a] . [home])
+;; ([?\C-e] . [end])
+;; ([?\M-v] . [prior])
+;; ([?\C-v] . [next])
+;; ([?\C-d] . [delete])
+;; ([?\C-k] . [S-end delete])
+;; ;; cut/paste.
+;; ;; ([?\C-w] . [?\C-x])
+;; ;; ([?\M-w] . [?\C-c])
+;; ;; ([?\C-y] . [?\C-v])
+;; ;; search
+;; ([?\C-s] . [?\C-f])))
+
+;; You can hide the minibuffer and echo area when they're not used, by
+;; uncommenting the following line.
+;; (setq exwm-workspace-minibuffer-position 'bottom)
+
+;; Do not forget to enable EXWM. It will start by itself when things are
+;; ready. You can put it _anywhere_ in your configuration.
+(exwm-enable)
+(call-process "dunst" nil 0)
+(call-process "bash" nil 0 nil "-c" "uname -a | grep -q gentoo && gentoo-pipewire-launcher")
+
diff --git a/emacs/personal-lisp/general-text.el b/emacs/site-lisp/general-text.el
index bea3fc9..d03171a 100644
--- a/emacs/personal-lisp/general-text.el
+++ b/emacs/site-lisp/general-text.el
@@ -1,13 +1,9 @@
;; General stuff for editing all text, but particularly prose
-;; spelling
-(require 'spell-fu)
-(setq ispell-personal-dictionary "/home/tmu/.aspell.en.pws")
-(add-hook 'text-mode-hook (lambda () (spell-fu-mode 1)))
+(provide 'general-text)
;; dictionaries
(define-prefix-command 'dict-map)
-(global-set-key (kbd "M-l") 'dict-map)
(define-keymap :full nil
:parent nil
:suppress nil
@@ -21,3 +17,16 @@
nil nil nil
nil nil t))
(activate-input-method nil)))
+
+(setq ispell-personal-dictionary "/home/tmu/.aspell.en.pws")
+(add-hook 'text-mode-hook (lambda ()
+ (ispell-mode 1)
+ (local-set-key (kbd "M-l") 'dict-map)))
+
+(electric-pair-mode 1)
+
+(use-package dabbrev
+ :config
+ (add-to-list 'dabbrev-ignored-buffer-modes 'doc-view-mode)
+ (add-to-list 'dabbrev-ignored-buffer-modes 'pdf-view-mode)
+ (add-to-list 'dabbrev-ignored-buffer-modes 'tags-table-mode))
diff --git a/emacs/site-lisp/maze.el b/emacs/site-lisp/maze.el
new file mode 100644
index 0000000..784049f
--- /dev/null
+++ b/emacs/site-lisp/maze.el
@@ -0,0 +1,64 @@
+;; [adj] movement and editing for lisp
+
+(provide 'maze-lisp)
+
+(defun maze--cur-end ()
+ (push-mark)
+ (thing-at-point--end-of-sexp)
+ (let ((cur (point)))
+ (goto-char (mark))
+ (pop-mark)
+ cur))
+
+(defun maze--hl (beg end &optional buffer)
+ (let ((overlay (make-overlay beg end (or buffer (current-buffer)))))
+ (overlay-put overlay 'face 'highlight)
+ (setq maze-overlay overlay)
+ overlay))
+
+(defun maze--unhl ()
+ (if maze-overlay
+ (delete-overlay maze-overlay)))
+
+(defun maze--update-hl (beg end)
+ (if maze-overlay
+ (move-overlay maze-overlay beg end)
+ (maze--hl beg end)))
+
+(defun maze-forward (n)
+ (interactive "p")
+ (goto-char (or (scan-sexps (point) 2) (buffer-end 1)))
+ (thing-at-point--beginning-of-sexp)
+ (maze--update-hl (point) (maze--cur-end)))
+
+(defun maze-backward (n)
+ (interactive "p")
+ (let ((n (or n 1)))
+ (backward-sexp n))
+ (maze--update-hl (point) (maze--cur-end)))
+
+(defun maze-inward (n)
+ (interactive "p")
+ (down-list n)
+ (maze--update-hl (point) (maze--cur-end)))
+
+(defun maze-outward (n)
+ (interactive "p")
+ (backward-up-list n)
+ (maze--update-hl (point) (maze--cur-end)))
+
+(defvar-keymap maze-mode-map
+ (kbd "j") 'maze-forward
+ (kbd "k") 'maze-backward
+ (kbd "l") 'maze-inward
+ (kbd "h") 'maze-outward)
+
+
+(define-minor-mode maze-mode
+ "doc"
+ :keymap maze-mode-map
+ :init-value nil
+ :after-hook (progn
+ (setq-local parse-sexp-ignore-comments t)
+ (setq-local maze-overlay nil)
+ (font-lock-mode 1)))
diff --git a/emacs/site-lisp/modeline-config.el b/emacs/site-lisp/modeline-config.el
new file mode 100644
index 0000000..873f855
--- /dev/null
+++ b/emacs/site-lisp/modeline-config.el
@@ -0,0 +1,63 @@
+;;; Modeline config
+
+(provide 'modeline-config)
+
+(require 'battery)
+(display-battery-mode 1)
+
+(use-package doom-modeline
+ :init
+ (doom-modeline-mode 1))
+(use-package minions
+ :init
+ (minions-mode 1)
+ :custom
+ (minions-prominent-modes '(persp-mode auto-fill-mode eldoc-mode eglot-mode lsp-mode)))
+
+(require 'time)
+(setq display-time-day-and-date t)
+;; Set up the time timer.
+(defun enable-display-time-backend ()
+ "Do the internal bit of `display-time-mode` but without adding it to the
+global mode string"
+ (and display-time-timer (cancel-timer display-time-timer))
+ (setq display-time-timer nil)
+ (setq display-time-string "")
+ (setq display-time-load-average display-time-default-load-average)
+ (progn
+ ;; (or (memq 'display-time-string global-mode-string)
+ ;; (setq global-mode-string
+ ;; (append global-mode-string '(display-time-string))))
+ ;; Set up the time timer.
+ (setq display-time-timer
+ (run-at-time t display-time-interval
+ 'display-time-event-handler))
+ ;; Make the time appear right away.
+ (display-time-update)))
+
+;; (enable-display-time-backend)
+(display-time-mode 1)
+;; there is more in the single-header file
+
+;; -----------------------------------------------------------------------------
+;; telephone line stuff
+
+;; (setq telephone-line-primary-left-separator 'telephone-line-tan-left)
+;; (setq telephone-line-primary-right-separator 'telephone-line-tan-right)
+
+;; (telephone-line-defsegment* telephone-line-time-segment ()
+;; (telephone-line-raw display-time-string t))
+
+;; (setq telephone-line-lhs
+;; '((evil . (telephone-line-evil-tag-segment))
+;; (accent . (telephone-line-vc-segment
+;; telephone-line-erc-modified-channels-segment
+;; telephone-line-process-segment))
+;; (nil . (telephone-line-buffer-segment
+;; telephone-line-minions-mode-segment))))
+;; (setq telephone-line-rhs
+;; '((nil . (telephone-line-misc-info-segment))
+;; (accent . (telephone-line-time-segment))
+;; (evil . (telephone-line-airline-position-segment))))
+
+;; (telephone-line-mode 1)
diff --git a/emacs/personal-lisp/custom-binds.el b/emacs/site-lisp/my-binds.el
index 92dcc69..d3455e4 100644
--- a/emacs/personal-lisp/custom-binds.el
+++ b/emacs/site-lisp/my-binds.el
@@ -1,20 +1,24 @@
-;; keyboard binds (mostly global)
+;;; Various custom binds that aren't part of an external package
+
+(provide 'my-binds)
+(require 'my-funcs)
+
(global-set-key (kbd "C-x C-C") 'save-buffers-kill-terminal)
(global-set-key (kbd "C-x C-c") 'close-or-kill)
(global-set-key (kbd "M-w") 'copy-region-as-kill) ;;make copying not flash cursor
(global-set-key (kbd "M-(") 'wrap-region-paren)
(global-set-key (kbd "M-z") 'zap-whitespace)
(global-set-key (kbd "C-M-z") 'wrap-sexp)
-(require 'buffer-move)
-(global-set-key (kbd "C-x -") 'buf-move-right)
(global-set-key (kbd "M-o") 'other-window)
(global-set-key (kbd "M-c") 'calc)
-(global-set-key (kbd "M-k") 'kill-current-buffer)
-(global-set-key (kbd "M-K") 'kill-buffer-and-window)
(global-set-key (kbd "M-U") 'scroll-lock-mode)
(global-set-key (kbd "M-Q") 'auto-fill-mode)
(require 'dired)
-(define-key dired-mode-map (kbd "C-o") 'dired-display-file)
-;; (add-hook 'dired-mode-hook (lambda ()
-;; (define-key evil-normal-state-local-map (kbd "C-o")
-;; 'dired-display-file)))
+(keymap-set dired-mode-map "C-o" 'dired-display-file)
+(keymap-set dired-mode-map "F" 'dired-do-find-marked-files)
+
+
+(global-set-key (kbd "M-l") 'forward-char)
+(global-set-key (kbd "M-j") 'next-line)
+(global-set-key (kbd "M-k") 'previous-line)
+(global-set-key (kbd "M-h") 'backward-char)
diff --git a/emacs/personal-lisp/custom-funcs.el b/emacs/site-lisp/my-funcs.el
index 79946ff..b1cfdec 100644
--- a/emacs/personal-lisp/custom-funcs.el
+++ b/emacs/site-lisp/my-funcs.el
@@ -1,3 +1,7 @@
+;;; Various functions functions that are not part of an external package
+
+(provide 'my-funcs)
+
;; see transparancy in init.el
(defun toggle-frame-transparency ()
@@ -37,12 +41,12 @@ Similar to pressing ( with the region active."
"Wraps the following sexp in a pair of parens.
Places inside the new pair, with prefix arg do the same backwards, pushing the
mark. Does the same of ARG number sexps if given"
- (interactive "P")
+ (interactive "p")
(message "%s" arg)
(if arg
(progn
(push-mark)
- (insert-pair -1 ?\( ?\)))
+ (insert-pair arg ?\( ?\)))
(insert-pair 1 ?\( ?\))))
(defun close-or-kill ()
@@ -125,3 +129,15 @@ BEG and END define the region."
(goto-char (point-min))
(while (re-search-forward " +$" nil t)
(replace-match "" nil nil)))))
+
+(defun open-window-by-buffer (buffer)
+ "Move focus to an extant window by the buffer it contains."
+ (interactive "bBuffer: ")
+ (let ((win (get-buffer-window buffer t)))
+ (if win
+ (select-window win)
+ (switch-to-buffer buffer))))
+
+(defun dired-do-find-marked-files ()
+ (interactive)
+ (seq-do 'find-file (dired-get-marked-files)))
diff --git a/emacs/personal-lisp/single-header.el b/emacs/site-lisp/single-header.el
index 5ca4afc..1196ea0 100755
--- a/emacs/personal-lisp/single-header.el
+++ b/emacs/site-lisp/single-header.el
@@ -55,9 +55,21 @@
(with-face str 'single-header)))
-(setq global-mode-string '("" (:eval (concat (with-face (format " [%s] " default-directory)
- :weight 'bold
- :foreground "green2")))))
+(defun shorten-path (path)
+ "Shortens each directory in PATH except for the last directory to its first character."
+ (let* ((components (split-string path "/")) ; Split the path into components
+ (last-component (-last (lambda (s) (not (string-empty-p s))) components)) ; Extract the last component
+ (shortened-components ; Shorten all components except the last
+ (mapcar (lambda (comp)
+ (if (or (string-equal comp last-component) (string-empty-p comp))
+ comp
+ (substring comp 0 1)))
+ components)))
+ (mapconcat 'identity shortened-components "/"))) ; Recombine components into a path
+
+;; (setq global-mode-string '("" (:eval (concat (with-face (format " [%s] " (shorten-path default-directory))
+;; :weight 'bold
+;; :foreground "green2")))))
(defun single-header-init-buffer (buf)
(with-current-buffer buf
@@ -121,11 +133,11 @@
(erase-buffer)
(insert (eval single-header-format)))))
-(add-hook 'after-make-frame-functions (lambda (frame)
- (with-selected-frame frame
- (single-header-show single-header--current-header-buffer))))
+;; (add-hook 'after-make-frame-functions (lambda (frame)
+;; (with-selected-frame frame
+;; (single-header-show single-header--current-header-buffer))))
;; do init frame seperately
-(single-header-show single-header--current-header-buffer)
-(run-with-timer 0 1 'single-header-update)
+;; (single-header-show single-header--current-header-buffer)
+;; (run-with-timer 0 1 'single-header-update)
diff --git a/emacs/personal-lisp/tex-conf.el b/emacs/site-lisp/tex-conf.el
index 4592ce5..4592ce5 100644
--- a/emacs/personal-lisp/tex-conf.el
+++ b/emacs/site-lisp/tex-conf.el
diff --git a/emacs/personal-lisp/tmu-custom-theme.el b/emacs/site-lisp/tmu-custom-theme.el
index 37032e6..e9d95ff 100755
--- a/emacs/personal-lisp/tmu-custom-theme.el
+++ b/emacs/site-lisp/tmu-custom-theme.el
@@ -1,3 +1,5 @@
+(provide 'tmu-custom-theme)
+
(deftheme tmu-custom
"Created 2023-01-06.")
diff --git a/emacs/tmu-custom-theme.el b/emacs/tmu-custom-theme.el
deleted file mode 100644
index a3e30d3..0000000
--- a/emacs/tmu-custom-theme.el
+++ /dev/null
@@ -1,60 +0,0 @@
-(deftheme tmu-custom
- "Created 2023-01-06.")
-
-(custom-theme-set-faces
- 'tmu-custom
- '(cursor ((((background light)) (:background "black")) (((background dark)) (:background "white"))))
- '(fixed-pitch ((t (:family "Monospace"))))
- '(variable-pitch ((((type w32)) (:foundry "outline" :family "Arial")) (t (:family "Sans Serif"))))
- '(escape-glyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown"))))
- '(homoglyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown"))))
- '(minibuffer-prompt ((t (:weight bold :box (:line-width (1 . -1) :color "red" :style released-button) :foreground "white smoke" :background "royal blue"))))
- '(highlight ((t (:background "gray30"))))
- '(region ((t (:extend t :background "SeaGreen4"))))
- '(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50")) (((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70")) (((class color) (min-colors 8) (background light)) (:foreground "green")) (((class color) (min-colors 8) (background dark)) (:foreground "yellow"))))
- '(secondary-selection ((t (:extend t :foreground "#f6f3e8" :background "#333366"))))
- '(trailing-whitespace ((((class color) (background light)) (:background "red1")) (((class color) (background dark)) (:background "red1")) (t (:inverse-video t))))
- '(font-lock-bracket-face ((t (:inherit (font-lock-punctuation-face)))))
- '(font-lock-builtin-face ((t (:foreground "chartreuse2"))))
- '(font-lock-comment-delimiter-face ((default (:inherit (font-lock-comment-face)))))
- '(font-lock-comment-face ((t (:foreground "orchid2"))))
- '(font-lock-constant-face ((t (:foreground "maroon1"))))
- '(font-lock-delimiter-face ((t (:inherit (font-lock-punctuation-face)))))
- '(font-lock-doc-face ((t (:foreground "indian red"))))
- '(font-lock-doc-markup-face ((t (:inherit (font-lock-constant-face)))))
- '(font-lock-escape-face ((t (:inherit (font-lock-regexp-grouping-backslash)))))
- '(font-lock-function-name-face ((t (:foreground "spring green"))))
- '(font-lock-keyword-face ((t (:weight bold :foreground "light sea green"))))
- '(font-lock-negation-char-face ((t nil)))
- '(font-lock-number-face ((t nil)))
- '(font-lock-misc-punctuation-face ((t (:inherit (font-lock-punctuation-face)))))
- '(font-lock-operator-face ((t nil)))
- '(font-lock-preprocessor-face ((t (:foreground "cornflower blue"))))
- '(font-lock-property-face ((t (:inherit (font-lock-variable-name-face)))))
- '(font-lock-punctuation-face ((t nil)))
- '(font-lock-regexp-grouping-backslash ((t (:inherit (bold)))))
- '(font-lock-regexp-grouping-construct ((t (:inherit (bold)))))
- '(font-lock-string-face ((t (:foreground "Skyblue1"))))
- '(font-lock-type-face ((t (:foreground "medium purple"))))
- '(font-lock-variable-name-face ((t (:foreground "PaleGreen2"))))
- '(font-lock-warning-face ((t (:weight bold :foreground "hot pink"))))
- '(button ((t (:inherit (link)))))
- '(link ((((class color) (min-colors 88) (background light)) (:underline (:color foreground-color :style line :position nil) :foreground "RoyalBlue3")) (((class color) (background light)) (:underline (:color foreground-color :style line :position nil) :foreground "blue")) (((class color) (min-colors 88) (background dark)) (:underline (:color foreground-color :style line :position nil) :foreground "cyan1")) (((class color) (background dark)) (:underline (:color foreground-color :style line :position nil) :foreground "cyan")) (t (:inherit (underline)))))
- '(link-visited ((default (:inherit (link))) (((class color) (background light)) (:foreground "magenta4")) (((class color) (background dark)) (:foreground "violet"))))
- '(fringe ((((class color) (background light)) (:background "grey95")) (((class color) (background dark)) (:background "grey10")) (t (:background "gray"))))
- '(header-line ((t (:inherit mode-line))))
- '(tooltip ((((class color)) (:inherit (variable-pitch) :foreground "black" :background "lightyellow")) (t (:inherit (variable-pitch)))))
- '(mode-line ((t (:background "black" :family "DejaVu Sans"))))
- '(mode-line-buffer-id ((t (:weight bold))))
- '(mode-line-emphasis ((t (:weight bold))))
- '(mode-line-highlight ((((supports :box t) (class color) (min-colors 88)) (:box (:line-width (2 . 2) :color "grey40" :style released-button))) (t (:inherit (highlight)))))
- '(mode-line-inactive ((t (:inherit mode-line :foreground "dark gray"))))
- '(isearch ((((class color) (min-colors 88) (background light)) (:foreground "lightskyblue1" :background "magenta3")) (((class color) (min-colors 88) (background dark)) (:foreground "brown4" :background "palevioletred2")) (((class color) (min-colors 16)) (:foreground "cyan1" :background "magenta4")) (((class color) (min-colors 8)) (:foreground "cyan1" :background "magenta4")) (t (:inverse-video t))))
- '(isearch-fail ((((class color) (min-colors 88) (background light)) (:background "RosyBrown1")) (((class color) (min-colors 88) (background dark)) (:background "red4")) (((class color) (min-colors 16)) (:background "red")) (((class color) (min-colors 8)) (:background "red")) (((class color grayscale)) (:foreground "grey")) (t (:inverse-video t))))
- '(lazy-highlight ((((class color) (min-colors 88) (background light)) (:distant-foreground "black" :background "paleturquoise")) (((class color) (min-colors 88) (background dark)) (:distant-foreground "white" :background "paleturquoise4")) (((class color) (min-colors 16)) (:distant-foreground "white" :background "turquoise3")) (((class color) (min-colors 8)) (:distant-foreground "white" :background "turquoise3")) (t (:underline (:color foreground-color :style line :position nil)))))
- '(match ((((class color) (min-colors 88) (background light)) (:background "khaki1")) (((class color) (min-colors 88) (background dark)) (:background "RoyalBlue3")) (((class color) (min-colors 8) (background light)) (:foreground "black" :background "yellow")) (((class color) (min-colors 8) (background dark)) (:foreground "white" :background "blue")) (((type tty) (class mono)) (:inverse-video t)) (t (:background "gray"))))
- '(next-error ((t (:inherit (region)))))
- '(query-replace ((t (:inherit (isearch)))))
- '(default ((t (:family "Source Code Pro" :foundry "ADBO" :width normal :height 98 :weight regular :slant normal :underline nil :overline nil :extend nil :strike-through nil :box nil :inverse-video nil :foreground "white smoke" :background "gray10" :stipple nil :inherit nil)))))
-
-(provide-theme 'tmu-custom)