commit d3d5660461bba23561572ec714a88239548f0217
parent 7b125dfce37d75ac9e4a325d74d589b739c95460
Author: Jake Koroman <jakekoroman@proton.me>
Date: Sun, 24 Nov 2024 15:41:10 -0500
emacs: removed general and evil. added meow.
Diffstat:
M | .config/emacs/init.el | | | 248 | +++++++++++++++++++++++++++++++++---------------------------------------------- |
1 file changed, 103 insertions(+), 145 deletions(-)
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
@@ -1,5 +1,3 @@
-;;; https://github.com/hrs/dotfiles/blob/main/emacs/.config/emacs/configuration.org
-
(setq custom-file (concat user-emacs-directory "custom.el"))
(add-to-list 'load-path "~/.config/emacs/local")
(add-to-list 'custom-theme-load-path "~/.config/emacs/local")
@@ -30,13 +28,12 @@
blink-cursor-mode nil
ring-bell-function 'ignore
display-line-numbers-type 'relative
- transient-mark-mode nil
dired-listing-switches "-alh --group-directories-first"
compilation-scroll-output t
gc-cons-threshold 100000000
compilation-ask-about-save nil
- frame-resize-pixelwise t
- mouse-drag-mode-line-buffer 1
+ frame-resize-pixelwise t
+ mouse-drag-mode-line-buffer 1
display-time-24hr-format t
)
@@ -81,9 +78,6 @@
(use-package zenburn-theme
:ensure)
-(use-package undo-fu
- :ensure)
-
(use-package savehist
:init
(savehist-mode))
@@ -100,7 +94,7 @@
(use-package vertico
:ensure
:init
- (vertico-mode)
+ (vertico-mode 1)
(setq vertico-cycle t)
:config
(setq vertico-multiform-categories
@@ -136,51 +130,14 @@
:init
(marginalia-mode))
-(use-package consult
- :ensure)
-
-(use-package evil
- :ensure
- :init
- (setq evil-want-keybinding nil)
- (setq evil-undo-system 'undo-fu)
- :config
- (evil-mode 1))
-
-(use-package evil-surround
- :ensure
- :config
- (global-evil-surround-mode 1))
-
-(use-package evil-collection
- :ensure
- :init
- (evil-collection-init))
-
-(use-package evil-multiedit
- :ensure
- :config
- ;; Sets the colour of the region
- (evil-multiedit-default-keybinds))
-
-(use-package evil-snipe
- :ensure
- :config
- (add-hook 'magit-mode-hook 'turn-off-evil-snipe-override-mode)
- (evil-snipe-override-mode 1))
-
-;; (use-package smex
-;; :ensure
-;; :config
+ (use-package smex
+ :ensure
+ :config
;; (smex-initialize)
-;; :bind
+ :bind
;; ("M-x" . smex)
-;; ("M-X" . smex-major-mode-commands))
-
-(use-package which-key
- :ensure
- :config
- (which-key-mode))
+;; ("M-X" . smex-major-mode-commands)
+ )
(use-package company
:ensure
@@ -208,11 +165,6 @@
(setq company-backends (mapcar #'company-mode/backend-with-yas company-backends))
(yas-global-mode 1))
-(use-package general
- :ensure
- :config
- (general-evil-setup t))
-
(use-package hl-todo
:ensure
:config
@@ -249,11 +201,6 @@
(use-package glsl-mode
:ensure)
-(use-package evil-commentary
- :ensure
- :config
- (evil-commentary-mode))
-
(use-package org
:defer t
:hook (org-mode . (lambda ()
@@ -353,9 +300,9 @@
;;; C-mode
(setq-default c-basic-offset 4
- c-default-style '((java-mode . "java")
- (awk-mode . "awk")
- (other . "bsd")))
+ c-default-style '((java-mode . "java")
+ (awk-mode . "awk")
+ (other . "bsd")))
;; (c-set-offset 'case-label '+)
(font-lock-add-keywords 'c-mode
@@ -370,55 +317,6 @@
(other-window 1)
(eshell))
-;; Binds with SPC prefix
-(nvmap :keymaps 'override :prefix "SPC"
- "." '(find-file :which-key "Find File")
- ">" '(find-file-other-window :which-key "Open file in other window")
- "," '(ido-switch-buffer :which-key "Switch Buffer")
- "<" '(ido-switch-buffer-other-window :which-key "Open buffer in other window")
- "/" '(consult-grep :which-key "Run grep in cwd")
- "g g" '(magit :which-key "Magit")
- "o -" '(dired-jump :which-key "Open Dired here")
- "o t" '(eshell :which-key "Open eshell in other window")
- "o T" '(my/eshell :which-key "Open eshell here")
-
- ;; Compile Binds
- "c" '(recompile :which-key "Recompile")
- "C" '(compile :which-key "Compile")
-
- ;; Window Binds
- "w w" '(evil-window-next :which-key "Cycle through windows")
- "w h" '(evil-window-left :which-key "Move left a window")
- "w l" '(evil-window-right :which-key "Move right a window")
- "w j" '(evil-window-down :which-key "Move down a window")
- "w k" '(evil-window-up :which-key "Move up a window")
- "w m" '(delete-other-windows :which-key "Maximize current window")
- "w n" '(evil-window-new :which-key "Open a new window")
- "w c" '(evil-window-delete :which-key "Close active window")
- "w s" '(evil-window-split :which-key "Split current window horizontally")
- "w v" '(evil-window-vsplit :which-key "Split current window vertically")
-
- ;; Buffer Binds
- "b p" '(previous-buffer :which-key "Open previous buffer")
- "b n" '(next-buffer :which-key "Open next buffer")
- "b k" '(kill-current-buffer :which-key "Kill current buffer")
-
- ;; Toggles
- "t b" '(toggle-big-font :which-key "Toggles big font")
- )
-
-(defun previous-blank-line ()
- "Moves to the previous line containing nothing but whitespace."
- (interactive)
- (search-backward-regexp "^[ \t]*\n"))
-
-(defun next-blank-line ()
- "Moves to the next line containing nothing but whitespace."
- (interactive)
- (forward-line)
- (search-forward-regexp "^[ \t]*\n")
- (forward-line -1))
-
(defun indent-buffer ()
"Run indent-region on entire buffer"
(interactive)
@@ -450,36 +348,6 @@
(find-file-other-window buffer-file-name)
(find-corresponding-file))
-;; Normal mode binds
-(general-nmap
- "C-e" 'move-end-of-line
- "C-j" 'evil-collection-unimpaired-move-text-down
- "C-k" 'evil-collection-unimpaired-move-text-up
- "C-d" 'kill-region
- "M-j" 'evil-forward-paragraph
- "M-k" 'evil-backward-paragraph
- "M-v" 'find-corresponding-file
- [(meta shift v)] 'find-corresponding-file-other-window)
-
-;; Insert mode binds
-(general-imap
- "C-y" 'evil-paste-after
- "C-a" 'move-beginning-of-line
- "C-e" 'move-end-of-line)
-
-(general-imap
- :keymaps 'eshell-mode-map
- "M-p" 'eshell-previous-matching-input-from-input
- "M-n" 'eshell-next-matching-input-from-input)
-
-;; Binds without SPC prefix
-(general-define-key
- :keymaps 'override
- "M-N" 'next-error
- "M-P" 'previous-error
- "M-o" 'other-window
- "<f2>" 'ido-goto-symbol)
-
;;; Launch gud-gdb in a new window
(defun my/gud ()
"Run gud-gdb in other window"
@@ -534,7 +402,97 @@
(interactive)
(if (eq (aref (font-info (face-attribute 'default :font)) 2) my-font-size)
(set-frame-font (concat "Iosevka Nerd Font:pixelsize=" (number-to-string my-font-big-size)) nil t)
- (set-frame-font (concat my-font-name (number-to-string my-font-size)) nil t)))
+ (set-frame-font (concat my-font-name (number-to-string my-font-size)) nil t)))
+
+(defun meow-setup ()
+ (setq meow-cheatsheet-layout meow-cheatsheet-layout-colemak-dh)
+ (meow-motion-overwrite-define-key
+ ;; Use e to move up, n to move down.
+ ;; Since special modes usually use n to move down, we only overwrite e here.
+ '("e" . meow-prev)
+ '("<escape>" . ignore))
+ (meow-leader-define-key
+ '("?" . meow-cheatsheet)
+ '("." . find-file)
+ '("," . switch-to-buffer)
+ '(">" . find-file-other-window)
+ '("<" . switch-to-buffer-other-window)
+ ;; To execute the originally e in MOTION state, use SPC e.
+ '("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-normal-define-key
+ '("0" . meow-expand-0)
+ '("1" . meow-expand-1)
+ '("2" . meow-expand-2)
+ '("3" . meow-expand-3)
+ '("4" . meow-expand-4)
+ '("5" . meow-expand-5)
+ '("6" . meow-expand-6)
+ '("7" . meow-expand-7)
+ '("8" . meow-expand-8)
+ '("9" . meow-expand-9)
+ '("-" . negative-argument)
+ '(";" . meow-reverse)
+ '("," . meow-inner-of-thing)
+ '("." . meow-bounds-of-thing)
+ '("[" . meow-beginning-of-thing)
+ '("]" . meow-end-of-thing)
+ '("/" . meow-visit)
+ '("a" . meow-append)
+ '("A" . meow-open-below)
+ '("b" . meow-back-word)
+ '("B" . meow-back-symbol)
+ '("c" . meow-change)
+ '("i" . meow-prev)
+ '("I" . meow-prev-expand)
+ '("f" . meow-find)
+ '("g" . meow-cancel-selection)
+ '("G" . meow-grab)
+ '("n" . meow-left)
+ '("N" . meow-left-expand)
+ '("o" . meow-right)
+ '("O" . meow-right-expand)
+ '("j" . meow-join)
+ '("k" . meow-kill)
+ '("l" . meow-line)
+ '("L" . meow-goto-line)
+ '("h" . meow-mark-word)
+ '("H" . meow-mark-symbol)
+ '("e" . meow-next)
+ '("E" . meow-next-expand)
+ '("m" . meow-block)
+ '("M" . meow-to-block)
+ '("p" . meow-yank)
+ '("q" . meow-quit)
+ '("r" . meow-replace)
+ '("s" . meow-insert)
+ '("S" . meow-open-above)
+ '("t" . meow-till)
+ '("u" . meow-undo)
+ '("U" . meow-undo-in-selection)
+ '("v" . meow-search)
+ '("w" . meow-next-word)
+ '("W" . meow-next-symbol)
+ '("x" . meow-delete)
+ '("X" . meow-backward-delete)
+ '("y" . meow-save)
+ '("z" . meow-pop-selection)
+ '("'" . repeat)
+ '("<escape>" . ignore)))
+
+(use-package meow
+ :ensure
+ :config
+ (meow-setup)
+ (meow-global-mode 1))
;; ;; Startup time
;; (defun efs/display-startup-time ()