diff --git a/modules/config/default/autoload/evil.el b/modules/config/default/autoload/evil.el deleted file mode 100644 index 8d5a1d54a..000000000 --- a/modules/config/default/autoload/evil.el +++ /dev/null @@ -1,38 +0,0 @@ -;; config/default/autoload/evil.el -*- lexical-binding: t; -*- -;;;###if (featurep! :feature evil) - -;;;###autoload (autoload '+default:multi-next-line "config/default/autoload/evil" nil t) -(evil-define-motion +default:multi-next-line (count) - "Move down 6 lines." - :type line - (let ((line-move-visual (or visual-line-mode (derived-mode-p 'text-mode 'magit-mode)))) - (evil-line-move (* 6 (or count 1))))) - -;;;###autoload (autoload '+default:multi-previous-line "config/default/autoload/evil" nil t) -(evil-define-motion +default:multi-previous-line (count) - "Move up 6 lines." - :type line - (let ((line-move-visual (or visual-line-mode (derived-mode-p 'text-mode 'magit-mode)))) - (evil-line-move (- (* 6 (or count 1)))))) - -;;;###autoload (autoload '+default:cd "config/default/autoload/evil" nil t) -(evil-define-command +default:cd (path) - "Change `default-directory' with `cd'." - (interactive "") - (cd path) - (message "Changed directory to '%s'" (abbreviate-file-name (expand-file-name path)))) - -;;;###autoload (autoload '+default:kill-all-buffers "config/default/autoload/evil" nil t) -(evil-define-command +default:kill-all-buffers (&optional bang) - "Kill all buffers. If BANG, kill current session too." - (interactive "") - (if bang - (+workspace/kill-session) - (doom/kill-all-buffers))) - -;;;###autoload (autoload '+default:kill-matching-buffers "config/default/autoload/evil" nil t) -(evil-define-command +default:kill-matching-buffers (&optional bang pattern) - "Kill all buffers matching PATTERN regexp. If BANG, only match project -buffers." - (interactive "") - (doom/kill-matching-buffers pattern bang)) diff --git a/modules/feature/evil/+commands.el b/modules/feature/evil/+commands.el index 017171807..bb6f6a17a 100644 --- a/modules/feature/evil/+commands.el +++ b/modules/feature/evil/+commands.el @@ -42,6 +42,26 @@ This command understands vim file modifiers (like %:p:h). See (interactive "") (reverse-region beg end)) +(evil-define-command +evil:cd (&optional path) + "Change `default-directory' with `cd'." + (interactive "") + (let ((path (or path "~"))) + (cd path) + (message "Changed directory to '%s'" (abbreviate-file-name (expand-file-name path))))) + +(evil-define-command +evil:kill-all-buffers (&optional bang) + "Kill all buffers. If BANG, kill current session too." + (interactive "") + (if (and bang (fboundp '+workspace/kill-session)) + (+workspace/kill-session) + (doom/kill-all-buffers))) + +(evil-define-command +evil:kill-matching-buffers (&optional bang pattern) + "Kill all buffers matching PATTERN regexp. If BANG, only match project +buffers." + (interactive "") + (doom/kill-matching-buffers pattern bang)) + ;; ;; Commands @@ -91,8 +111,8 @@ This command understands vim file modifiers (like %:p:h). See ;;; Dealing with buffers (evil-ex-define-cmd "k[ill]" #'doom/kill-this-buffer) -(evil-ex-define-cmd "k[ill]all" #'+default:kill-all-buffers) -(evil-ex-define-cmd "k[ill]m" #'+default:kill-matching-buffers) +(evil-ex-define-cmd "k[ill]all" #'+evil:kill-all-buffers) +(evil-ex-define-cmd "k[ill]m" #'+evil:kill-matching-buffers) (evil-ex-define-cmd "k[ill]o" #'doom/kill-other-buffers) (evil-ex-define-cmd "l[ast]" #'doom/popup-restore) (evil-ex-define-cmd "m[sg]" #'view-echo-area-messages) @@ -100,7 +120,7 @@ This command understands vim file modifiers (like %:p:h). See ;;; Project navigation (evil-ex-define-cmd "a" #'projectile-find-other-file) -(evil-ex-define-cmd "cd" #'+default:cd) +(evil-ex-define-cmd "cd" #'+evil:cd) (evil-ex-define-cmd "pwd" #'+evil:pwd) (cond ((featurep! :completion ivy)