summaryrefslogtreecommitdiff
path: root/.config/emacs/modules
diff options
context:
space:
mode:
Diffstat (limited to '.config/emacs/modules')
-rw-r--r--.config/emacs/modules/mm-completion.el44
-rw-r--r--.config/emacs/modules/mm-dired.el9
-rw-r--r--.config/emacs/modules/mm-editing.el78
-rw-r--r--.config/emacs/modules/mm-keybindings.el4
-rw-r--r--.config/emacs/modules/mm-modeline.el2
-rw-r--r--.config/emacs/modules/mm-projects.el23
-rw-r--r--.config/emacs/modules/mm-theme.el12
-rw-r--r--.config/emacs/modules/mm-window.el72
8 files changed, 178 insertions, 66 deletions
diff --git a/.config/emacs/modules/mm-completion.el b/.config/emacs/modules/mm-completion.el
index 85763b7..79da064 100644
--- a/.config/emacs/modules/mm-completion.el
+++ b/.config/emacs/modules/mm-completion.el
@@ -87,23 +87,26 @@
;;; Completion Popups
-(use-package corfu
- :ensure t
- :hook prog-mode
- :bind ( :map corfu-map
- ("C-<return>" . newline))
- :custom
- (corfu-auto t)
- (corfu-cycle t)
- (corfu-auto-prefix 1)
- (corfu-auto-delay .1)
- (corfu-min-width 20)
- :config
- ;; I complete with RET and this interferes with ‘tempel-next’
- (keymap-unset corfu-map "TAB" :remove)
- (with-eval-after-load 'savehist
- (corfu-history-mode)
- (add-to-list 'savehist-additional-variables 'corfu-history)))
+(mm-comment
+ (use-package corfu
+ :ensure t
+ :hook prog-mode
+ :bind ( :map corfu-map
+ ("C-<return>" . newline))
+ :custom
+ (corfu-auto t)
+ (corfu-cycle t)
+ (corfu-auto-prefix 1)
+ (corfu-auto-delay .1)
+ (corfu-min-width 20)
+ :config
+ ;; I complete with RET and this interferes with ‘tempel-next’
+ (keymap-unset corfu-map "TAB" :remove)
+ (with-eval-after-load 'savehist
+ (corfu-history-mode)
+ (add-to-list 'savehist-additional-variables 'corfu-history))
+ (with-eval-after-load 'multiple-cursors
+ (add-to-list 'mc/unsupported-minor-modes #'corfu-mode))))
;;; Save Minibuffer History
@@ -138,12 +141,7 @@
" -path '*/.git*' -prune"
" -or -path '*/vendor/*' -prune"
")")
- " "))
- :config
- (with-eval-after-load 'pulsar
- (setopt consult-after-jump-hook nil)
- (dolist (command #'(pulsar-recenter-top pulsar-reveal-entry))
- (add-hook 'consult-after-jump-hook command))))
+ " ")))
;;; Dynamic Abbreviations
diff --git a/.config/emacs/modules/mm-dired.el b/.config/emacs/modules/mm-dired.el
index 10db837..9e78466 100644
--- a/.config/emacs/modules/mm-dired.el
+++ b/.config/emacs/modules/mm-dired.el
@@ -6,10 +6,19 @@
:bind ( :map dired-mode-map
("f" . find-file))
:custom
+ (dired-auto-revert-buffer #'dired-directory-changed-p)
+ (dired-dwim-target t)
+ (dired-free-space nil)
(dired-recursive-copies 'always)
(dired-recursive-deletes 'always)
(dired-listing-switches
(combine-and-quote-strings
'("-AFGhlv" "--group-directories-first" "--time-style=+%d %b %Y %T"))))
+(use-package dired-aux
+ :custom
+ (dired-create-destination-dirs 'ask)
+ (dired-create-destination-dirs-on-trailing-dirsep t)
+ (dired-isearch-filenames 'dwim))
+
(provide 'mm-dired) \ No newline at end of file
diff --git a/.config/emacs/modules/mm-editing.el b/.config/emacs/modules/mm-editing.el
index 50a31c9..911a2a0 100644
--- a/.config/emacs/modules/mm-editing.el
+++ b/.config/emacs/modules/mm-editing.el
@@ -30,12 +30,13 @@
;;; Recenter The Screen When Jumping
-(dolist (command #'(backward-page
- backward-paragraph
- forward-page
- forward-paragraph
- pop-global-mark))
- (advice-add command :around #'mm-do-and-center))
+(mm-comment
+ (dolist (command #'(backward-page
+ backward-paragraph
+ forward-page
+ forward-paragraph
+ pop-global-mark))
+ (advice-add command :around #'mm-do-and-center)))
;;; Indentation Settings
@@ -150,7 +151,6 @@ region are marked, otherwise all matches in the buffer are marked."
(or (use-region-end) (point-max))
(read-string
(format-prompt ,(concat "Match " noun) nil))))
- (require 'multiple-cursors)
(if (string-empty-p ,noun-symbol)
(message "Command aborted")
(catch 'mm--no-match
@@ -177,45 +177,49 @@ region are marked, otherwise all matches in the buffer are marked."
(mm--define-mc-marking-command
mm-mark-all-in-region-regexp re-search-forward "regexp")
-(defun mm-silent-mc-load (args)
- "Advice to `load' to force it to be silent. The `multiple-cursors'
-package loads an `.mc-lists.el' file without passing `:nomessage' which
-causes messages to be sent in the minibuffer and *Messages* buffer. This
-forces that to not happen."
- (when (and (boundp 'mc/list-file)
- (string= (car args) mc/list-file))
- (pcase (length args)
- (1 (setq args (list (car args) nil :nomessage)))
- (2 (add-to-list 'args :nomessage :append))
- (_ (setf (caddr args) :nomessage)))
- (advice-remove #'load #'mm-silent-mc-load))
- args)
+(mm-comment
+ (defun mm-silent-mc-load (args)
+ "Advice to `load' to force it to be silent.
+The `multiple-cursors' package loads an `.mc-lists.el' file without
+passing `:nomessage' which causes messages to be sent in the minibuffer
+and *Messages* buffer. This forces that to not happen."
+ (when (and (boundp 'mc/list-file)
+ (string= (file-truename (car args))
+ (file-truename mc/list-file)))
+ (pcase (length args)
+ (1 (setq args (list (car args) nil :nomessage)))
+ (2 (add-to-list 'args :nomessage :append))
+ (_ (setf (caddr args) :nomessage)))
+ (advice-remove #'load #'mm-silent-mc-load))
+ args))
(use-package multiple-cursors
:ensure t
- :defer 2
:bind (("C->" . #'mc/mark-next-like-this)
("C-<" . #'mc/mark-previous-like-this)
("C-M-<" . #'mc/mark-all-like-this-dwim)
("C-M->" . #'mc/edit-lines)
- ("C-$" . #'mm-mark-all-in-region)
+ :map search-map
+ ("$" . #'mm-mark-all-in-region)
("M-$" . #'mm-mark-all-in-region-regexp))
+ :commands ( mm-mark-all-in-region mm-mark-all-in-region-regexp
+ mm-add-cursor-to-next-thing mm-transpose-cursor-regions)
:init
- (advice-add #'load :filter-args #'mm-silent-mc-load)
- (with-eval-after-load 'multiple-cursors-core
- (dolist (command #'(backward-delete-char
- capitalize-dwim
- delete-backward-char
- delete-forward-char
- downcase-dwim
- upcase-dwim))
- (add-to-list 'mc/cmds-to-run-for-all command))
- (dolist (command #'(helpful-callable
- helpful-key
- helpful-symbol
- helpful-variable))
- (add-to-list 'mc/cmds-to-run-once command))
- (add-to-list 'mc/unsupported-minor-modes #'corfu-mode))
+ (mm-comment
+ (advice-add #'load :filter-args #'mm-silent-mc-load)
+ (with-eval-after-load 'multiple-cursors-core
+ (dolist (command #'(backward-delete-char
+ capitalize-dwim
+ delete-backward-char
+ delete-forward-char
+ downcase-dwim
+ upcase-dwim))
+ (add-to-list 'mc/cmds-to-run-for-all command))
+ (dolist (command #'(helpful-callable
+ helpful-key
+ helpful-symbol
+ helpful-variable))
+ (add-to-list 'mc/cmds-to-run-once command))))
:config
(keymap-unset mc/keymap "<return>" :remove))
diff --git a/.config/emacs/modules/mm-keybindings.el b/.config/emacs/modules/mm-keybindings.el
index 42d2bfb..9917ab8 100644
--- a/.config/emacs/modules/mm-keybindings.el
+++ b/.config/emacs/modules/mm-keybindings.el
@@ -104,8 +104,8 @@ the first command is remapped to the second command."
;;; Bind Commands Globally
(mm-keymap-set global-map
- "<next>" #'e/scroll-up
- "<prior>" #'e/scroll-down
+ ;; "<next>" #'e/scroll-up
+ ;; "<prior>" #'e/scroll-down
"C-<next>" #'forward-page
"C-<prior>" #'backward-page
diff --git a/.config/emacs/modules/mm-modeline.el b/.config/emacs/modules/mm-modeline.el
index 88783c5..eaa852c 100644
--- a/.config/emacs/modules/mm-modeline.el
+++ b/.config/emacs/modules/mm-modeline.el
@@ -38,7 +38,7 @@
(propertize " (modified)" 'face 'mm-modeline-buffer-modified-face)))
(defconst mm-modeline-mode-acronyms
- '("css" "csv" "gsp" "html" "json" "mhtml" "scss" "toml" "tsv")
+ '("css" "csv" "gsp" "html" "json" "mhtml" "rfc" "scss" "toml" "tsv")
"List of acronyms in major mode names that should be capitalized.")
(defconst mm-modeline-remap-alist
diff --git a/.config/emacs/modules/mm-projects.el b/.config/emacs/modules/mm-projects.el
index 2ce88f7..f3a8710 100644
--- a/.config/emacs/modules/mm-projects.el
+++ b/.config/emacs/modules/mm-projects.el
@@ -35,6 +35,14 @@ This is intended to be called interactively via
(warn "The REPODIR environment variable is not set."))))
+;;; Emacs VC
+
+(use-package vc-hooks
+ :custom
+ (vc-follow-symlinks t)
+ (vc-handled-backends '(Git)))
+
+
;;; Git Client
(use-package magit
@@ -43,9 +51,13 @@ This is intended to be called interactively via
("[" . magit-section-backward-sibling)
("]" . magit-section-forward-sibling))
:custom
- (transient-default-level 7)
+ (git-commit-style-convention-checks
+ '(non-empty-second-line overlong-summary-line))
+ (git-commit-summary-max-length 50)
+ (magit-diff-refine-hunk t)
(magit-display-buffer-function
#'magit-display-buffer-same-window-except-diff-v1)
+ (transient-default-level 7)
:config
(transient-define-suffix mm-projects-magit-push-current-to-all-remotes (args)
"Push the current branch to all remotes."
@@ -60,6 +72,15 @@ This is intended to be called interactively via
(transient-append-suffix #'magit-push '(1 -1)
'("a" "all remotes" mm-projects-magit-push-current-to-all-remotes)))
+(use-package magit-repos
+ :ensure nil ; Part of ‘magit’
+ :if (not mm-darwin-p)
+ :commands (magit-list-repositories)
+ :init
+ (if-let ((directory (getenv "REPODIR")))
+ (setopt magit-repository-directories `((,directory . 2)))
+ (warn "The REPODIR environment variable is not set.")))
+
(use-package magit-todos
:ensure t
:after magit
diff --git a/.config/emacs/modules/mm-theme.el b/.config/emacs/modules/mm-theme.el
index 3e14fe2..90d4992 100644
--- a/.config/emacs/modules/mm-theme.el
+++ b/.config/emacs/modules/mm-theme.el
@@ -38,7 +38,7 @@ _FRAME is ignored."
(prop-height (plist-get prop-props :height)))
;; Some characters in this font are larger than usual
(when (string= mono-family "Iosevka Smooth")
- (dolist (rune '(?… ?— ?← ?→ ?⇐ ?⇒ ?⇔))
+ (dolist (rune '(?․ ?‥ ?… ?— ?← ?→ ?⇐ ?⇒ ?⇔))
(set-char-table-range char-width-table rune 2)))
(set-face-attribute 'default nil
:font mono-family
@@ -204,6 +204,14 @@ See also the `mm-theme-background-opacity' variable."
;;; More Intuiative UI for Certain Modes
(use-package line-selection-mode
- :hook ((bookmark-bmenu-mode dired-mode ibuffer-mode) . line-selection-mode))
+ :hook ((bookmark-bmenu-mode dired-mode ibuffer-mode magit-repolist-mode)
+ . line-selection-mode))
+
+
+;;; Line Highlighting
+
+(use-package hl-line
+ :custom
+ (hl-line-sticky-flag nil))
(provide 'mm-theme) \ No newline at end of file
diff --git a/.config/emacs/modules/mm-window.el b/.config/emacs/modules/mm-window.el
new file mode 100644
index 0000000..0ce77c7
--- /dev/null
+++ b/.config/emacs/modules/mm-window.el
@@ -0,0 +1,72 @@
+;;; mm-window.el --- Window configurations -*- lexical-binding: t; -*-
+
+
+;;; Unique Buffer Names
+
+(use-package uniquify
+ :custom
+ (uniquify-buffer-name-style 'forward))
+
+
+;;; Highlight Whitespace
+
+(use-package whitespace
+ :bind (("<f1>" . whitespace-mode)
+ ("C-c z" . delete-trailing-whitespace))
+ :custom
+ (whitespace-style
+ '( face trailing spaces tabs space-mark tab-mark empty indentation
+ space-after-tab space-before-tab))
+ (whitespace-display-mappings
+ '((space-mark 32 [?·] [?.]) ; Space
+ (space-mark 160 [?␣] [?_]) ; Non-Breaking Space
+ (tab-mark 9 [?» ?\t] [?> ?\t]))))
+
+
+;;; Line Numbers
+
+(use-package display-line-numbers
+ :bind ("<f2>" . display-line-numbers-mode)
+ :custom
+ (display-line-numbers-grow-only t)
+ (display-line-numbers-type 'relative)
+ (display-line-numbers-width-start 99))
+
+
+;;; Select Help Windows
+
+(use-package help
+ :custom
+ (help-window-select t))
+
+
+;;; Window Scrolling
+
+(use-package window
+ :custom
+ (scroll-conservatively 101) ; (info "(Emacs)Auto Scrolling")
+ (scroll-error-top-bottom t)
+ (scroll-margin 10)
+ :config
+ (setq-default truncate-partial-width-windows nil))
+
+
+;;; Smoother Scrolling
+
+(mm-comment
+ (use-package pixel-scroll
+ :init
+ (pixel-scroll-precision-mode)
+ :config
+ ;; Make it easier to use custom scroll functions
+ (dolist (binding '("<next>" "<prior>"))
+ (keymap-unset pixel-scroll-precision-mode-map binding :remove))))
+
+
+;;; Ace Window
+
+(use-package ace-window
+ :ensure t
+ :bind ("M-o" . ace-window))
+
+(provide 'mm-window) \ No newline at end of file