diff --git a/custom.el b/custom.el index d96e9f2..cd37bcc 100644 --- a/custom.el +++ b/custom.el @@ -9,8 +9,8 @@ dockerfile-mode dumb-jump dumber-jump emacs-lldb exec-path-from-shell flycheck fsharp-mode haskell-mode haskell-ts-mode helm htmlize idris-mode marginalia - markdown-ts-mode multiple-cursors odin-mode orderless - org-mode parinfer-rust-mode realgud-lldb rg sly + markdown-ts-mode move-text multiple-cursors odin-mode + orderless org-mode parinfer-rust-mode realgud-lldb rg sly terraform-mode tree-sitter-langs vertico visual-fill-column yasnippet-snippets zig-mode)) '(safe-local-variable-directories '("/Users/grant/programming/project/edit/")) diff --git a/init.el b/init.el index ada88c8..7bea641 100644 --- a/init.el +++ b/init.el @@ -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-" . move-text-up) + ("M-" . move-text-down)))