feat(emacs): more improvements
All checks were successful
Check Formatting of Files / Check-Formatting (push) Successful in 1m18s
All checks were successful
Check Formatting of Files / Check-Formatting (push) Successful in 1m18s
This commit is contained in:
parent
97784a2d66
commit
24c142208d
@ -56,7 +56,8 @@
|
|||||||
(elpaca-wait)
|
(elpaca-wait)
|
||||||
|
|
||||||
(general-create-definer key-leader
|
(general-create-definer key-leader
|
||||||
:states '(normal override)
|
:states 'normal
|
||||||
|
:keymaps 'override
|
||||||
:prefix "SPC")
|
:prefix "SPC")
|
||||||
|
|
||||||
(key-leader
|
(key-leader
|
||||||
@ -155,17 +156,22 @@
|
|||||||
:config
|
:config
|
||||||
(doom-modeline-mode))
|
(doom-modeline-mode))
|
||||||
|
|
||||||
|
(use-package transient)
|
||||||
|
(use-package magit
|
||||||
|
:after transient)
|
||||||
|
|
||||||
(use-package nerd-icons)
|
(use-package nerd-icons)
|
||||||
|
|
||||||
(use-package nerd-icons-ibuffer
|
(use-package nerd-icons-ibuffer
|
||||||
:ensure t
|
:ensure t
|
||||||
:hook (ibuffer-mode . nerd-icons-ibuffer-mode))
|
:hook (ibuffer-mode . nerd-icons-ibuffer-mode))
|
||||||
|
|
||||||
(use-package nerd-icons-dired
|
(use-package all-the-icons
|
||||||
:after nerd-icons)
|
:if (display-graphic-p))
|
||||||
|
|
||||||
(use-package treemacs
|
(use-package treemacs
|
||||||
:defer t
|
:defer t
|
||||||
|
:init
|
||||||
:general
|
:general
|
||||||
(key-leader
|
(key-leader
|
||||||
:states 'normal
|
:states 'normal
|
||||||
@ -188,10 +194,8 @@
|
|||||||
(treemacs-follow-mode t)
|
(treemacs-follow-mode t)
|
||||||
:hook (treemacs-mode . (lambda () (display-line-numbers-mode -1))))
|
:hook (treemacs-mode . (lambda () (display-line-numbers-mode -1))))
|
||||||
|
|
||||||
(use-package treemacs-nerd-icons
|
(use-package treemacs-icons-dired
|
||||||
:after nerd-icons treemacs
|
:hook (dired-mode . treemacs-icons-dired-enable-once))
|
||||||
:config
|
|
||||||
(treemacs-load-theme "nerd-icons"))
|
|
||||||
|
|
||||||
(use-package treemacs-evil
|
(use-package treemacs-evil
|
||||||
:after treemacs)
|
:after treemacs)
|
||||||
@ -199,7 +203,8 @@
|
|||||||
;; Download Evil
|
;; Download Evil
|
||||||
(use-package goto-chg)
|
(use-package goto-chg)
|
||||||
(use-package evil
|
(use-package evil
|
||||||
:after goto-chg
|
:defer nil
|
||||||
|
:general
|
||||||
:custom
|
:custom
|
||||||
(evl-kbd-macro-suppress-motion-error t)
|
(evl-kbd-macro-suppress-motion-error t)
|
||||||
(evil-want-C-u-scroll t)
|
(evil-want-C-u-scroll t)
|
||||||
@ -214,7 +219,9 @@
|
|||||||
:config
|
:config
|
||||||
(evil-mode 1))
|
(evil-mode 1))
|
||||||
|
|
||||||
|
|
||||||
(use-package evil-matchit
|
(use-package evil-matchit
|
||||||
|
:after evil
|
||||||
:config
|
:config
|
||||||
(global-evil-matchit-mode))
|
(global-evil-matchit-mode))
|
||||||
|
|
||||||
@ -234,6 +241,7 @@
|
|||||||
:remote-key nil)))
|
:remote-key nil)))
|
||||||
|
|
||||||
(use-package evil-surround
|
(use-package evil-surround
|
||||||
|
:after evil
|
||||||
:config
|
:config
|
||||||
(global-evil-surround-mode 1))
|
(global-evil-surround-mode 1))
|
||||||
|
|
||||||
@ -242,17 +250,28 @@
|
|||||||
:config
|
:config
|
||||||
(evil-collection-init))
|
(evil-collection-init))
|
||||||
|
|
||||||
|
(use-package evil-goggles
|
||||||
|
:after evil evil-surround
|
||||||
|
:config
|
||||||
|
(evil-goggles-mode)
|
||||||
|
(evil-goggles-use-diff-faces))
|
||||||
|
|
||||||
;; Allow to jump to characters, etc.
|
;; Allow to jump to characters, etc.
|
||||||
(use-package avy
|
(use-package avy
|
||||||
:general
|
:general
|
||||||
(:keymaps 'normal
|
(:keymaps '(normal operator)
|
||||||
"f" 'avy-goto-char))
|
"f" 'avy-goto-char))
|
||||||
|
|
||||||
;; Improved PDF Experience
|
;; Improved PDF Experience
|
||||||
(use-package pdf-tools
|
(use-package pdf-tools
|
||||||
:config
|
:ensure nil
|
||||||
|
:init
|
||||||
(pdf-tools-install)
|
(pdf-tools-install)
|
||||||
(defun pdf-tools-settings () )
|
:config
|
||||||
|
(keymap-set pdf-view-mode-map "<remap> <scroll-up-command>"
|
||||||
|
#'pdf-view-scroll-up-or-next-page)
|
||||||
|
(keymap-set pdf-view-mode-map "<remap> <scroll-down-command>"
|
||||||
|
#'pdf-view-scroll-down-or-previous-page)
|
||||||
(add-hook 'pdf-tools-enabled-hook (lambda ()
|
(add-hook 'pdf-tools-enabled-hook (lambda ()
|
||||||
(pdf-view-themed-minor-mode)
|
(pdf-view-themed-minor-mode)
|
||||||
(display-line-numbers-mode -1))))
|
(display-line-numbers-mode -1))))
|
||||||
@ -350,6 +369,8 @@
|
|||||||
(:keymaps 'corfu-map
|
(:keymaps 'corfu-map
|
||||||
:states 'insert
|
:states 'insert
|
||||||
"TAB" #'corfu-next
|
"TAB" #'corfu-next
|
||||||
|
[remap pixel-scroll-interpolate-up] #'corfu-scroll-down
|
||||||
|
[remap pixel-scroll-interpolate-down] #'corfu-scroll-up
|
||||||
[tab] #'corfu-next
|
[tab] #'corfu-next
|
||||||
"S-TAB" #'corfu-previous
|
"S-TAB" #'corfu-previous
|
||||||
[backtab] #'corfu-previous
|
[backtab] #'corfu-previous
|
||||||
@ -441,6 +462,8 @@
|
|||||||
(:keymaps '(normal insert visual motion)
|
(:keymaps '(normal insert visual motion)
|
||||||
"M-." #'vertico-repeat) ; Perfectly return to the state of the last Vertico minibuffer usage
|
"M-." #'vertico-repeat) ; Perfectly return to the state of the last Vertico minibuffer usage
|
||||||
(:keymaps 'vertico-map
|
(:keymaps 'vertico-map
|
||||||
|
[remap pixel-scroll-interpolate-up] #'vertico-scroll-down
|
||||||
|
[remap pixel-scroll-interpolate-down] #'vertico-scroll-up
|
||||||
"C-<return>" #'vertico-insert
|
"C-<return>" #'vertico-insert
|
||||||
"<escape>" #'minibuffer-keyboard-quit
|
"<escape>" #'minibuffer-keyboard-quit
|
||||||
"M-s" #'vertico-next-group
|
"M-s" #'vertico-next-group
|
||||||
@ -585,6 +608,20 @@
|
|||||||
:config
|
:config
|
||||||
(undo-fu-session-global-mode))
|
(undo-fu-session-global-mode))
|
||||||
|
|
||||||
|
;; Better wrapping
|
||||||
|
(use-package adaptive-wrap
|
||||||
|
:custom
|
||||||
|
(adaptive-wrap-extra-indent 1)
|
||||||
|
:config
|
||||||
|
(defun turn-on-adaptive-wrap-prefix-mode ()
|
||||||
|
"Turns on adaptive-wrap-prefix-mode."
|
||||||
|
(interactive)
|
||||||
|
(adaptive-wrap-prefix-mode 1))
|
||||||
|
(define-globalized-minor-mode global-adaptive-wrap-prefix-mode
|
||||||
|
adaptive-wrap-prefix-mode
|
||||||
|
turn-on-adaptive-wrap-prefix-mode)
|
||||||
|
(global-visual-line-mode 1)
|
||||||
|
(global-adaptive-wrap-prefix-mode 1))
|
||||||
|
|
||||||
;; Setup Language Servers
|
;; Setup Language Servers
|
||||||
|
|
||||||
@ -652,6 +689,39 @@
|
|||||||
(dap-auto-configure-mode)
|
(dap-auto-configure-mode)
|
||||||
(dap-mode))
|
(dap-mode))
|
||||||
|
|
||||||
|
;; Better scrolling
|
||||||
|
(defun pixel-scroll-kbd-up ()
|
||||||
|
(interactive)
|
||||||
|
(let ((half-height (/ (window-height) 2)))
|
||||||
|
(unless (pos-visible-in-window-p (point-min))
|
||||||
|
(pixel-scroll-precision-interpolate (* 10 half-height)))
|
||||||
|
(pixel-scroll-precision-interpolate (* 10 half-height))))
|
||||||
|
|
||||||
|
(defun pixel-scroll-kbd-down ()
|
||||||
|
(interactive)
|
||||||
|
(let ((half-height (/ (window-height) 2)))
|
||||||
|
(unless (pos-visible-in-window-p (point-max))
|
||||||
|
(pixel-scroll-precision-interpolate (* 10 (- half-height))))
|
||||||
|
(pixel-scroll-precision-interpolate (* 10 (- half-height)))))
|
||||||
|
|
||||||
|
(use-package pixel-scroll
|
||||||
|
:ensure nil
|
||||||
|
:bind
|
||||||
|
:general
|
||||||
|
(:keymaps 'pixel-scroll-precision-mode-map
|
||||||
|
:states 'normal
|
||||||
|
"C-u" #'pixel-scroll-kbd-up
|
||||||
|
"C-d" #'pixel-scroll-kbd-down
|
||||||
|
"C-f" #'pixel-scroll-interpolate-down
|
||||||
|
"C-b" #'pixel-scroll-interpolate-up)
|
||||||
|
:bind
|
||||||
|
([remap scroll-up-command] . pixel-scroll-interpolate-down)
|
||||||
|
([remap scroll-down-command] . pixel-scroll-interpolate-up)
|
||||||
|
:custom
|
||||||
|
(pixel-scroll-precision-interpolate-page t)
|
||||||
|
:init
|
||||||
|
(pixel-scroll-precision-mode 1))
|
||||||
|
|
||||||
;; Rust integration
|
;; Rust integration
|
||||||
(use-package rustic
|
(use-package rustic
|
||||||
:general
|
:general
|
||||||
@ -699,4 +769,18 @@
|
|||||||
(save-place-mode 1)
|
(save-place-mode 1)
|
||||||
|
|
||||||
(mapc 'load (file-expand-wildcards (expand-file-name "./config/*.el" user-emacs-directory)))
|
(mapc 'load (file-expand-wildcards (expand-file-name "./config/*.el" user-emacs-directory)))
|
||||||
(mapc 'load (file-expand-wildcards (expand-file-name "./config/**/*.el" user-emacs-directory)))
|
(mapc 'load (file-expand-wildcards (expand-file-name "./config/**/*.el" user-emacs-directory)))
|
||||||
|
(custom-set-faces
|
||||||
|
;; custom-set-faces was added by Custom.
|
||||||
|
;; If you edit it by hand, you could mess it up, so be careful.
|
||||||
|
;; Your init file should contain only one such instance.
|
||||||
|
;; If there is more than one, they won't work right.
|
||||||
|
'(avy-lead-face ((t (:foreground "#FF5D62" :slant oblique :weight bold))))
|
||||||
|
'(evil-goggles-change-face ((t (:inherit diff-removed))))
|
||||||
|
'(evil-goggles-delete-face ((t (:inherit diff-removed))))
|
||||||
|
'(evil-goggles-paste-face ((t (:inherit diff-added))))
|
||||||
|
'(evil-goggles-undo-redo-add-face ((t (:inherit diff-added))))
|
||||||
|
'(evil-goggles-undo-redo-change-face ((t (:inherit diff-changed))))
|
||||||
|
'(evil-goggles-undo-redo-remove-face ((t (:inherit diff-removed))))
|
||||||
|
'(evil-goggles-yank-face ((t (:inherit diff-changed))))
|
||||||
|
'(italic ((t (:slant oblique)))))
|
Loading…
Reference in New Issue
Block a user