Replace evil-mode with meow
This commit is contained in:
parent
7a6a0eb0c0
commit
fb7e316bb6
311
init.el
311
init.el
|
@ -30,157 +30,106 @@
|
|||
:config
|
||||
(auto-package-update-at-time "05:00"))
|
||||
|
||||
(use-package undo-tree
|
||||
:hook (evil-local-mode . turn-on-undo-tree-mode))
|
||||
|
||||
(use-package evil
|
||||
(use-package undo-fu
|
||||
:demand t
|
||||
:custom
|
||||
(select-enable-clipboard nil "Disable automatic clipboard=unnamedplus")
|
||||
(evil-want-keybinding nil "Necessary for evil-collection")
|
||||
(evil-want-Y-yank-to-eol t "Make Y behave like it should")
|
||||
(evil-want-C-u-scroll t "Scroll with C-u")
|
||||
(evil-want-C-h-delete t "Delete with C-h")
|
||||
(evil-want-C-w-in-emacs-state t "Allow C-w movement in Emacs windows")
|
||||
(evil-undo-system 'undo-tree "Undo with undo-tree")
|
||||
:config
|
||||
(evil-mode)
|
||||
(evil-select-search-module 'evil-search-module 'evil-search)
|
||||
(defadvice evil-force-normal-state (after evil-search-remove-hl activate)
|
||||
(evil-ex-nohighlight))
|
||||
(evil-global-set-key 'insert (kbd "C-S-h") #'help-command))
|
||||
(global-unset-key (kbd "C-z"))
|
||||
(global-set-key (kbd "C-z") #'undo-fu-only-undo)
|
||||
(global-set-key (kbd "C-S-z") #'undo-fu-only-redo))
|
||||
|
||||
(use-package evil-collection
|
||||
(defun my-meow-undo (arg)
|
||||
"Same as meow-undo, but uses undo-fu to redo if negative prefix"
|
||||
(interactive "P")
|
||||
(when (region-active-p)
|
||||
(meow--cancel-selection))
|
||||
(let ((numeric-prefix (prefix-numeric-value arg)))
|
||||
(if (meow--with-negative-argument-p arg)
|
||||
(undo-fu-only-redo (abs numeric-prefix))
|
||||
(undo-fu-only-undo numeric-prefix))))
|
||||
(use-package meow
|
||||
:demand t
|
||||
:after evil
|
||||
:custom
|
||||
(evil-collection-setup-minibuffer t)
|
||||
:config
|
||||
(evil-collection-init))
|
||||
|
||||
(use-package evil-leader
|
||||
:demand t
|
||||
:after evil
|
||||
:config
|
||||
(evil-leader/set-leader "<SPC>")
|
||||
(evil-leader/set-key
|
||||
"u" #'universal-argument
|
||||
"bb" #'switch-to-buffer
|
||||
"bd" #'evil-delete-buffer
|
||||
"fd" #'dirvish-dwim
|
||||
"fq" #'dirvish-quit
|
||||
"ff" #'find-file
|
||||
"fm" #'bookmark-set
|
||||
"ft" #'treemacs
|
||||
"fs" #'evil-write
|
||||
"fu" #'my-sudo-edit
|
||||
"f'" #'bookmark-jump
|
||||
"gg" #'magit-status
|
||||
"mm" #'minimap-mode
|
||||
"ps" (lambda ()
|
||||
(interactive)
|
||||
(package-refresh-contents)
|
||||
(auto-package-update-now-async))
|
||||
"qq" #'evil-quit
|
||||
"qk" #'kill-emacs
|
||||
"tt" #'vterm
|
||||
"to" #'vterm-other-window)
|
||||
(global-evil-leader-mode))
|
||||
|
||||
(use-package evil-surround
|
||||
:demand t
|
||||
:after evil
|
||||
:config
|
||||
(global-evil-surround-mode))
|
||||
|
||||
(use-package evil-commentary
|
||||
:demand t
|
||||
:after evil
|
||||
:config
|
||||
(evil-commentary-mode))
|
||||
|
||||
(use-package evil-numbers
|
||||
:demand t
|
||||
:after evil
|
||||
:config
|
||||
(evil-define-key '(normal visual) 'global "g+" #'evil-numbers/inc-at-pt)
|
||||
(evil-define-key '(normal visual) 'global "g-" #'evil-numbers/dec-at-pt)
|
||||
(evil-define-key '(normal visual) 'global "g=+" #'evil-numbers/inc-at-pt-incremental)
|
||||
(evil-define-key '(normal visual) 'global "g=-" #'evil-numbers/inc-at-pt-incremental))
|
||||
|
||||
(use-package evil-replace-with-register
|
||||
:demand t
|
||||
:after evil
|
||||
:custom
|
||||
(evil-replace-with-register-indent t)
|
||||
:config
|
||||
(evil-replace-with-register-install))
|
||||
|
||||
(use-package evil-org
|
||||
:after evil
|
||||
:hook org-mode
|
||||
:config
|
||||
(require 'evil-org-agenda)
|
||||
(evil-org-agenda-set-keys))
|
||||
|
||||
(use-package evil-goggles
|
||||
:demand t
|
||||
:after evil
|
||||
:custom
|
||||
(evil-goggles-duration 0.12 "Decrease the duration a tiny bit")
|
||||
(evil-goggles-pulse t)
|
||||
:config
|
||||
(evil-goggles-use-diff-faces)
|
||||
(evil-goggles-mode))
|
||||
|
||||
(use-package evil-terminal-cursor-changer)
|
||||
|
||||
(use-package hydra
|
||||
:config
|
||||
(defhydra hydra-evil-c-w (evil-normal-state-map "C-w")
|
||||
"C-w"
|
||||
("h" #'evil-window-left "left")
|
||||
("j" #'evil-window-down "down")
|
||||
("k" #'evil-window-up "up")
|
||||
("l" #'evil-window-right "right")
|
||||
("C-w" #'evil-window-next "next")
|
||||
("+" #'evil-window-increase-height "+height")
|
||||
("-" #'evil-window-decrease-height "-height")
|
||||
(">" #'evil-window-increase-width "+width")
|
||||
("<" #'evil-window-decrease-width "-width")))
|
||||
|
||||
(use-package lispy)
|
||||
|
||||
(use-package lispyville
|
||||
:hook (emacs-lisp-mode
|
||||
eval-expression-minibuffer-setup
|
||||
ielm-mode
|
||||
lisp-mode
|
||||
lisp-interaction-mode
|
||||
scheme-mode
|
||||
clojure-mode)
|
||||
:config
|
||||
(lispyville-set-key-theme
|
||||
'(operators
|
||||
c-w
|
||||
slurp/barf-cp
|
||||
commentary
|
||||
text-objects
|
||||
additional
|
||||
additional-insert
|
||||
mark
|
||||
(prettify insert)
|
||||
(escape insert emacs)
|
||||
(additional-movement normal visual motion)))
|
||||
(evil-define-key 'normal lispyville-mode-map (kbd "C-v") nil)
|
||||
(evil-define-key 'insert lispyville-mode-map (kbd "DEL") #'lispy-delete-backward)
|
||||
(evil-define-key 'insert lispyville-mode-map (kbd "C-h") #'lispy-delete-backward)
|
||||
(evil-define-key 'insert lispyville-mode-map "(" #'lispy-parens)
|
||||
(evil-define-key 'insert lispyville-mode-map ")" #'lispy-right-nostring)
|
||||
(evil-define-key 'insert lispyville-mode-map "\"" #'lispy-quotes)
|
||||
(evil-define-key 'normal lispyville-mode-map ";" nil)
|
||||
(evil-define-key 'normal lispyville-mode-map (kbd "C-;") #'lispy-comment)
|
||||
(evil-define-key 'visual lispyville-mode-map "iF" #'special-lispy-flow))
|
||||
(setq meow-cheatsheet-layout meow-cheatsheet-layout-qwerty)
|
||||
(meow-motion-overwrite-define-key '("j" . meow-next)
|
||||
'("k" . meow-prev)
|
||||
'("<escape>" . ignore))
|
||||
(meow-leader-define-key '("j" . "H-j")
|
||||
'("k" . "H-k")
|
||||
'("1" . meow-digit-argument)
|
||||
'("2" . meow-digit-argument)
|
||||
'("3" . meow-digit-argument)
|
||||
'("4" . meow-digit-argument)
|
||||
'("5" . meow-digit-argument)
|
||||
'("6" . meow-digit-argument)
|
||||
'("7" . meow-digit-argument)
|
||||
'("8" . meow-digit-argument)
|
||||
'("9" . meow-digit-argument)
|
||||
'("0" . meow-digit-argument)
|
||||
'("/" . meow-keypad-describe-key)
|
||||
'("?" . meow-cheatsheet))
|
||||
(meow-normal-define-key '("0" . meow-expand-0)
|
||||
'("9" . meow-expand-9)
|
||||
'("8" . meow-expand-8)
|
||||
'("7" . meow-expand-7)
|
||||
'("6" . meow-expand-6)
|
||||
'("5" . meow-expand-5)
|
||||
'("4" . meow-expand-4)
|
||||
'("3" . meow-expand-3)
|
||||
'("2" . meow-expand-2)
|
||||
'("1" . meow-expand-1)
|
||||
'("-" . negative-argument)
|
||||
'(";" . meow-reverse)
|
||||
'("," . meow-inner-of-thing)
|
||||
'("." . meow-bounds-of-thing)
|
||||
'("[" . meow-beginning-of-thing)
|
||||
'("]" . meow-end-of-thing)
|
||||
'("a" . meow-append)
|
||||
'("A" . meow-open-below)
|
||||
'("b" . meow-back-word)
|
||||
'("B" . meow-back-symbol)
|
||||
'("c" . meow-change)
|
||||
'("d" . meow-delete)
|
||||
'("D" . meow-backward-delete)
|
||||
'("e" . meow-next-word)
|
||||
'("E" . meow-next-symbol)
|
||||
'("f" . meow-find)
|
||||
'("g" . meow-cancel-selection)
|
||||
'("G" . meow-grab)
|
||||
'("h" . meow-left)
|
||||
'("H" . meow-left-expand)
|
||||
'("i" . meow-insert)
|
||||
'("I" . meow-open-above)
|
||||
'("j" . meow-next)
|
||||
'("J" . meow-next-expand)
|
||||
'("k" . meow-prev)
|
||||
'("K" . meow-prev-expand)
|
||||
'("l" . meow-right)
|
||||
'("L" . meow-right-expand)
|
||||
'("m" . meow-join)
|
||||
'("n" . meow-search)
|
||||
'("N" . meow-pop-search)
|
||||
'("o" . meow-block)
|
||||
'("O" . meow-to-block)
|
||||
'("p" . meow-yank)
|
||||
'("q" . meow-quit)
|
||||
'("Q" . meow-goto-line)
|
||||
'("r" . meow-replace)
|
||||
'("R" . meow-swap-grab)
|
||||
'("s" . meow-kill)
|
||||
'("t" . meow-till)
|
||||
'("u" . my-meow-undo)
|
||||
'("U" . meow-undo-in-selection)
|
||||
'("v" . meow-visit)
|
||||
'("w" . meow-mark-word)
|
||||
'("W" . meow-mark-symbol)
|
||||
'("x" . meow-line)
|
||||
'("X" . meow-goto-line)
|
||||
'("y" . meow-save)
|
||||
'("Y" . meow-sync-grab)
|
||||
'("z" . meow-pop-selection)
|
||||
'("'" . repeat)
|
||||
'("<escape>" . ignore))
|
||||
(meow-global-mode))
|
||||
|
||||
(use-package treesit
|
||||
:ensure nil
|
||||
|
@ -237,8 +186,6 @@
|
|||
(use-package vertico
|
||||
:demand t
|
||||
:config
|
||||
(evil-define-key 'insert minibuffer-local-map (kbd "C-j") #'vertico-next)
|
||||
(evil-define-key 'insert minibuffer-local-map (kbd "C-k") #'vertico-previous)
|
||||
(vertico-mode)
|
||||
(vertico-mouse-mode))
|
||||
|
||||
|
@ -256,9 +203,6 @@
|
|||
|
||||
(use-package treemacs
|
||||
:commands treemacs)
|
||||
(use-package treemacs-evil
|
||||
:demand t
|
||||
:after treemacs)
|
||||
(use-package treemacs-all-the-icons
|
||||
:demand t
|
||||
:after treemacs
|
||||
|
@ -304,13 +248,7 @@
|
|||
(org-hide-emphasis-markers t)
|
||||
(org-pretty-entities t)
|
||||
:config
|
||||
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.1))
|
||||
(defhydra hydra-org-evil-shiftmove (org-mode-map "C-c")
|
||||
"S+arrows"
|
||||
("h" #'org-shiftleft "left")
|
||||
("j" #'org-shiftdown "down")
|
||||
("k" #'org-shiftup "up")
|
||||
("l" #'org-shiftright "right")))
|
||||
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.1)))
|
||||
|
||||
(use-package org-superstar
|
||||
:custom
|
||||
|
@ -326,10 +264,7 @@
|
|||
(editorconfig-mode))
|
||||
|
||||
(use-package nix-mode
|
||||
:mode "\\.nix'"
|
||||
:hook (nix-mode . (lambda ()
|
||||
(with-eval-after-load 'evil
|
||||
(setq-local evil-shift-width 2)))))
|
||||
:mode "\\.nix'")
|
||||
|
||||
(use-package markdown-mode
|
||||
:mode ("README\\.md\\'" . gfm-mode)
|
||||
|
@ -340,18 +275,7 @@
|
|||
:commands minimap-mode
|
||||
:custom-face
|
||||
(minimap-active-region-background ((t (:background nil :inherit hl-line))))
|
||||
:hook ((minimap-sb-mode . evil-emacs-state)
|
||||
(minimap-sb-mode . turn-on-solaire-mode))
|
||||
:config
|
||||
(with-eval-after-load 'evil
|
||||
(defadvice evil-quit (after evil-quit-remove-minimap activate)
|
||||
(let ((windows (window-list nil 0)))
|
||||
(when (and (eq (length windows) 1)
|
||||
(with-current-buffer (window-buffer (car windows))
|
||||
(member 'minimap-sb-mode local-minor-modes)))
|
||||
(if (daemonp)
|
||||
(delete-frame)
|
||||
(kill-emacs)))))))
|
||||
:hook (minimap-sb-mode . turn-on-solaire-mode))
|
||||
|
||||
(use-package magit
|
||||
:hook ((git-commit-setup . git-commit-turn-on-flyspell)
|
||||
|
@ -369,8 +293,32 @@
|
|||
(use-package vterm
|
||||
:hook (vterm-mode . my-inhibit-hl-line-mode)
|
||||
:config
|
||||
(evil-define-key 'insert vterm-mode-map (kbd "C-h") #'vterm--self-insert)
|
||||
(evil-define-key 'insert vterm-mode-map (kbd "C-S-h") #'help-command))
|
||||
(with-eval-after-load 'meow
|
||||
(defvar meow-vterm-normal-mode-map
|
||||
(let ((map (make-sparse-keymap)))
|
||||
(define-key map (kbd "RET") #'vterm-send-return) map))
|
||||
(setq vterm-keymap-exceptions '("C-c"))
|
||||
(define-key vterm-mode-map (kbd "C-c ESC") #'vterm-send-escape)
|
||||
(dolist (c '((yank . vterm-yank)
|
||||
(xterm-paste . vterm-xterm-paste)
|
||||
(yank-pop . vterm-yank-pop)
|
||||
(mouse-yank-primary . vterm-yank-primary)
|
||||
(self-insert-command . vterm--self-insert)
|
||||
(beginning-of-defun . vterm-previous-prompt)
|
||||
(end-of-defun . vterm-next-prompt)))
|
||||
(define-key meow-vterm-normal-mode-map (vector 'remap (car c)) (cdr c)))
|
||||
(add-hook 'vterm-mode-hook
|
||||
(lambda ()
|
||||
(add-hook 'meow-insert-enter-hook
|
||||
(lambda ()
|
||||
(use-local-map vterm-mode-map)
|
||||
(vterm-goto-char (point)))
|
||||
nil t)
|
||||
(add-hook 'meow-insert-exit-hook
|
||||
(lambda ()
|
||||
(use-local-map meow-vterm-normal-mode-map))
|
||||
nil t)))
|
||||
(add-to-list 'meow-mode-state-list '(vterm-mode . insert))))
|
||||
|
||||
(use-package elfeed
|
||||
:commands (elfeed elfeed-update)
|
||||
|
@ -378,9 +326,7 @@
|
|||
(elfeed-feeds '(("https://archlinux.org/feeds/news/" arch-linux))))
|
||||
|
||||
(use-package xkcd
|
||||
:commands xkcd
|
||||
:config
|
||||
(evil-set-initial-state 'xkcd-mode 'emacs))
|
||||
:commands xkcd)
|
||||
|
||||
(use-package ligature
|
||||
:hook (prog-mode
|
||||
|
@ -403,7 +349,11 @@
|
|||
"\\\\" "://")))
|
||||
|
||||
(use-package gruvbox-theme)
|
||||
(use-package catppuccin-theme)
|
||||
(use-package catppuccin-theme
|
||||
:custom-face
|
||||
;; surface2
|
||||
(region ((t (:background "#5b6078")))))
|
||||
|
||||
(defun load-theme-with-solaire ()
|
||||
(load-theme 'catppuccin-macchiato t)
|
||||
(solaire-global-mode)
|
||||
|
@ -496,7 +446,6 @@
|
|||
(xterm-mouse-mode)
|
||||
(global-set-key (kbd "<mouse-4>") #'scroll-down-3)
|
||||
(global-set-key (kbd "<mouse-5>") #'scroll-up-3)
|
||||
(etcc-on)
|
||||
(setq after-make-frame-functions
|
||||
(remove 'frame-make-detect-term after-make-frame-functions))))
|
||||
|
||||
|
|
Loading…
Reference in a new issue