diff options
-rw-r--r-- | init.el | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/init.el b/init.el index cbdec9a..d60915b 100644 --- a/init.el +++ b/init.el | |||
@@ -1135,7 +1135,28 @@ if ripgrep is installed, otherwise `consult-grep'." | |||
1135 | )) | 1135 | )) |
1136 | 1136 | ||
1137 | (setup (:straight expand-region) | 1137 | (setup (:straight expand-region) |
1138 | (:global "C-=" er/expand-region)) | 1138 | |
1139 | (defun acdw/set-mark-or-expand-region (arg) | ||
1140 | "Set mark at point and activate, jump to mark, or expand region. | ||
1141 | See `set-mark-command' and `expand-region'. | ||
1142 | |||
1143 | With no prefix argument, either run `set-mark-command' on first | ||
1144 | invocation and `er/expand-region' on each successive invocation. | ||
1145 | |||
1146 | With any prefix argument | ||
1147 | (e.g., \\[universal-argument] \\[set-mark-command]), act as with | ||
1148 | `set-mark-command' (i.e., pop the mark). Don't care about | ||
1149 | successive invocations." | ||
1150 | (interactive "P") | ||
1151 | (cond | ||
1152 | (arg | ||
1153 | (setq this-command 'set-mark-command) | ||
1154 | (set-mark-command arg)) | ||
1155 | ((eq last-command 'acdw/set-mark-or-expand-region) | ||
1156 | (er/expand-region 1)) | ||
1157 | (t (set-mark-command arg)))) | ||
1158 | |||
1159 | (:global "C-SPC" acdw/set-mark-or-expand-region)) | ||
1139 | 1160 | ||
1140 | (setup (:straight fennel-mode) | 1161 | (setup (:straight fennel-mode) |
1141 | (:needs "fennel") | 1162 | (:needs "fennel") |