summaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorTCCQ <thomasmulmer02@gmail.com>2025-08-15 11:06:05 -0700
committerTCCQ <thomasmulmer02@gmail.com>2025-08-15 11:07:51 -0700
commit10928e00b8627c79f64429328dd257530c2cca67 (patch)
treefc632115474e87b4fe0e0874f6cc5f22f39d1d9d /emacs
parentc104fbdd9a7d9ba3a4f55a114c2ba45c62eef11b (diff)
hs and activate mark on M-"
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/emacs/init.el b/emacs/init.el
index a858583..a7a1626 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -43,6 +43,7 @@
"Do setup in for mode buffers."
(superword-mode 1)
(modify-syntax-entry ?_ "w")
+ (hs-minor-mode 1)
(display-fill-column-indicator-mode 1)
(add-hook 'before-save-hook
(lambda ()
@@ -139,6 +140,14 @@ dedicated."
(with-selected-window cw
(switch-to-buffer ob)))))))
+(defun my/activate-mark ()
+ "Activate the region a la `C-SPC C-SPC', but don't move the point.
+Useful in combination with `query-replace' for acting on the region."
+ (interactive)
+ (if (region-active-p)
+ (deactivate-mark)
+ (activate-mark)))
+
(defun my/c-x-n-to-m-n (&optional keymap)
"Rebind the keys starting with C-x [number] to M-[number] in the
given keymap or in the global keymap."
@@ -917,6 +926,7 @@ changes."
(global-set-key (kbd "M-U") 'scroll-lock-mode)
(global-set-key (kbd "M-Q") 'auto-fill-mode)
(global-set-key (kbd "C-c r") 'raise-sexp)
+(global-set-key (kbd "M-\"") 'my/activate-mark)
(global-set-key (kbd "C-x w o") 'my/toggle-window-other-reachability)
(advice-add 'mode-line-window-control :around