another bankruptcy
This commit is contained in:
parent
23a4d80ace
commit
b2e3e7505c
15 changed files with 430 additions and 450 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -8,7 +8,6 @@ custom.el
|
||||||
eln-cache
|
eln-cache
|
||||||
elpa
|
elpa
|
||||||
games
|
games
|
||||||
games
|
|
||||||
ido.last
|
ido.last
|
||||||
irony
|
irony
|
||||||
org-latex-preview
|
org-latex-preview
|
||||||
|
@ -21,3 +20,5 @@ straight
|
||||||
transient
|
transient
|
||||||
history
|
history
|
||||||
tramp
|
tramp
|
||||||
|
*.eln
|
||||||
|
*.elc
|
||||||
|
|
3
bin/ec
3
bin/ec
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
emacsclient -c -a="" $@
|
|
3
bin/ect
3
bin/ect
|
@ -1,3 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
emacsclient -t -a="" $@
|
|
5
early-init.el
Normal file
5
early-init.el
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
;; compile-angel pre-setup
|
||||||
|
(if (native-comp-available-p)
|
||||||
|
(progn
|
||||||
|
(setq load-prefer-newer t)
|
||||||
|
(setq native-comp-jit-compilation nil)))
|
247
init.el
247
init.el
|
@ -1,65 +1,112 @@
|
||||||
(add-to-list 'load-path "~/.emacs.d/lisp/")
|
|
||||||
|
|
||||||
;; supress nativecomp warnings
|
;; supress nativecomp warnings
|
||||||
(setq native-comp-async-report-warnings-errors 'silent)
|
(setq native-comp-async-report-warnings-errors 'silent)
|
||||||
|
|
||||||
;;; straight for package management
|
;; I use custom vars for local config, so let's put them to separate
|
||||||
(require 'oxa/package-mgmt)
|
;; file, where it's easier for git to ignore it
|
||||||
|
(setq custom-file "~/.emacs.d/custom.el")
|
||||||
|
(load custom-file 'noerror)
|
||||||
|
|
||||||
;;; basic bits
|
;; straight.el bootstrap
|
||||||
(require 'oxa/sane-defaults)
|
(defvar bootstrap-version)
|
||||||
(require 'oxa/utils)
|
(let ((bootstrap-file
|
||||||
(require 'oxa/misc)
|
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
||||||
(require 'oxa/completion)
|
(bootstrap-version 6))
|
||||||
|
(unless (file-exists-p bootstrap-file)
|
||||||
|
(with-current-buffer
|
||||||
|
(url-retrieve-synchronously
|
||||||
|
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
||||||
|
'silent 'inhibit-cookies)
|
||||||
|
(goto-char (point-max))
|
||||||
|
(eval-print-last-sexp)))
|
||||||
|
(load bootstrap-file nil 'nomessage))
|
||||||
|
|
||||||
(require 'oxa/org)
|
(straight-use-package 'use-package)
|
||||||
(require 'oxa/latex)
|
|
||||||
|
|
||||||
(require 'oxa/mail)
|
;; compile angel
|
||||||
|
(use-package compile-angel
|
||||||
|
:when (native-comp-available-p)
|
||||||
|
:straight t
|
||||||
|
:demand t
|
||||||
|
:config
|
||||||
|
(setq compile-angel-verbose t)
|
||||||
|
(compile-angel-on-load-mode))
|
||||||
|
|
||||||
;;; theme
|
;;; basic interface stuff
|
||||||
(setq modus-themes-italic-constructs t
|
(menu-bar-mode 1)
|
||||||
modus-themes-bold-constructs t)
|
(global-display-line-numbers-mode -1)
|
||||||
|
(column-number-mode 1)
|
||||||
|
|
||||||
(load-theme 'modus-operandi)
|
(setq inhibit-startup-screen t)
|
||||||
(setq-default indicate-empty-lines t)
|
(setq-default indicate-buffer-boundaries 'left)
|
||||||
(setq-default show-trailing-whitespace t)
|
(setq auto-save-default nil)
|
||||||
(add-hook 'prog-mode-hook #'(lambda () (whitespace-mode t)))
|
(setq visible-bell t)
|
||||||
|
|
||||||
;; match system theme
|
;; TODO Proper graphical setup
|
||||||
;; https://freerangebits.com/posts/2025/02/emacs-light-dark/
|
(add-hook 'after-make-frame-functions
|
||||||
(defvar oxa:dark-theme 'modus-vivendi)
|
#'(lambda (frame)
|
||||||
(defvar oxa:light-theme 'modus-operandi)
|
(toggle-scroll-bar -1)
|
||||||
(defun oxa:theme-from-dbus (value)
|
(tool-bar-mode -1)))
|
||||||
(load-theme (if (= 1 (car (flatten-list value)))
|
|
||||||
oxa:dark-theme
|
|
||||||
oxa:light-theme)
|
|
||||||
t))
|
|
||||||
|
|
||||||
(require 'dbus)
|
;;; improvements to compilation buffer
|
||||||
|
(require 'compile)
|
||||||
|
(setq compilation-scroll-output t)
|
||||||
|
(require 'ansi-color)
|
||||||
|
(add-hook 'compilation-filter-hook 'ansi-color-compilation-filter)
|
||||||
|
|
||||||
;; Set the current theme based on what the system theme is right now:
|
;;; override default annoyances
|
||||||
(dbus-call-method-asynchronously
|
;; I'm the only cowboy on this mainframe
|
||||||
:session "org.freedesktop.portal.Desktop"
|
;; (setq create-lockfiles nil)
|
||||||
"/org/freedesktop/portal/desktop"
|
;; X is dead
|
||||||
"org.freedesktop.portal.Settings"
|
(setq inhibit-x-resources t)
|
||||||
"Read"
|
;; use ibuffer instead of standard buffer list
|
||||||
#'oxa:theme-from-dbus
|
(global-set-key (kbd "C-x C-b") 'ibuffer)
|
||||||
"org.freedesktop.appearance"
|
(fset 'yes-or-no-p 'y-or-n-p)
|
||||||
"color-scheme")
|
(setq confirm-nonexistent-file-or-buffer nil)
|
||||||
|
|
||||||
;; Register to be notified when the system theme changes:
|
;; let's delete a tab as a whole...
|
||||||
(dbus-register-signal
|
(setq backward-delete-char-untabify-method 'nil)
|
||||||
:session "org.freedesktop.portal.Desktop"
|
;;; identation holywar contribution
|
||||||
"/org/freedesktop/portal/desktop"
|
(setq-default indent-tabs-mode 'nil)
|
||||||
"org.freedesktop.portal.Settings"
|
|
||||||
"SettingChanged"
|
;; highlight the parens
|
||||||
(lambda (path var value)
|
(setq show-paren-delay 0)
|
||||||
(when (and (string-equal path "org.freedesktop.appearance")
|
(show-paren-mode 1)
|
||||||
(string-equal var "color-scheme"))
|
|
||||||
(oxa:theme-from-dbus value))))
|
;; follow symlinks to version-controlled files
|
||||||
|
(setq vc-follow-symlinks t)
|
||||||
|
|
||||||
|
;; backup management
|
||||||
|
(setq backup-directory-alist `(("." . "~/.emacs.d/backups")))
|
||||||
|
(setq delete-old-versions t
|
||||||
|
kept-new-versions 6
|
||||||
|
kept-old-versions 2
|
||||||
|
version-control t)
|
||||||
|
|
||||||
|
;; default frame size
|
||||||
|
(add-to-list 'default-frame-alist '(height . 53))
|
||||||
|
(add-to-list 'default-frame-alist '(width . 107))
|
||||||
|
|
||||||
|
(if (eq system-type 'gnu/linux)
|
||||||
|
(pixel-scroll-precision-mode t))
|
||||||
|
|
||||||
|
;; Stolen from https://github.com/rexim/dotfiles
|
||||||
|
(defun rc/duplicate-line ()
|
||||||
|
"Duplicate current line"
|
||||||
|
(interactive)
|
||||||
|
(let ((column (- (point) (point-at-bol)))
|
||||||
|
(line (let ((s (thing-at-point 'line t)))
|
||||||
|
(if s (string-remove-suffix "\n" s) ""))))
|
||||||
|
(move-end-of-line 1)
|
||||||
|
(newline)
|
||||||
|
(insert line)
|
||||||
|
(move-beginning-of-line 1)
|
||||||
|
(forward-char column)))
|
||||||
|
|
||||||
|
(global-set-key (kbd "C-,") 'rc/duplicate-line)
|
||||||
|
|
||||||
|
;; faster window switch
|
||||||
|
(global-set-key (kbd "C-;") #'other-window)
|
||||||
|
|
||||||
;;; personal framework bits
|
|
||||||
;; my personal keymap
|
;; my personal keymap
|
||||||
(define-prefix-command 'oxamap)
|
(define-prefix-command 'oxamap)
|
||||||
(global-set-key (kbd "C-z") 'oxamap)
|
(global-set-key (kbd "C-z") 'oxamap)
|
||||||
|
@ -70,111 +117,17 @@
|
||||||
(defun tabs-yay ()
|
(defun tabs-yay ()
|
||||||
"Function to enable tab indentation in buffer."
|
"Function to enable tab indentation in buffer."
|
||||||
(setq indent-tabs-mode t))
|
(setq indent-tabs-mode t))
|
||||||
|
|
||||||
(add-hook 'c-mode-hook 'tabs-yay)
|
(add-hook 'c-mode-hook 'tabs-yay)
|
||||||
|
|
||||||
;;; expand region
|
;;; Monday is the fist day of the week
|
||||||
(straight-use-package 'expand-region)
|
(require 'calendar)
|
||||||
(require 'expand-region)
|
(setq calendar-week-start-day 1)
|
||||||
(global-set-key (kbd "C-=") 'er/expand-region)
|
|
||||||
|
|
||||||
;;; move text
|
|
||||||
(straight-use-package 'move-text)
|
|
||||||
(global-set-key (kbd "M-n") 'move-text-down)
|
|
||||||
(global-set-key (kbd "M-p") 'move-text-up)
|
|
||||||
|
|
||||||
|
|
||||||
;; direnv
|
|
||||||
(straight-use-package 'direnv)
|
|
||||||
(direnv-mode 1)
|
|
||||||
|
|
||||||
;; magit
|
|
||||||
(straight-use-package 'magit)
|
|
||||||
(require 'magit)
|
|
||||||
(global-set-key (kbd "C-x g") 'magit-status)
|
|
||||||
(global-set-key (kbd "C-x M-g") 'magit-dispatch)
|
|
||||||
(global-set-key (kbd "C-c M-g") 'magit-file-dispatch)
|
|
||||||
|
|
||||||
;;; Language support
|
|
||||||
(straight-use-package 'nix-mode)
|
|
||||||
(setq nix-nixfmt-bin "nixpkgs-fmt")
|
|
||||||
(straight-use-package 'markdown-mode)
|
|
||||||
(straight-use-package 'yaml-mode)
|
|
||||||
|
|
||||||
(straight-use-package 'rust-mode)
|
|
||||||
(require 'rust-mode)
|
|
||||||
(oxa/hook rust-mode-hook
|
|
||||||
(setq-local fill-column 100))
|
|
||||||
|
|
||||||
(require 'cc-mode)
|
|
||||||
|
|
||||||
;;; Copypasta of llvm/utils/emacs/emacs.el
|
|
||||||
;; LLVM coding style guidelines in emacs
|
|
||||||
;; Maintainer: LLVM Team, http://llvm.org/
|
|
||||||
(defun llvm-lineup-statement (langelem)
|
|
||||||
(let ((in-assign (c-lineup-assignments langelem)))
|
|
||||||
(if (not in-assign)
|
|
||||||
'++
|
|
||||||
(aset in-assign 0
|
|
||||||
(+ (aref in-assign 0)
|
|
||||||
(* 2 c-basic-offset)))
|
|
||||||
in-assign)))
|
|
||||||
|
|
||||||
;; Add a cc-mode style for editing LLVM C and C++ code
|
|
||||||
(c-add-style "llvm.org"
|
|
||||||
'("gnu"
|
|
||||||
(fill-column . 80)
|
|
||||||
(c++-indent-level . 2)
|
|
||||||
(c-basic-offset . 2)
|
|
||||||
(indent-tabs-mode . nil)
|
|
||||||
(c-offsets-alist . ((arglist-intro . ++)
|
|
||||||
(innamespace . 0)
|
|
||||||
(member-init-intro . ++)
|
|
||||||
(statement-cont . llvm-lineup-statement)))))
|
|
||||||
|
|
||||||
;; Files with "llvm" in their names will automatically be set to the
|
|
||||||
;; llvm.org coding style.
|
|
||||||
(add-hook 'c-mode-common-hook
|
|
||||||
(function
|
|
||||||
(lambda nil
|
|
||||||
(if (string-match "llvm" buffer-file-name)
|
|
||||||
(progn
|
|
||||||
(c-set-style "llvm.org"))))))
|
|
||||||
|
|
||||||
(setq c-default-style '((java-mode . "java")
|
|
||||||
(awk-mode . "awk")
|
|
||||||
(c-mode . "linux")
|
|
||||||
(c++-mode . "llvm.org")
|
|
||||||
(other . "stroustrup")))
|
|
||||||
|
|
||||||
;; completion
|
|
||||||
(straight-use-package 'company)
|
|
||||||
(global-company-mode)
|
|
||||||
|
|
||||||
(custom-set-variables
|
(custom-set-variables
|
||||||
'(whitespace-style
|
'(whitespace-style
|
||||||
(quote
|
(quote
|
||||||
(face tabs spaces trailing space-before-tab newline indentation empty space-after-tab tab-mark))))
|
(face tabs spaces trailing space-before-tab newline indentation empty space-after-tab tab-mark))))
|
||||||
|
|
||||||
;; nya-nya-nya-nya-nya-nya
|
(require 'packages)
|
||||||
(straight-use-package 'nyan-mode)
|
|
||||||
(require 'nyan-mode)
|
|
||||||
(setq nyan-animate-nyancat t
|
|
||||||
nyan-wavy-trail t)
|
|
||||||
(nyan-mode 1)
|
|
||||||
|
|
||||||
;; ess
|
|
||||||
(straight-use-package 'ess)
|
|
||||||
|
|
||||||
;; faster window switch
|
|
||||||
(global-set-key (kbd "C-;") #'other-window)
|
|
||||||
|
|
||||||
(straight-use-package 'dired-sidebar)
|
|
||||||
(setq dired-sidebar-theme 'ascii)
|
|
||||||
(define-key 'oxamap (kbd "t") 'dired-sidebar-toggle-sidebar)
|
|
||||||
|
|
||||||
|
|
||||||
;; I use custom vars for local config, so let's put them to separate
|
|
||||||
;; file, where it's easier for git to ignore it
|
|
||||||
(setq custom-file "~/.emacs.d/custom.el")
|
|
||||||
(load custom-file 'noerror)
|
|
||||||
|
|
|
@ -1,81 +0,0 @@
|
||||||
(straight-use-package 'vertico)
|
|
||||||
(straight-use-package 'orderless)
|
|
||||||
(straight-use-package 'marginalia)
|
|
||||||
(straight-use-package 'consult)
|
|
||||||
|
|
||||||
;; vertico uses history
|
|
||||||
(require 'savehist)
|
|
||||||
(savehist-mode)
|
|
||||||
|
|
||||||
;; orderless completion
|
|
||||||
(require 'orderless)
|
|
||||||
(setq completion-styles '(orderless basic)
|
|
||||||
completion-category-defaults nil
|
|
||||||
completion-category-overrides '((file (styles partial-completion))))
|
|
||||||
|
|
||||||
;; completion framework
|
|
||||||
(require 'vertico)
|
|
||||||
(vertico-mode)
|
|
||||||
|
|
||||||
(setq enable-recursive-minibuffers t)
|
|
||||||
|
|
||||||
(keymap-set vertico-map "?" #'minibuffer-completion-help)
|
|
||||||
(keymap-set vertico-map "M-RET" #'minibuffer-force-complete-and-exit)
|
|
||||||
(keymap-set vertico-map "M-TAB" #'minibuffer-complete)
|
|
||||||
|
|
||||||
;; annotations for minibuffer
|
|
||||||
(require 'marginalia)
|
|
||||||
(marginalia-mode)
|
|
||||||
|
|
||||||
(keymap-set minibuffer-local-map "M-A" #'marginalia-cycle)
|
|
||||||
|
|
||||||
;; vertico-enabled replacements
|
|
||||||
(require 'consult)
|
|
||||||
(setq consult-narrow-key "<")
|
|
||||||
|
|
||||||
;; global binds
|
|
||||||
(global-set-key (kbd "C-c M-x") 'consult-mode-command)
|
|
||||||
(global-set-key (kbd "C-c h") 'consult-history)
|
|
||||||
(global-set-key (kbd "C-c k") 'consult-kmacro)
|
|
||||||
(global-set-key (kbd "C-c m") 'consult-man)
|
|
||||||
(global-set-key (kbd "C-c i") 'consult-info)
|
|
||||||
(global-set-key (kbd "M-y") 'consult-yank-pop)
|
|
||||||
(global-set-key (kbd "C-x b") 'consult-buffer) ;; orig. switch-to-buffer
|
|
||||||
(global-set-key (kbd "C-x M-:") 'consult-complex-command) ;; orig. repeat-complex-command
|
|
||||||
(global-set-key (kbd "C-x 4 b") 'consult-buffer-other-window) ;; orig. switch-to-buffer-other-window
|
|
||||||
(global-set-key (kbd "C-x 5 b") 'consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame
|
|
||||||
(global-set-key (kbd "C-x r b") 'consult-bookmark) ;; orig. bookmark-jump
|
|
||||||
(global-set-key (kbd "C-x p b") 'consult-project-buffer) ;; orig. project-switch-to-buffer
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; goto-map
|
|
||||||
(global-set-key (kbd "M-g e") 'consult-compile-error)
|
|
||||||
(global-set-key (kbd "M-g f") 'consult-flymake) ;; Alternative: consult-flycheck
|
|
||||||
(global-set-key (kbd "M-g g") 'consult-goto-line) ;; orig. goto-line
|
|
||||||
(global-set-key (kbd "M-g M-g") 'consult-goto-line) ;; orig. goto-line
|
|
||||||
(global-set-key (kbd "M-g o") 'consult-outline) ;; Alternative: consult-org-heading
|
|
||||||
(global-set-key (kbd "M-g m") 'consult-mark)
|
|
||||||
(global-set-key (kbd "M-g k") 'consult-global-mark)
|
|
||||||
(global-set-key (kbd "M-g i") 'consult-imenu)
|
|
||||||
(global-set-key (kbd "M-g I") 'consult-imenu-multi)
|
|
||||||
|
|
||||||
;; search map
|
|
||||||
(global-set-key (kbd "M-s d") 'consult-find)
|
|
||||||
(global-set-key (kbd "M-s D") 'consult-locate)
|
|
||||||
(global-set-key (kbd "M-s g") 'consult-grep)
|
|
||||||
(global-set-key (kbd "M-s G") 'consult-git-grep)
|
|
||||||
(global-set-key (kbd "M-s r") 'consult-ripgrep)
|
|
||||||
(global-set-key (kbd "M-s l") 'consult-line)
|
|
||||||
(global-set-key (kbd "M-s L") 'consult-line-multi)
|
|
||||||
(global-set-key (kbd "M-s k") 'consult-keep-lines)
|
|
||||||
(global-set-key (kbd "M-s u") 'consult-focus-lines)
|
|
||||||
|
|
||||||
|
|
||||||
;; finding files
|
|
||||||
|
|
||||||
;; minibuffer
|
|
||||||
(keymap-set minibuffer-local-map "M-s" #'consult-history)
|
|
||||||
(keymap-set minibuffer-local-map "M-r" #'consult-history)
|
|
||||||
|
|
||||||
(provide 'oxa/completion)
|
|
|
@ -1,12 +0,0 @@
|
||||||
(straight-use-package 'auctex)
|
|
||||||
(require 'tex-site)
|
|
||||||
(require 'reftex)
|
|
||||||
|
|
||||||
(add-hook 'LaTeX-mode-hook 'TeX-PDF-mode)
|
|
||||||
(add-hook 'LaTeX-mode-hook 'reftex-mode)
|
|
||||||
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
|
|
||||||
|
|
||||||
(setq TeX-parse-self t)
|
|
||||||
(setq reftex-plug-into-AUCTeX t)
|
|
||||||
|
|
||||||
(provide 'oxa/latex)
|
|
|
@ -1,40 +0,0 @@
|
||||||
(require 'mu4e)
|
|
||||||
|
|
||||||
(setq mu4e-change-filenames-when-moving t)
|
|
||||||
(setq mu4e-maildir "~/mail")
|
|
||||||
|
|
||||||
(setq mu4e-update-interval (* 11 60))
|
|
||||||
|
|
||||||
(setq mu4e-contexts
|
|
||||||
(list
|
|
||||||
(make-mu4e-context
|
|
||||||
:name "oxapentane.com"
|
|
||||||
:match-func (lambda (msg)
|
|
||||||
(when msg
|
|
||||||
(string-prefix-p "/grigory@shipunov.xyz" (mu4e-message-field msg :maildir))))
|
|
||||||
:vars '((user-mail-address . "grigory@shipunov.xyz")
|
|
||||||
(user-full-name . "Grisha Shipunov")
|
|
||||||
(mu4e-drafts-folder . "/grigory@shipunov.xyz/Drafts")
|
|
||||||
(mu4e-sent-folder . "/grigory@shipunov.xyz/Sent")
|
|
||||||
(mu4e-trash-folder . "/grigory@shipunov.xyz/Trash")
|
|
||||||
(mu4e-refile-folder . "/grigory@shipunov.xyz/Archive")
|
|
||||||
(mu4e-maildir-shortcuts . (("/grigory@shipunov.xyz/INBOX" . "?i")
|
|
||||||
("/grigory@shipunov.xyz/Drafts" . "?d")
|
|
||||||
("/grigory@shipunov.xyz/Sent" . "?s")))))
|
|
||||||
(make-mu4e-context
|
|
||||||
:name "oxapentane.com"
|
|
||||||
:match-func (lambda (msg)
|
|
||||||
(when msg
|
|
||||||
(string-prefix-p "/mail@oxapentane.com" (mu4e-message-field msg :maildir))))
|
|
||||||
:vars '((user-mail-address . "mail@oxapentane.com")
|
|
||||||
(user-full-name . "Grisha Shipunov")
|
|
||||||
(mu4e-drafts-folder . "/mail@oxapentane.com/Drafts")
|
|
||||||
(mu4e-sent-folder . "/mail@oxapentane.com/Sent")
|
|
||||||
(mu4e-trash-folder . "/mail@oxapentane.com/Trash")
|
|
||||||
(mu4e-refile-folder . "/mail@oxapentane.com/Archive")
|
|
||||||
(mu4e-maildir-shortcuts . (("/mail@oxapentane.com/INBOX" . "?i")
|
|
||||||
("/mail@oxapentane.com/Drafts" . "?d")
|
|
||||||
("/mail@oxapentane.com/Sent" . "?s")
|
|
||||||
("/mail@oxapentane.com/sinkhole" . "?S")))))))
|
|
||||||
|
|
||||||
(provide 'oxa/mail)
|
|
|
@ -1,16 +0,0 @@
|
||||||
;; Stolen from https://github.com/rexim/dotfiles
|
|
||||||
(defun rc/duplicate-line ()
|
|
||||||
"Duplicate current line"
|
|
||||||
(interactive)
|
|
||||||
(let ((column (- (point) (point-at-bol)))
|
|
||||||
(line (let ((s (thing-at-point 'line t)))
|
|
||||||
(if s (string-remove-suffix "\n" s) ""))))
|
|
||||||
(move-end-of-line 1)
|
|
||||||
(newline)
|
|
||||||
(insert line)
|
|
||||||
(move-beginning-of-line 1)
|
|
||||||
(forward-char column)))
|
|
||||||
|
|
||||||
(global-set-key (kbd "C-,") 'rc/duplicate-line)
|
|
||||||
|
|
||||||
(provide 'oxa/misc)
|
|
|
@ -1,68 +0,0 @@
|
||||||
;;; Monday is the fist day of the week
|
|
||||||
(require 'calendar)
|
|
||||||
(setq calendar-week-start-day 1)
|
|
||||||
|
|
||||||
(straight-use-package 'org)
|
|
||||||
(straight-use-package 'org-roam)
|
|
||||||
(require 'org)
|
|
||||||
(require 'org-roam)
|
|
||||||
|
|
||||||
;; expose org functions
|
|
||||||
(global-set-key (kbd "C-c a") 'org-agenda)
|
|
||||||
(global-set-key (kbd "C-c c") 'org-capture)
|
|
||||||
(global-set-key (kbd "C-c l") 'org-store-link)
|
|
||||||
(define-key org-mode-map (kbd "C-c 1") 'org-time-stamp-inactive)
|
|
||||||
|
|
||||||
;; autosave advises for agenda and org-capture
|
|
||||||
(advice-add 'org-agenda-quit :before 'org-save-all-org-buffers)
|
|
||||||
(advice-add 'org-capture-finalize :after 'org-save-all-org-buffers)
|
|
||||||
(advice-add 'org-capture-refile :after 'org-save-all-org-buffers)
|
|
||||||
|
|
||||||
;; latex preview settings
|
|
||||||
(setq org-preview-latex-image-directory "~/.emacs.d/org-latex-preview/") ; Hide all previews in one place
|
|
||||||
|
|
||||||
;; habits support
|
|
||||||
(require 'org-habit)
|
|
||||||
(add-to-list 'org-modules 'org-habit)
|
|
||||||
|
|
||||||
;; babel
|
|
||||||
(org-babel-do-load-languages
|
|
||||||
'org-babel-load-languages
|
|
||||||
'((R . t)))
|
|
||||||
|
|
||||||
;; org-id - link by UUID
|
|
||||||
(require 'org-id)
|
|
||||||
(setq org-id-method 'uuid
|
|
||||||
org-id-link-to-org-use-id t)
|
|
||||||
;; abbrev expansion in org-mode
|
|
||||||
(require 'org-tempo)
|
|
||||||
|
|
||||||
;; we need indentation
|
|
||||||
(setq org-startup-indented nil
|
|
||||||
org-indent-mode-turns-on-hiding-stars nil
|
|
||||||
org-hide-leading-stars nil
|
|
||||||
org-startup-folded 'content)
|
|
||||||
;; default agenda files
|
|
||||||
(setq org-agenda-files '("~/org/"))
|
|
||||||
|
|
||||||
;; default agenda view
|
|
||||||
(setq org-agenda-start-day "-3d"
|
|
||||||
org-agenda-span 13)
|
|
||||||
;; templates
|
|
||||||
(setq org-capture-templates
|
|
||||||
'(("n" "note" entry
|
|
||||||
(file+headline "~/org/inbox.org" "Notes")
|
|
||||||
"** %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n")
|
|
||||||
("t" "TODO" entry
|
|
||||||
(file+headline "~/org/inbox.org" "Tasks")
|
|
||||||
"** TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n")
|
|
||||||
("j" "Journal" entry
|
|
||||||
(file+olp+datetree "~/org/log.org.gpg")
|
|
||||||
"**** %U %?\n")
|
|
||||||
("b" "Bookmark" entry
|
|
||||||
(file+headline "~/org/bookmarks.org" "bookmarks-inbox")
|
|
||||||
"** TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n[[%x]]\n")))
|
|
||||||
|
|
||||||
;; TODO: roam config
|
|
||||||
|
|
||||||
(provide 'oxa/org)
|
|
|
@ -1,15 +0,0 @@
|
||||||
;; straight.el bootstrap
|
|
||||||
(defvar bootstrap-version)
|
|
||||||
(let ((bootstrap-file
|
|
||||||
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
|
|
||||||
(bootstrap-version 6))
|
|
||||||
(unless (file-exists-p bootstrap-file)
|
|
||||||
(with-current-buffer
|
|
||||||
(url-retrieve-synchronously
|
|
||||||
"https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
|
|
||||||
'silent 'inhibit-cookies)
|
|
||||||
(goto-char (point-max))
|
|
||||||
(eval-print-last-sexp)))
|
|
||||||
(load bootstrap-file nil 'nomessage))
|
|
||||||
|
|
||||||
(provide 'oxa/package-mgmt)
|
|
|
@ -1,58 +0,0 @@
|
||||||
;;; basic interface stuff
|
|
||||||
(menu-bar-mode 1)
|
|
||||||
(global-display-line-numbers-mode -1)
|
|
||||||
(column-number-mode 1)
|
|
||||||
(setq inhibit-startup-screen t)
|
|
||||||
(setq-default indicate-buffer-boundaries 'left)
|
|
||||||
(setq auto-save-default nil)
|
|
||||||
(setq visible-bell t)
|
|
||||||
;; (setq-default fill-column 80)
|
|
||||||
|
|
||||||
;; TODO Proper graphical setup
|
|
||||||
(add-hook 'after-make-frame-functions
|
|
||||||
#'(lambda (frame)
|
|
||||||
(toggle-scroll-bar -1)
|
|
||||||
(tool-bar-mode -1)))
|
|
||||||
|
|
||||||
;;; improvements to compilation buffer
|
|
||||||
(require 'compile)
|
|
||||||
(setq compilation-scroll-output t)
|
|
||||||
(require 'ansi-color)
|
|
||||||
(add-hook 'compilation-filter-hook 'ansi-color-compilation-filter)
|
|
||||||
|
|
||||||
;;; override default annoyances
|
|
||||||
;; I'm the only cowboy on this mainframe
|
|
||||||
;; (setq create-lockfiles nil)
|
|
||||||
;; X is dead
|
|
||||||
(setq inhibit-x-resources t)
|
|
||||||
;; use ibuffer instead of standard buffer list
|
|
||||||
(global-set-key (kbd "C-x C-b") 'ibuffer)
|
|
||||||
(fset 'yes-or-no-p 'y-or-n-p)
|
|
||||||
(setq confirm-nonexistent-file-or-buffer nil)
|
|
||||||
|
|
||||||
;; let's delete a tab as a whole...
|
|
||||||
(setq backward-delete-char-untabify-method 'nil)
|
|
||||||
;;; identation holywar contribution
|
|
||||||
(setq-default indent-tabs-mode 'nil)
|
|
||||||
|
|
||||||
;; highlight the parens
|
|
||||||
(setq show-paren-delay 0)
|
|
||||||
(show-paren-mode 1)
|
|
||||||
|
|
||||||
;; follow symlinks to version-controlled files
|
|
||||||
(setq vc-follow-symlinks t)
|
|
||||||
|
|
||||||
;; backup management
|
|
||||||
(setq backup-directory-alist `(("." . "~/.emacs.d/backups")))
|
|
||||||
(setq delete-old-versions t
|
|
||||||
kept-new-versions 6
|
|
||||||
kept-old-versions 2
|
|
||||||
version-control t)
|
|
||||||
|
|
||||||
;; default frame size
|
|
||||||
(add-to-list 'default-frame-alist '(height . 53))
|
|
||||||
(add-to-list 'default-frame-alist '(width . 107))
|
|
||||||
|
|
||||||
(pixel-scroll-precision-mode t)
|
|
||||||
|
|
||||||
(provide 'oxa/sane-defaults)
|
|
|
@ -1,5 +0,0 @@
|
||||||
;; Macro to simplify setting mode-local vars
|
|
||||||
(defmacro oxa/hook (hook-name &rest body)
|
|
||||||
`(add-hook ',hook-name #'(lambda nil ,@body)))
|
|
||||||
|
|
||||||
(provide 'oxa/utils)
|
|
322
lisp/packages.el
Normal file
322
lisp/packages.el
Normal file
|
@ -0,0 +1,322 @@
|
||||||
|
(use-package savehist
|
||||||
|
:config (savehist-mode))
|
||||||
|
|
||||||
|
(use-package orderless
|
||||||
|
:straight t
|
||||||
|
:config
|
||||||
|
(setq completion-styles '(orderless basic)
|
||||||
|
completion-category-defaults nil
|
||||||
|
completion-category-overrides '((file (styles partial-completion)))))
|
||||||
|
|
||||||
|
(use-package vertico
|
||||||
|
:straight t
|
||||||
|
:bind (:map vertico-map
|
||||||
|
("?" . minibuffer-completion-help)
|
||||||
|
("M-TAB" . minibuffer-complete))
|
||||||
|
:init
|
||||||
|
(setq enable-recursive-minibuffers t)
|
||||||
|
:config
|
||||||
|
(vertico-mode))
|
||||||
|
|
||||||
|
(use-package marginalia
|
||||||
|
:straight t
|
||||||
|
:bind (:map minibuffer-local-map
|
||||||
|
("M-A" . marginalia-cycle))
|
||||||
|
:config
|
||||||
|
(marginalia-mode))
|
||||||
|
|
||||||
|
(use-package consult
|
||||||
|
:straight t
|
||||||
|
:after (savehist orderless vertico marginalia)
|
||||||
|
:bind (;; global binds
|
||||||
|
("C-c M-x" . consult-mode-command)
|
||||||
|
("C-c h" . consult-history)
|
||||||
|
("C-c k" . consult-kmacro)
|
||||||
|
("C-c m" . consult-man)
|
||||||
|
("C-c i" . consult-info)
|
||||||
|
("M-y" . consult-yank-pop)
|
||||||
|
("C-x b" . consult-buffer) ;; orig. switch-to-buffer
|
||||||
|
("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command
|
||||||
|
("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window
|
||||||
|
("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame
|
||||||
|
("C-x r b" . consult-bookmark) ;; orig. bookmark-jump
|
||||||
|
("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer
|
||||||
|
;; goto-map
|
||||||
|
("M-g e" . consult-compile-error)
|
||||||
|
("M-g f" . consult-flymake) ;; Alternative: consult-flycheck
|
||||||
|
("M-g g" . consult-goto-line) ;; orig. goto-line
|
||||||
|
("M-g M-g" . consult-goto-line) ;; orig. goto-line
|
||||||
|
("M-g o" . consult-outline) ;; Alternative: consult-org-heading
|
||||||
|
("M-g m" . consult-mark)
|
||||||
|
("M-g k" . consult-global-mark)
|
||||||
|
("M-g i" . consult-imenu)
|
||||||
|
("M-g I" . consult-imenu-multi)
|
||||||
|
;; search map
|
||||||
|
("M-s d" . consult-find)
|
||||||
|
("M-s D" . consult-locate)
|
||||||
|
("M-s g" . consult-grep)
|
||||||
|
("M-s G" . consult-git-grep)
|
||||||
|
("M-s r" . consult-ripgrep)
|
||||||
|
("M-s l" . consult-line)
|
||||||
|
("M-s L" . consult-line-multi)
|
||||||
|
("M-s k" . consult-keep-lines)
|
||||||
|
("M-s u" . consult-focus-lines)
|
||||||
|
:map minibuffer-local-map
|
||||||
|
("M-s" . consult-history)
|
||||||
|
("M-r" . consult-history))
|
||||||
|
:config
|
||||||
|
(setq consult-narrow-key "<"))
|
||||||
|
|
||||||
|
(use-package org
|
||||||
|
:straight t
|
||||||
|
:bind (("C-c a" . org-agenda)
|
||||||
|
("C-c c" . org-capture)
|
||||||
|
("C-c l" . org-store-link)
|
||||||
|
:map org-mode-map
|
||||||
|
("C-c 1" . org-time-stamp-inactive))
|
||||||
|
:config
|
||||||
|
;; autosave advises for agenda and org-capture
|
||||||
|
(advice-add 'org-agenda-quit :before 'org-save-all-org-buffers)
|
||||||
|
(advice-add 'org-capture-finalize :after 'org-save-all-org-buffers)
|
||||||
|
(advice-add 'org-capture-refile :after 'org-save-all-org-buffers)
|
||||||
|
|
||||||
|
;; latex preview settings
|
||||||
|
(setq org-preview-latex-image-directory "~/.emacs.d/org-latex-preview/") ; Hide all previews in one place
|
||||||
|
|
||||||
|
;; habits support
|
||||||
|
(require 'org-habit)
|
||||||
|
(add-to-list 'org-modules 'org-habit)
|
||||||
|
|
||||||
|
;; babel
|
||||||
|
(org-babel-do-load-languages
|
||||||
|
'org-babel-load-languages
|
||||||
|
'((R . t)))
|
||||||
|
|
||||||
|
;; org-id - link by UUID
|
||||||
|
(require 'org-id)
|
||||||
|
(setq org-id-method 'uuid
|
||||||
|
org-id-link-to-org-use-id t)
|
||||||
|
;; abbrev expansion in org-mode
|
||||||
|
(require 'org-tempo)
|
||||||
|
|
||||||
|
;; we need indentation
|
||||||
|
(setq org-startup-indented nil
|
||||||
|
org-indent-mode-turns-on-hiding-stars nil
|
||||||
|
org-hide-leading-stars nil
|
||||||
|
org-startup-folded 'content)
|
||||||
|
;; default agenda files
|
||||||
|
(setq org-agenda-files '("~/org/"))
|
||||||
|
|
||||||
|
;; default agenda view
|
||||||
|
(setq org-agenda-start-day "-3d"
|
||||||
|
org-agenda-span 13)
|
||||||
|
;; templates
|
||||||
|
(setq org-capture-templates
|
||||||
|
'(("n" "note" entry
|
||||||
|
(file+headline "~/org/inbox.org" "Notes")
|
||||||
|
"** %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n")
|
||||||
|
("t" "TODO" entry
|
||||||
|
(file+headline "~/org/inbox.org" "Tasks")
|
||||||
|
"** TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n")
|
||||||
|
("j" "Journal" entry
|
||||||
|
(file+olp+datetree "~/org/log.org.gpg")
|
||||||
|
"**** %U %?\n")
|
||||||
|
("b" "Bookmark" entry
|
||||||
|
(file+headline "~/org/bookmarks.org" "bookmarks-inbox")
|
||||||
|
"** TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n[[%x]]\n"))))
|
||||||
|
|
||||||
|
(use-package tex-site
|
||||||
|
:straight auctex
|
||||||
|
:hook ((LaTeX-mode . TeX-PDF-mode)
|
||||||
|
(LaTeX-mode . reftex-mode)
|
||||||
|
(LaTeX-mode . LaTeX-math-mode))
|
||||||
|
:config
|
||||||
|
(require 'auctex)
|
||||||
|
(setq TeX-parse-self t)
|
||||||
|
(setq reftex-plug-into-AUCTeX t))
|
||||||
|
|
||||||
|
(use-package mu4e
|
||||||
|
:straight t
|
||||||
|
:commands mu4e
|
||||||
|
:config
|
||||||
|
(setq mu4e-change-filenames-when-moving t)
|
||||||
|
(setq mu4e-maildir "~/mail")
|
||||||
|
(setq mu4e-update-interval (* 11 60))
|
||||||
|
(setq mu4e-contexts
|
||||||
|
(list
|
||||||
|
(make-mu4e-context
|
||||||
|
:name "oxapentane.com"
|
||||||
|
:match-func (lambda (msg)
|
||||||
|
(when msg
|
||||||
|
(string-prefix-p "/grigory@shipunov.xyz" (mu4e-message-field msg :maildir))))
|
||||||
|
:vars '((user-mail-address . "grigory@shipunov.xyz")
|
||||||
|
(user-full-name . "Grisha Shipunov")
|
||||||
|
(mu4e-drafts-folder . "/grigory@shipunov.xyz/Drafts")
|
||||||
|
(mu4e-sent-folder . "/grigory@shipunov.xyz/Sent")
|
||||||
|
(mu4e-trash-folder . "/grigory@shipunov.xyz/Trash")
|
||||||
|
(mu4e-refile-folder . "/grigory@shipunov.xyz/Archive")
|
||||||
|
(mu4e-maildir-shortcuts . (("/grigory@shipunov.xyz/INBOX" . "?i")
|
||||||
|
("/grigory@shipunov.xyz/Drafts" . "?d")
|
||||||
|
("/grigory@shipunov.xyz/Sent" . "?s")))))
|
||||||
|
(make-mu4e-context
|
||||||
|
:name "oxapentane.com"
|
||||||
|
:match-func (lambda (msg)
|
||||||
|
(when msg
|
||||||
|
(string-prefix-p "/mail@oxapentane.com" (mu4e-message-field msg :maildir))))
|
||||||
|
:vars '((user-mail-address . "mail@oxapentane.com")
|
||||||
|
(user-full-name . "Grisha Shipunov")
|
||||||
|
(mu4e-drafts-folder . "/mail@oxapentane.com/Drafts")
|
||||||
|
(mu4e-sent-folder . "/mail@oxapentane.com/Sent")
|
||||||
|
(mu4e-trash-folder . "/mail@oxapentane.com/Trash")
|
||||||
|
(mu4e-refile-folder . "/mail@oxapentane.com/Archive")
|
||||||
|
(mu4e-maildir-shortcuts . (("/mail@oxapentane.com/INBOX" . "?i")
|
||||||
|
("/mail@oxapentane.com/Drafts" . "?d")
|
||||||
|
("/mail@oxapentane.com/Sent" . "?s")
|
||||||
|
("/mail@oxapentane.com/sinkhole" . "?S"))))))))
|
||||||
|
|
||||||
|
|
||||||
|
(use-package modus-themes
|
||||||
|
:straight t
|
||||||
|
:demand t
|
||||||
|
:init
|
||||||
|
(setq modus-themes-italic-constructs t
|
||||||
|
modus-themes-bold-constructs t)
|
||||||
|
:config
|
||||||
|
(load-theme 'modus-operandi 1)
|
||||||
|
(setq-default indicate-empty-lines t)
|
||||||
|
(setq-default show-trailing-whitespace t)
|
||||||
|
(add-hook 'prog-mode-hook #'(lambda () (whitespace-mode t)))
|
||||||
|
|
||||||
|
(if (eq system-type 'gnu/linux)
|
||||||
|
(progn
|
||||||
|
;; match system theme
|
||||||
|
;; https://freerangebits.com/posts/2025/02/emacs-light-dark/
|
||||||
|
(defvar oxa:dark-theme 'modus-vivendi)
|
||||||
|
(defvar oxa:light-theme 'modus-operandi)
|
||||||
|
(defun oxa:theme-from-dbus (value)
|
||||||
|
(load-theme (if (= 1 (car (flatten-list value)))
|
||||||
|
oxa:dark-theme
|
||||||
|
oxa:light-theme)
|
||||||
|
t))
|
||||||
|
|
||||||
|
(require 'dbus)
|
||||||
|
|
||||||
|
;; Set the current theme based on what the system theme is right now:
|
||||||
|
(dbus-call-method-asynchronously
|
||||||
|
:session "org.freedesktop.portal.Desktop"
|
||||||
|
"/org/freedesktop/portal/desktop"
|
||||||
|
"org.freedesktop.portal.Settings"
|
||||||
|
"Read"
|
||||||
|
#'oxa:theme-from-dbus
|
||||||
|
"org.freedesktop.appearance"
|
||||||
|
"color-scheme")
|
||||||
|
|
||||||
|
;; Register to be notified when the system theme changes:
|
||||||
|
(dbus-register-signal
|
||||||
|
:session "org.freedesktop.portal.Desktop"
|
||||||
|
"/org/freedesktop/portal/desktop"
|
||||||
|
"org.freedesktop.portal.Settings"
|
||||||
|
"SettingChanged"
|
||||||
|
(lambda (path var value)
|
||||||
|
(when (and (string-equal path "org.freedesktop.appearance")
|
||||||
|
(string-equal var "color-scheme"))
|
||||||
|
(oxa:theme-from-dbus value)))))))
|
||||||
|
|
||||||
|
(use-package expand-region
|
||||||
|
:straight t
|
||||||
|
:bind ("C-=" . er/expand-region))
|
||||||
|
|
||||||
|
(use-package move-text
|
||||||
|
:straight t
|
||||||
|
:bind (("M-n" . move-text-down)
|
||||||
|
("M-p" . move-text-up)))
|
||||||
|
|
||||||
|
(use-package direnv
|
||||||
|
:straight t
|
||||||
|
:config (direnv-mode 1))
|
||||||
|
|
||||||
|
(use-package magit
|
||||||
|
:straight t
|
||||||
|
:bind (("C-x g" . magit-status)
|
||||||
|
("C-x M-g" . magit-dispatch)
|
||||||
|
("C-c M-g" . magit-file-dispatch)))
|
||||||
|
|
||||||
|
(use-package dired-sidebar
|
||||||
|
:straight t
|
||||||
|
:bind (:oxamap
|
||||||
|
("t" . dired-sidebar-toggle-sidebar))
|
||||||
|
:config
|
||||||
|
(setq dired-sidebar-theme 'ascii))
|
||||||
|
|
||||||
|
(use-package nyan-mode
|
||||||
|
:straight t
|
||||||
|
:config
|
||||||
|
(setq nyan-animate-nyancat t
|
||||||
|
nyan-wavy-trail t)
|
||||||
|
(nyan-mode 1))
|
||||||
|
|
||||||
|
(use-package company-mode
|
||||||
|
:straight t
|
||||||
|
:config
|
||||||
|
(global-company-mode))
|
||||||
|
|
||||||
|
;; language support
|
||||||
|
|
||||||
|
(use-package nix-mode
|
||||||
|
:straight t
|
||||||
|
:init (setq nix-nixfmt-bin "nixpkgs-fmt"))
|
||||||
|
|
||||||
|
(use-package markdown-mode
|
||||||
|
:straight t)
|
||||||
|
|
||||||
|
(use-package yaml-mode
|
||||||
|
:straight t)
|
||||||
|
|
||||||
|
(use-package rust-mode
|
||||||
|
:straight t)
|
||||||
|
|
||||||
|
(use-package ess
|
||||||
|
:straight t)
|
||||||
|
|
||||||
|
(use-package cc-mode
|
||||||
|
:config
|
||||||
|
;;; Copypasta of llvm/utils/emacs/emacs.el
|
||||||
|
;; LLVM coding style guidelines in emacs
|
||||||
|
;; Maintainer: LLVM Team, http://llvm.org/
|
||||||
|
(defun llvm-lineup-statement (langelem)
|
||||||
|
(let ((in-assign (c-lineup-assignments langelem)))
|
||||||
|
(if (not in-assign)
|
||||||
|
'++
|
||||||
|
(aset in-assign 0
|
||||||
|
(+ (aref in-assign 0)
|
||||||
|
(* 2 c-basic-offset)))
|
||||||
|
in-assign)))
|
||||||
|
|
||||||
|
;; Add a cc-mode style for editing LLVM C and C++ code
|
||||||
|
(c-add-style "llvm.org"
|
||||||
|
'("gnu"
|
||||||
|
(fill-column . 80)
|
||||||
|
(c++-indent-level . 2)
|
||||||
|
(c-basic-offset . 2)
|
||||||
|
(indent-tabs-mode . nil)
|
||||||
|
(c-offsets-alist . ((arglist-intro . ++)
|
||||||
|
(innamespace . 0)
|
||||||
|
(member-init-intro . ++)
|
||||||
|
(statement-cont . llvm-lineup-statement)))))
|
||||||
|
|
||||||
|
;; Files with "llvm" in their names will automatically be set to the
|
||||||
|
;; llvm.org coding style.
|
||||||
|
(add-hook 'c-mode-common-hook
|
||||||
|
(function
|
||||||
|
(lambda nil
|
||||||
|
(if (string-match "llvm" buffer-file-name)
|
||||||
|
(progn
|
||||||
|
(c-set-style "llvm.org"))))))
|
||||||
|
|
||||||
|
(setq c-default-style '((java-mode . "java")
|
||||||
|
(awk-mode . "awk")
|
||||||
|
(c-mode . "linux")
|
||||||
|
(c++-mode . "llvm.org")
|
||||||
|
(other . "stroustrup"))))
|
||||||
|
|
||||||
|
(provide 'packages)
|
Loading…
Add table
Add a link
Reference in a new issue