diff options
author | Marc Coquand <marc@mccd.space> | 2024-10-06 19:45:39 +0300 |
---|---|---|
committer | Marc Coquand <marc@mccd.space> | 2024-10-06 19:45:39 +0300 |
commit | 02b9ba765744064ba6a64e9c83ac3edda6665843 (patch) | |
tree | 10b1d48fb09c01a3a7a84c5ff65b2fd7e73907ec | |
parent | 3581bfbcd6d34fc6b6b153014440665fed139db4 (diff) | |
download | bsd-02b9ba765744064ba6a64e9c83ac3edda6665843.tar.gz bsd-02b9ba765744064ba6a64e9c83ac3edda6665843.tar.bz2 bsd-02b9ba765744064ba6a64e9c83ac3edda6665843.zip |
.
-rw-r--r-- | emacs | 138 | ||||
-rw-r--r-- | profile | 2 | ||||
-rwxr-xr-x | xinitrc | 2 |
3 files changed, 117 insertions, 25 deletions
@@ -13,14 +13,15 @@ (setq inhibit-startup-screen t line-spacing 0.2 - display-time-format "%a, %d/%m/%y %H:%M" + display-time-format "%a, %d/%m/%Y %H:%M" undo-limit 10000000 undo-outer-limit 20000000 ring-bell-function 'ignore) -(display-time) - - - +(display-time-mode) +(line-number-mode) +(column-number-mode) +(setq completion-cycle-threshold 5) +(setq-default fill-column 80) ;; Put Emacs auto-save and backup files to /tmp (defconst emacs-tmp-dir (expand-file-name (format "emacs%d" (user-uid)) temporary-file-directory)) @@ -43,6 +44,7 @@ almost-mono-themes markdown-mode yasnippet + avy yasnippet-snippets tldr elfeed @@ -71,6 +73,81 @@ (unless (package-installed-p package) (package-install package))) +;; Avy +(require 'avy) +(global-set-key (kbd "C-o") 'avy-goto-char-timer) + + +(setf (alist-get ? avy-dispatch-alist) 'avy-action-mark-to-char) +(define-key isearch-mode-map (kbd "M-o") 'avy-isearch) + +(defun avy-action-kill-whole-line (pt) + (save-excursion + (goto-char pt) + (kill-whole-line)) + (select-window + (cdr + (ring-ref avy-ring 0))) + t) + +(setf (alist-get ?k avy-dispatch-alist) 'avy-action-kill-stay + (alist-get ?K avy-dispatch-alist) 'avy-action-kill-whole-line) + + +(defun avy-action-copy-whole-line (pt) + (save-excursion + (goto-char pt) + (cl-destructuring-bind (start . end) + (bounds-of-thing-at-point 'line) + (copy-region-as-kill start end))) + (select-window + (cdr + (ring-ref avy-ring 0))) + t) + +(defun avy-action-yank-whole-line (pt) + (avy-action-copy-whole-line pt) + (save-excursion (yank)) + t) + +(setf (alist-get ?y avy-dispatch-alist) 'avy-action-yank + (alist-get ?w avy-dispatch-alist) 'avy-action-copy + (alist-get ?W avy-dispatch-alist) 'avy-action-copy-whole-line + (alist-get ?Y avy-dispatch-alist) 'avy-action-yank-whole-line) +(defun avy-action-copy-whole-line (pt) + (save-excursion + (goto-char pt) + (cl-destructuring-bind (start . end) + (bounds-of-thing-at-point 'line) + (copy-region-as-kill start end))) + (select-window + (cdr + (ring-ref avy-ring 0))) + t) + +(defun avy-action-yank-whole-line (pt) + (avy-action-copy-whole-line pt) + (save-excursion (yank)) + t) + +(setf (alist-get ?y avy-dispatch-alist) 'avy-action-yank + (alist-get ?w avy-dispatch-alist) 'avy-action-copy + (alist-get ?W avy-dispatch-alist) 'avy-action-copy-whole-line + (alist-get ?Y avy-dispatch-alist) 'avy-action-yank-whole-line) + +(defun avy-action-teleport-whole-line (pt) + (avy-action-kill-whole-line pt) + (save-excursion (yank)) t) + +(setf (alist-get ?t avy-dispatch-alist) 'avy-action-teleport + (alist-get ?T avy-dispatch-alist) 'avy-action-teleport-whole-line) + +(defun avy-action-mark-to-char (pt) + (activate-mark) + (goto-char pt)) + +(setf (alist-get ? avy-dispatch-alist) 'avy-action-mark-to-char) + ;; Expand Region (require 'expand-region) (global-set-key (kbd "C-.") 'er/expand-region) @@ -100,9 +177,6 @@ ;; IDO (ido-mode t) -;; Rmail -(setq rmail-primary-inbox-list '("maildir:///home/mccd/mail/home/INBOX")) -(setq rmail-preserve-inbox t) ;; Eglot (require 'eglot) @@ -187,19 +261,36 @@ (set-face-attribute 'org-block nil :inherit 'fixed-pitch) (set-face-attribute 'org-code nil :inherit 'fixed-pitch) (set-face-attribute 'org-table nil :inherit 'fixed-pitch) +(setq org-agenda-inhibit-startup t) + +(org-babel-do-load-languages +'org-babel-load-languages +'((shell . t))) + +;; Add /New Heading at the end for use +(setq org-refile-allow-creating-parent-nodes 'confirm) +(setq org-outline-path-complete-in-steps nil) +(setq org-refile-use-outline-path 'file) +;; Otherwise looks weird in variable-pitch-mode +(setq org-tags-column 0) (setq org-capture-templates '( ("t" "Todo" entry (file+headline "~/personal-db/todo.org" "Todo") - "* TODO %?\n%i\n%a\n:Created: %T\n " + "* TODO %?\n%i\n%a\n%T\n " :empty-lines 1) + ("l" "Log" entry (file+datetree "~/personal-db/notes/log.org") + "* %?\n%T\n" + :empty-lines 1) ("n" "Inbox" entry (file+headline "~/personal-db/notes/inbox.org" "Notes") - "** %?\n:Created: %T" + "** %?\n%T" :empty-lines 1))) ;; Magit +(require 'magit) +(require 'magit-extras) (global-set-key (kbd "C-c g") 'magit) ;; Yasnippet @@ -321,6 +412,11 @@ (elfeed-protocol-enable) (global-set-key (kbd "C-x w") 'elfeed) +;; Eww +(setq + browse-url-browser-function 'eww-browse-url ; Use eww as the default browser + shr-width 70 ; Fold text to 70 columns + ) (custom-set-faces ;; custom-set-faces was added by Custom. @@ -342,19 +438,20 @@ '(font-lock-variable-name-face ((t (:foreground "black")))) '(fringe ((t (:background "white")))) '(header-line ((t (:inherit nil :background "white" :foreground "grey20" :box (:line-width (8 . 8) :color "white") :underline (:color "gray80" :style line :position 0))))) - '(highlight ((t (:background "white smoke")))) + '(highlight ((t (:background "azure2")))) '(info-header-xref ((t (:inherit info-xref :underline (:color "RoyalBlue3" :style line :position t))))) '(info-node ((t (:foreground "brown" :box (:line-width (4 . 4) :color "white") :slant italic :weight bold)))) '(markdown-inline-code-face ((t (:inherit markdown-code-face)))) '(markdown-pre-face ((t (:inherit markdown-code-face)))) '(mastodon-display-name-face ((t (:inherit nil :weight bold)))) '(mode-line ((t (:inherit variable-pitch :background "white" :foreground "black" :box (:line-width (8 . 8) :style flat-button) :overline "gray80")))) - '(mode-line-inactive ((t (:inherit mode-line :background "grey90" :foreground "grey20" :underline (:color "black" :style line :position 0) :weight light)))) + '(mode-line-inactive ((t (:inherit mode-line :background "grey95" :foreground "grey20" :underline (:color "grey80" :style line :position 0) :weight light)))) '(mu4e-header-highlight-face ((t (:inherit hl-line :extend t :weight bold)))) '(mu4e-highlight-face ((t (:inherit highlight)))) - '(org-level-1 ((t (:inherit outline-1 :extend nil :weight bold)))) + '(org-level-1 ((t (:inherit outline-1 :extend nil :weight regular)))) '(org-time-grid ((t (:foreground "gray")))) - '(tab-bar ((t (:inherit variable-pitch :background "white" :foreground "gray20" :box (:line-width (8 . 8) :color "white" :style flat-button))))) + '(outline-4 ((t (:inherit outline-2)))) + '(tab-bar ((t (:inherit variable-pitch :background "white" :box (:line-width (8 . 8) :color "white" :style flat-button) :weight light)))) '(tldr-code-block ((t (:background "cornsilk" :foreground "black")))) '(tldr-command-argument ((t (:background "cornsilk" :foreground "black")))) '(tldr-command-itself ((t (:background "khaki" :foreground "black" :weight bold)))) @@ -375,23 +472,18 @@ '(mode-line-format '("%e" mode-line-front-space (:propertize - ("" mode-line-mule-info mode-line-client mode-line-modified mode-line-remote) - display - (min-width - (5.0))) - mode-line-frame-identification mode-line-buffer-identification " " mode-line-position - (vc-mode vc-mode) - " " mode-line-modes mode-line-end-spaces)) + ("" mode-line-modified " " mode-line-position)) + mode-line-buffer-identification)) '(mode-line-percent-position nil) '(mode-line-position-line-format '(" ")) '(mu4e-bookmarks '((:name "Last 7 days" :query "date:7d..now" :hide-unread t :key 119) (:name "Messages with images" :query "mime:image/*" :key 112))) '(org-agenda-files - '("/home/mccd/builds/sustainably/piva.org" "/home/mccd/builds/comma.directory/comma.org" "/home/mccd/personal-db/notes/frugal.org" "/home/mccd/personal-db/notes/inbox.org" "/home/mccd/personal-db/notes/emacs.org" "/home/mccd/personal-db/todo.org")) + '("~/personal-db/notes/carving-my-own-road.org" "/home/mccd/personal-db/notes/emacs-teaches.org" "/home/mccd/personal-db/notes/agency-and-tech.org" "/home/mccd/personal-db/notes/log.org" "/home/mccd/builds/sustainably/piva.org" "/home/mccd/builds/comma.directory/comma.org" "/home/mccd/personal-db/notes/frugal.org" "/home/mccd/personal-db/notes/inbox.org" "/home/mccd/personal-db/notes/emacs.org" "/home/mccd/personal-db/todo.org")) '(org-fold-core-style 'overlays) '(package-selected-packages - '(pdf-tools elfeed-protocol lem yasnippet-snippets elfeed yasnippet smartparens markdown-mode mastodon tldr almost-mono-themes rec-mode magit go-mode expand-region devdocs)) + '(avy pdf-tools elfeed-protocol lem yasnippet-snippets elfeed yasnippet smartparens markdown-mode mastodon tldr almost-mono-themes rec-mode magit go-mode expand-region devdocs)) '(tab-bar-format '(tab-bar-separator tab-bar-format-align-right tab-bar-format-global)) '(yank-from-kill-ring-rotate t)) @@ -3,7 +3,7 @@ PATH=${PATH}:/home/mccd/go/bin:/home/mccd/.cargo/bin:/home/mccd/.local/bin export PATH HOME TERM -export EDITOR="mg" +export EDITOR="mg -n" export GDK_DPI_SCALE="1.5" export GDK_SCALE="1.5" export XCURSOR_SIZE="32" @@ -4,7 +4,7 @@ xrdb -load ~/.Xresources & autocutsel & xsetroot -solid '#282C34' & ulimit -c 0 & -xclock -digital -geometry +5+1402 -face "Iosevka Aile:pixelsize=18:style=regular" -bg \#282C34 -fg \#B8BCC4 -strftime "Bogo (%Y/%m/%d) %H:%M" & +#xclock -digital -geometry +5+1402 -face "Iosevka Aile:pixelsize=18:style=regular" -bg \#282C34 -fg \#B8BCC4 -strftime "Bogo (%Y/%m/%d) %H:%M" & gsettings set org.gnome.desktop.interface document-font-name 'Iosevka Aile' & gsettings set org.gnome.desktop.interface font-name 'Iosevka Aile' & gsettings set org.gnome.desktop.interface cursor-size 32 & |