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
|
:config
|
||||||
(auto-package-update-at-time "05:00"))
|
(auto-package-update-at-time "05:00"))
|
||||||
|
|
||||||
(use-package undo-tree
|
(use-package undo-fu
|
||||||
:hook (evil-local-mode . turn-on-undo-tree-mode))
|
|
||||||
|
|
||||||
(use-package evil
|
|
||||||
:demand t
|
: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
|
:config
|
||||||
(evil-mode)
|
(global-unset-key (kbd "C-z"))
|
||||||
(evil-select-search-module 'evil-search-module 'evil-search)
|
(global-set-key (kbd "C-z") #'undo-fu-only-undo)
|
||||||
(defadvice evil-force-normal-state (after evil-search-remove-hl activate)
|
(global-set-key (kbd "C-S-z") #'undo-fu-only-redo))
|
||||||
(evil-ex-nohighlight))
|
|
||||||
(evil-global-set-key 'insert (kbd "C-S-h") #'help-command))
|
|
||||||
|
|
||||||
(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
|
:demand t
|
||||||
:after evil
|
|
||||||
:custom
|
|
||||||
(evil-collection-setup-minibuffer t)
|
|
||||||
:config
|
:config
|
||||||
(evil-collection-init))
|
(setq meow-cheatsheet-layout meow-cheatsheet-layout-qwerty)
|
||||||
|
(meow-motion-overwrite-define-key '("j" . meow-next)
|
||||||
(use-package evil-leader
|
'("k" . meow-prev)
|
||||||
:demand t
|
'("<escape>" . ignore))
|
||||||
:after evil
|
(meow-leader-define-key '("j" . "H-j")
|
||||||
:config
|
'("k" . "H-k")
|
||||||
(evil-leader/set-leader "<SPC>")
|
'("1" . meow-digit-argument)
|
||||||
(evil-leader/set-key
|
'("2" . meow-digit-argument)
|
||||||
"u" #'universal-argument
|
'("3" . meow-digit-argument)
|
||||||
"bb" #'switch-to-buffer
|
'("4" . meow-digit-argument)
|
||||||
"bd" #'evil-delete-buffer
|
'("5" . meow-digit-argument)
|
||||||
"fd" #'dirvish-dwim
|
'("6" . meow-digit-argument)
|
||||||
"fq" #'dirvish-quit
|
'("7" . meow-digit-argument)
|
||||||
"ff" #'find-file
|
'("8" . meow-digit-argument)
|
||||||
"fm" #'bookmark-set
|
'("9" . meow-digit-argument)
|
||||||
"ft" #'treemacs
|
'("0" . meow-digit-argument)
|
||||||
"fs" #'evil-write
|
'("/" . meow-keypad-describe-key)
|
||||||
"fu" #'my-sudo-edit
|
'("?" . meow-cheatsheet))
|
||||||
"f'" #'bookmark-jump
|
(meow-normal-define-key '("0" . meow-expand-0)
|
||||||
"gg" #'magit-status
|
'("9" . meow-expand-9)
|
||||||
"mm" #'minimap-mode
|
'("8" . meow-expand-8)
|
||||||
"ps" (lambda ()
|
'("7" . meow-expand-7)
|
||||||
(interactive)
|
'("6" . meow-expand-6)
|
||||||
(package-refresh-contents)
|
'("5" . meow-expand-5)
|
||||||
(auto-package-update-now-async))
|
'("4" . meow-expand-4)
|
||||||
"qq" #'evil-quit
|
'("3" . meow-expand-3)
|
||||||
"qk" #'kill-emacs
|
'("2" . meow-expand-2)
|
||||||
"tt" #'vterm
|
'("1" . meow-expand-1)
|
||||||
"to" #'vterm-other-window)
|
'("-" . negative-argument)
|
||||||
(global-evil-leader-mode))
|
'(";" . meow-reverse)
|
||||||
|
'("," . meow-inner-of-thing)
|
||||||
(use-package evil-surround
|
'("." . meow-bounds-of-thing)
|
||||||
:demand t
|
'("[" . meow-beginning-of-thing)
|
||||||
:after evil
|
'("]" . meow-end-of-thing)
|
||||||
:config
|
'("a" . meow-append)
|
||||||
(global-evil-surround-mode))
|
'("A" . meow-open-below)
|
||||||
|
'("b" . meow-back-word)
|
||||||
(use-package evil-commentary
|
'("B" . meow-back-symbol)
|
||||||
:demand t
|
'("c" . meow-change)
|
||||||
:after evil
|
'("d" . meow-delete)
|
||||||
:config
|
'("D" . meow-backward-delete)
|
||||||
(evil-commentary-mode))
|
'("e" . meow-next-word)
|
||||||
|
'("E" . meow-next-symbol)
|
||||||
(use-package evil-numbers
|
'("f" . meow-find)
|
||||||
:demand t
|
'("g" . meow-cancel-selection)
|
||||||
:after evil
|
'("G" . meow-grab)
|
||||||
:config
|
'("h" . meow-left)
|
||||||
(evil-define-key '(normal visual) 'global "g+" #'evil-numbers/inc-at-pt)
|
'("H" . meow-left-expand)
|
||||||
(evil-define-key '(normal visual) 'global "g-" #'evil-numbers/dec-at-pt)
|
'("i" . meow-insert)
|
||||||
(evil-define-key '(normal visual) 'global "g=+" #'evil-numbers/inc-at-pt-incremental)
|
'("I" . meow-open-above)
|
||||||
(evil-define-key '(normal visual) 'global "g=-" #'evil-numbers/inc-at-pt-incremental))
|
'("j" . meow-next)
|
||||||
|
'("J" . meow-next-expand)
|
||||||
(use-package evil-replace-with-register
|
'("k" . meow-prev)
|
||||||
:demand t
|
'("K" . meow-prev-expand)
|
||||||
:after evil
|
'("l" . meow-right)
|
||||||
:custom
|
'("L" . meow-right-expand)
|
||||||
(evil-replace-with-register-indent t)
|
'("m" . meow-join)
|
||||||
:config
|
'("n" . meow-search)
|
||||||
(evil-replace-with-register-install))
|
'("N" . meow-pop-search)
|
||||||
|
'("o" . meow-block)
|
||||||
(use-package evil-org
|
'("O" . meow-to-block)
|
||||||
:after evil
|
'("p" . meow-yank)
|
||||||
:hook org-mode
|
'("q" . meow-quit)
|
||||||
:config
|
'("Q" . meow-goto-line)
|
||||||
(require 'evil-org-agenda)
|
'("r" . meow-replace)
|
||||||
(evil-org-agenda-set-keys))
|
'("R" . meow-swap-grab)
|
||||||
|
'("s" . meow-kill)
|
||||||
(use-package evil-goggles
|
'("t" . meow-till)
|
||||||
:demand t
|
'("u" . my-meow-undo)
|
||||||
:after evil
|
'("U" . meow-undo-in-selection)
|
||||||
:custom
|
'("v" . meow-visit)
|
||||||
(evil-goggles-duration 0.12 "Decrease the duration a tiny bit")
|
'("w" . meow-mark-word)
|
||||||
(evil-goggles-pulse t)
|
'("W" . meow-mark-symbol)
|
||||||
:config
|
'("x" . meow-line)
|
||||||
(evil-goggles-use-diff-faces)
|
'("X" . meow-goto-line)
|
||||||
(evil-goggles-mode))
|
'("y" . meow-save)
|
||||||
|
'("Y" . meow-sync-grab)
|
||||||
(use-package evil-terminal-cursor-changer)
|
'("z" . meow-pop-selection)
|
||||||
|
'("'" . repeat)
|
||||||
(use-package hydra
|
'("<escape>" . ignore))
|
||||||
:config
|
(meow-global-mode))
|
||||||
(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))
|
|
||||||
|
|
||||||
(use-package treesit
|
(use-package treesit
|
||||||
:ensure nil
|
:ensure nil
|
||||||
|
@ -237,8 +186,6 @@
|
||||||
(use-package vertico
|
(use-package vertico
|
||||||
:demand t
|
:demand t
|
||||||
:config
|
: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-mode)
|
||||||
(vertico-mouse-mode))
|
(vertico-mouse-mode))
|
||||||
|
|
||||||
|
@ -256,9 +203,6 @@
|
||||||
|
|
||||||
(use-package treemacs
|
(use-package treemacs
|
||||||
:commands treemacs)
|
:commands treemacs)
|
||||||
(use-package treemacs-evil
|
|
||||||
:demand t
|
|
||||||
:after treemacs)
|
|
||||||
(use-package treemacs-all-the-icons
|
(use-package treemacs-all-the-icons
|
||||||
:demand t
|
:demand t
|
||||||
:after treemacs
|
:after treemacs
|
||||||
|
@ -304,13 +248,7 @@
|
||||||
(org-hide-emphasis-markers t)
|
(org-hide-emphasis-markers t)
|
||||||
(org-pretty-entities t)
|
(org-pretty-entities t)
|
||||||
:config
|
:config
|
||||||
(setq org-format-latex-options (plist-put org-format-latex-options :scale 1.1))
|
(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")))
|
|
||||||
|
|
||||||
(use-package org-superstar
|
(use-package org-superstar
|
||||||
:custom
|
:custom
|
||||||
|
@ -326,10 +264,7 @@
|
||||||
(editorconfig-mode))
|
(editorconfig-mode))
|
||||||
|
|
||||||
(use-package nix-mode
|
(use-package nix-mode
|
||||||
:mode "\\.nix'"
|
:mode "\\.nix'")
|
||||||
:hook (nix-mode . (lambda ()
|
|
||||||
(with-eval-after-load 'evil
|
|
||||||
(setq-local evil-shift-width 2)))))
|
|
||||||
|
|
||||||
(use-package markdown-mode
|
(use-package markdown-mode
|
||||||
:mode ("README\\.md\\'" . gfm-mode)
|
:mode ("README\\.md\\'" . gfm-mode)
|
||||||
|
@ -340,18 +275,7 @@
|
||||||
:commands minimap-mode
|
:commands minimap-mode
|
||||||
:custom-face
|
:custom-face
|
||||||
(minimap-active-region-background ((t (:background nil :inherit hl-line))))
|
(minimap-active-region-background ((t (:background nil :inherit hl-line))))
|
||||||
:hook ((minimap-sb-mode . evil-emacs-state)
|
:hook (minimap-sb-mode . turn-on-solaire-mode))
|
||||||
(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)))))))
|
|
||||||
|
|
||||||
(use-package magit
|
(use-package magit
|
||||||
:hook ((git-commit-setup . git-commit-turn-on-flyspell)
|
:hook ((git-commit-setup . git-commit-turn-on-flyspell)
|
||||||
|
@ -369,8 +293,32 @@
|
||||||
(use-package vterm
|
(use-package vterm
|
||||||
:hook (vterm-mode . my-inhibit-hl-line-mode)
|
:hook (vterm-mode . my-inhibit-hl-line-mode)
|
||||||
:config
|
:config
|
||||||
(evil-define-key 'insert vterm-mode-map (kbd "C-h") #'vterm--self-insert)
|
(with-eval-after-load 'meow
|
||||||
(evil-define-key 'insert vterm-mode-map (kbd "C-S-h") #'help-command))
|
(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
|
(use-package elfeed
|
||||||
:commands (elfeed elfeed-update)
|
:commands (elfeed elfeed-update)
|
||||||
|
@ -378,9 +326,7 @@
|
||||||
(elfeed-feeds '(("https://archlinux.org/feeds/news/" arch-linux))))
|
(elfeed-feeds '(("https://archlinux.org/feeds/news/" arch-linux))))
|
||||||
|
|
||||||
(use-package xkcd
|
(use-package xkcd
|
||||||
:commands xkcd
|
:commands xkcd)
|
||||||
:config
|
|
||||||
(evil-set-initial-state 'xkcd-mode 'emacs))
|
|
||||||
|
|
||||||
(use-package ligature
|
(use-package ligature
|
||||||
:hook (prog-mode
|
:hook (prog-mode
|
||||||
|
@ -403,7 +349,11 @@
|
||||||
"\\\\" "://")))
|
"\\\\" "://")))
|
||||||
|
|
||||||
(use-package gruvbox-theme)
|
(use-package gruvbox-theme)
|
||||||
(use-package catppuccin-theme)
|
(use-package catppuccin-theme
|
||||||
|
:custom-face
|
||||||
|
;; surface2
|
||||||
|
(region ((t (:background "#5b6078")))))
|
||||||
|
|
||||||
(defun load-theme-with-solaire ()
|
(defun load-theme-with-solaire ()
|
||||||
(load-theme 'catppuccin-macchiato t)
|
(load-theme 'catppuccin-macchiato t)
|
||||||
(solaire-global-mode)
|
(solaire-global-mode)
|
||||||
|
@ -496,7 +446,6 @@
|
||||||
(xterm-mouse-mode)
|
(xterm-mouse-mode)
|
||||||
(global-set-key (kbd "<mouse-4>") #'scroll-down-3)
|
(global-set-key (kbd "<mouse-4>") #'scroll-down-3)
|
||||||
(global-set-key (kbd "<mouse-5>") #'scroll-up-3)
|
(global-set-key (kbd "<mouse-5>") #'scroll-up-3)
|
||||||
(etcc-on)
|
|
||||||
(setq after-make-frame-functions
|
(setq after-make-frame-functions
|
||||||
(remove 'frame-make-detect-term after-make-frame-functions))))
|
(remove 'frame-make-detect-term after-make-frame-functions))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue