diff options
author | Case Duckworth | 2021-08-16 09:13:33 -0500 |
---|---|---|
committer | Case Duckworth | 2021-08-16 09:13:33 -0500 |
commit | e316ee75506a205663b5c54baf0c70b552e9437b (patch) | |
tree | 748a39d12267402aea584e05835c180d2c51b151 | |
parent | Change wc-idle-wait to 2 (diff) | |
parent | Add `acdw/set-mark-or-expand-region' function and binding (diff) | |
download | emacs-e316ee75506a205663b5c54baf0c70b552e9437b.tar.gz emacs-e316ee75506a205663b5c54baf0c70b552e9437b.zip |
Merge branch 'main' of tildegit.org:acdw/emacs
-rw-r--r-- | init.el | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/init.el b/init.el index 92ddf5f..532a1af 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") |