updated multiple cursors; add move-text

This commit is contained in:
2026-01-11 08:08:10 -05:00
parent ada3ec0593
commit 741135b1b4
2 changed files with 23 additions and 17 deletions

36
init.el
View File

@@ -8,8 +8,9 @@
(require 'use-package-ensure)
(require 'bind-key)
; If startup times are slow
; (setq use-package-verbose t)
;; If startup times are slow
;; (setq use-package-verbose t)
;; (setq use-package-compute-statistics t)
(add-to-list 'load-path (concat (file-name-parent-directory user-init-file) "local-lisp/"))
@@ -110,6 +111,7 @@
(keymap-global-set "M-1" #'delete-other-windows)
(keymap-global-set "M-2" #'split-window-below)
(keymap-global-set "M-3" #'split-window-right)
(keymap-global-set "C-," #'duplicate-dwim)
(require 'dired)
(setq dired-dwim-target t)
@@ -283,21 +285,21 @@
(file-name-nondirectory (directory-file-name default-directory))
" rg*"))))
(defun hgh/set-cursor-type-box (&rest _args)
(setq-local cursor-type 'box))
(defun hgh/set-cursor-type-bar (&rest _args)
(setq-local cursor-type 'bar))
(use-package multiple-cursors
:hook ((multiple-cursors-mode-disabled . hgh/set-cursor-type-bar))
:bind (("C->" . mc/mark-next-like-this)
("C-<" . mc/mark-previous-like-this))
:init
(add-hook 'multiple-cursors-mode-enabled-hook
(lambda ()
(remove-hook 'activate-mark-hook 'hgh/disable-bar-cursor)
(remove-hook 'deactivate-mark-hook 'hgh/disable-bar-cursor)
(blink-cursor-mode 1)))
(add-hook 'multiple-cursors-mode-disabled-hook
(lambda ()
(add-hook 'activate-mark-hook 'hgh/disable-bar-cursor)
(add-hook 'deactivate-mark-hook 'hgh/disable-bar-cursor)
(blink-cursor-mode 1)))
:config
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this))
;; NOTE(grant): I have no idea if the package is deferred or autoloaded anymore
(advice-add 'mc/mark-next-like-this :before #'hgh/set-cursor-type-box)
(advice-add 'mc/mark-previous-like-this :before #'hgh/set-cursor-type-box))
(use-package yasnippet
:diminish
@@ -400,3 +402,7 @@
(codex-provider nil)
(codex-model nil)
:ensure nil)
(use-package move-text
:bind (("M-<up>" . move-text-up)
("M-<down>" . move-text-down)))