summary refs log tree commit diff stats
path: root/init.el
diff options
context:
space:
mode:
authorCase Duckworth2021-08-16 09:13:33 -0500
committerCase Duckworth2021-08-16 09:13:33 -0500
commite316ee75506a205663b5c54baf0c70b552e9437b (patch)
tree748a39d12267402aea584e05835c180d2c51b151 /init.el
parentChange wc-idle-wait to 2 (diff)
parentAdd `acdw/set-mark-or-expand-region' function and binding (diff)
downloademacs-e316ee75506a205663b5c54baf0c70b552e9437b.tar.gz
emacs-e316ee75506a205663b5c54baf0c70b552e9437b.zip
Merge branch 'main' of tildegit.org:acdw/emacs
Diffstat (limited to 'init.el')
-rw-r--r--init.el23
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.
1141See `set-mark-command' and `expand-region'.
1142
1143With no prefix argument, either run `set-mark-command' on first
1144invocation and `er/expand-region' on each successive invocation.
1145
1146With 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
1149successive 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")