diff --git a/.config/emacs/init.org b/.config/emacs/init.org index e3258eb..f2aba15 100644 --- a/.config/emacs/init.org +++ b/.config/emacs/init.org @@ -118,7 +118,6 @@ need to benchmark slow init times later. (require 'benchmark-init) (add-hook 'after-init-hook 'benchmark-init/deactivate) #+end_src - ** Misc Stuff #+begin_SRC emacs-lisp @@ -452,7 +451,7 @@ Emacs is an great operating system, if only it had a good text editor... (setq scroll-preserve-screen-position nil) #+end_src *** Boon -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle no (straight-use-package 'boon) (require 'boon-qwerty) (boon-mode) @@ -465,6 +464,8 @@ Emacs is an great operating system, if only it had a good text editor... (define-key boon-moves-map ";" '("hop" . avy-goto-char-2)) (define-key boon-command-map (kbd "C-k") 'scroll-down-line) (define-key boon-command-map (kbd "C-j") 'scroll-up-line) +(define-key boon-command-map (kbd "C-v") 'scroll-up) + ;; (define-key boon-command-map (kbd "C-d") 'joe/smooth-scroll-half-page-down) ;; (define-key boon-command-map (kbd "C-u") 'joe/smooth-scroll-half-page-up) (define-key boon-moves-map "H" 'backward-paragraph) @@ -474,15 +475,16 @@ Emacs is an great operating system, if only it had a good text editor... (define-key boon-moves-map "J" 'boon-smarter-downward) (define-key boon-moves-map "o" 'boon-open-next-line-and-insert) -(define-key boon-moves-map "O" 'boon-open-next-line-and-insert) - - +(define-key boon-moves-map "O" 'boon-open-line-and-insert) +(define-key boon-moves-map "l" 'boon-open-next-line-and-insert) +(define-key boon-moves-map "i" 'boon-set-insert-like-state) +(define-key ctl-x-map "s" 'save-buffer) #+end_src *** Evil -#+begin_src emacs-lisp :tangle no +#+begin_src emacs-lisp (setq evil-want-keybinding nil) (setq evil-undo-system 'undo-fu) @@ -565,17 +567,6 @@ Emacs is an great operating system, if only it had a good text editor... (evil-global-set-key 'normal (kbd "C-w") 'save-buffer) - -;; (define-key evil-normal-state-map "," 'evil-consult-map) -(defun joe/evil-select-line () - (interactive) - "Select line starting first character" - (evil-first-non-blank) - (evil-visual-char) - (evil-last-non-blank)) - -;; (evil-define-key 'normal 'global (kbd "vv") #'joe/evil-select-line) - (defvar global-evil-leader-map (make-sparse-keymap)) (evil-define-key 'normal 'global-evil-leader-map (kbd "SPC") 'evil-send-leader) @@ -658,9 +649,9 @@ The theme of `C-x 4` bindings is that they operate on other windows, so this fun (defun joe/window-split-vertical () (interactive) (set 'joe/popper-side-toggle 'right) (rotate:main-horizontal)) (defun joe/window-split-horizontal () (interactive) (set 'joe/popper-side-toggle 'below) (rotate:main-vertical)) -;; (evil-global-set-key 'normal (kbd "w") 'evil-window-map) +(evil-global-set-key 'normal (kbd "w") 'evil-window-map) -;; (define-key evil-window-map "u" #'winner-undo) +(define-key evil-window-map "u" #'winner-undo) (define-key ctl-x-4-map (kbd "|") #'joe/window-split-vertical) (define-key ctl-x-4-map (kbd "-") #'joe/window-split-horizontal) @@ -767,15 +758,15 @@ The theme of `C-x 4` bindings is that they operate on other windows, so this fun (setq tab-bar-mode t) (setq tab-bar-show nil) -;; (evil-define-key 'normal 'global (kbd "M-1") '(lambda () (interactive) (tab-bar-select-tab 1))) -;; (evil-define-key 'normal 'global (kbd "M-2") '(lambda () (interactive) (tab-bar-select-tab 2))) -;; (evil-define-key 'normal 'global (kbd "M-3") '(lambda () (interactive) (tab-bar-select-tab 3))) -;; (evil-define-key 'normal 'global (kbd "M-4") '(lambda () (interactive) (tab-bar-select-tab 4))) -;; (evil-define-key 'normal 'global (kbd "M-5") '(lambda () (interactive) (tab-bar-select-tab 5))) -;; (evil-define-key 'normal 'global (kbd "M-6") '(lambda () (interactive) (tab-bar-select-tab 6))) -;; (evil-define-key 'normal 'global (kbd "M-7") '(lambda () (interactive) (tab-bar-select-tab 7))) -;; (evil-define-key 'normal 'global (kbd "M-8") '(lambda () (interactive) (tab-bar-select-tab 8))) -;; (evil-define-key 'normal 'global (kbd "M-9") '(lambda () (interactive) (tab-bar-select-tab 9))) +(define-key global-map (kbd "M-1") '(lambda () (interactive) (tab-bar-select-tab 1))) +(define-key global-map (kbd "M-2") '(lambda () (interactive) (tab-bar-select-tab 2))) +(define-key global-map (kbd "M-3") '(lambda () (interactive) (tab-bar-select-tab 3))) +(define-key global-map (kbd "M-4") '(lambda () (interactive) (tab-bar-select-tab 4))) +(define-key global-map (kbd "M-5") '(lambda () (interactive) (tab-bar-select-tab 5))) +(define-key global-map (kbd "M-6") '(lambda () (interactive) (tab-bar-select-tab 6))) +(define-key global-map (kbd "M-7") '(lambda () (interactive) (tab-bar-select-tab 7))) +(define-key global-map (kbd "M-8") '(lambda () (interactive) (tab-bar-select-tab 8))) +(define-key global-map (kbd "M-9") '(lambda () (interactive) (tab-bar-select-tab 9))) #+end_src ** Projects #+begin_src emacs-lisp @@ -967,30 +958,30 @@ targets." ("r" "~/Repositories" "Repos") ("B" "~/pCloudDrive/" "pCloud"))) - ;; (evil-define-key 'normal dirvish-mode-map - ;; (kbd "C-c f") #'dirvish-fd - ;; (kbd "a") #'dirvish-quick-access - ;; (kbd ".") #'dired-create-empty-file - ;; (kbd "f") #'dirvish-file-info-menu - ;; (kbd "y") #'dirvish-yank-menu - ;; (kbd "h") #'dired-up-directory - ;; (kbd "l") #'dired-find-file - ;; (kbd "s") #'dirvish-quicksort - ;; (kbd "v") #'dirvish-vc-menu - ;; (kbd "q") #'dirvish-quit - ;; (kbd "L") #'dirvish-history-go-forward - ;; (kbd "H") #'dirvish-history-go-backward - ;; (kbd "o") #'dired-open-file - ;; (kbd "TAB") #'dirvish-subtree-toggle - ;; (kbd "M-n") #'dirvish-narrow - ;; (kbd "M-l") #'dirvish-ls-switches-menu - ;; (kbd "M-m") #'dirvish-mark-menu - ;; (kbd "M-t") #'dirvish-layout-toggle - ;; (kbd "M-s") #'dirvish-setup-menu - ;; (kbd "M-e") #'dirvish-emerge-menu - ;; (kbd "M-j") #'dirvish-fd-jump)) + (evil-define-key 'normal dirvish-mode-map + (kbd "C-c f") #'dirvish-fd + (kbd "a") #'dirvish-quick-access + (kbd ".") #'dired-create-empty-file + (kbd "f") #'dirvish-file-info-menu + (kbd "y") #'dirvish-yank-menu + (kbd "h") #'dired-up-directory + (kbd "l") #'dired-find-file + (kbd "s") #'dirvish-quicksort + (kbd "v") #'dirvish-vc-menu + (kbd "q") #'dirvish-quit + (kbd "L") #'dirvish-history-go-forward + (kbd "H") #'dirvish-history-go-backward + (kbd "o") #'dired-open-file + (kbd "TAB") #'dirvish-subtree-toggle + (kbd "M-n") #'dirvish-narrow + (kbd "M-l") #'dirvish-ls-switches-menu + (kbd "M-m") #'dirvish-mark-menu + (kbd "M-t") #'dirvish-layout-toggle + (kbd "M-s") #'dirvish-setup-menu + (kbd "M-e") #'dirvish-emerge-menu + (kbd "M-j") #'dirvish-fd-jump)) ) -;; (evil-global-set-key 'normal (kbd "-") #'dirvish-dwim) +(evil-global-set-key 'normal (kbd "-") #'dirvish-dwim) (global-set-key (kbd "C-x d") #'dirvish-dwim) (global-set-key (kbd "C-x C-d") #'joe/dirvish-find-directory) @@ -1123,18 +1114,18 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i (setq which-key-idle-delay 0.3) (add-hook 'after-init-hook (lambda () (which-key-mode))) -;; (which-key-add-keymap-based-replacements evil-normal-state-map -;; "f" '("Files") -;; "b" '("Buffers") -;; "B" '("Bookmarks") -;; "c" '("Consult") -;; "d" '("Dired") -;; "g" '("Git") -;; "m" '("Make") -;; "t" '("Tabs") -;; "p" '("Packages") -;; "s" '("Shell (vterm)") -;; "h" '("Help")) +(which-key-add-keymap-based-replacements evil-normal-state-map + "f" '("Files") + "b" '("Buffers") + "B" '("Bookmarks") + "c" '("Consult") + "d" '("Dired") + "g" '("Git") + "m" '("Make") + "t" '("Tabs") + "p" '("Packages") + "s" '("Shell (vterm)") + "h" '("Help")) #+end_src ** IDE Features @@ -1216,11 +1207,11 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i (setq lsp-signature-render-documentation nil) (setq lsp-eldoc-render-all nil) -;; (evil-global-set-key 'normal (kbd "M-d") #'lsp-describe-thing-at-point) -;; (evil-global-set-key 'normal (kbd "lh") 'lsp-headerline-breadcrumb-mode) -;; (evil-global-set-key 'normal (kbd "li") 'lsp-rust-analyzer-inlay-hints-mode) -;; (evil-global-set-key 'normal (kbd "cs") 'consult-lsp-symbols) -;; (evil-global-set-key 'normal (kbd "cf") 'consult-lsp-file-symbols) +(evil-global-set-key 'normal (kbd "M-d") #'lsp-describe-thing-at-point) +(evil-global-set-key 'normal (kbd "lh") 'lsp-headerline-breadcrumb-mode) +(evil-global-set-key 'normal (kbd "li") 'lsp-rust-analyzer-inlay-hints-mode) +(evil-global-set-key 'normal (kbd "cs") 'consult-lsp-symbols) +(evil-global-set-key 'normal (kbd "cf") 'consult-lsp-file-symbols) ;; This function allows us to extract Rust's true function signature (cl-defmethod lsp-clients-extract-signature-on-hover (contents (_server-id (eql rust-analyzer))) @@ -1242,11 +1233,11 @@ startup. Reason we have to call this is so the vterm fucntion can call `vterm--i #+begin_src emacs-lisp (straight-use-package 'flycheck) ;; TODO Add wrapping to these functions -;; (evil-global-set-key 'normal (kbd "M-e") #'flycheck-next-error) -;; (evil-global-set-key 'normal (kbd "M-E") #'flycheck-previous-error) -;; (evil-global-set-key 'normal (kbd "ee") 'flycheck-mode) -;; (evil-global-set-key 'normal (kbd "el") #'flycheck-list-errors) -;; (evil-global-set-key 'normal (kbd "ce") #'consult-lsp-diagnostics) +(evil-global-set-key 'normal (kbd "M-e") #'flycheck-next-error) +(evil-global-set-key 'normal (kbd "M-E") #'flycheck-previous-error) +(evil-global-set-key 'normal (kbd "ee") 'flycheck-mode) +(evil-global-set-key 'normal (kbd "el") #'flycheck-list-errors) +(evil-global-set-key 'normal (kbd "ce") #'consult-lsp-diagnostics) #+end_src *** Compilation #+begin_src emacs-lisp @@ -1351,11 +1342,14 @@ The best git porcelain/client I've ever used. Also kill stray magit buffers left (magit-restore-window-configuration) (mapc #'kill-buffer buffers))) -;; (add-hook 'with-editor-mode-hook 'evil-insert-state) +(add-hook 'with-editor-mode-hook 'evil-insert-state) (setq magit-bury-buffer-function #'joe/magit-kill-buffers) (setq magit-clone-set-remote.pushDefault t) (setq magit-clone-default-directory "~/Development/") +;; (define-key magit-mode-map "h" 'backward-char) +;; (define-key magit-mode-map "l" 'backward-char) + #+end_src ** Restclient