Config: add basic magit config

This commit is contained in:
2026-05-10 22:04:30 +08:00
parent fddfe9859d
commit 68c7f8ba0d
6 changed files with 37 additions and 15 deletions

View File

@@ -66,8 +66,8 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
nil 0 nil
(file-name-directory (expand-file-name file)))))
(defun consult-fd-global ()
"Search for all files use fd"
(defun consult-fd-home ()
"Search for all files in home folder use fd."
(interactive)
(let ((consult-fd-args "fd -H -I -i -c never --full-path")
(default-directory "~/"))
@@ -126,6 +126,12 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
(forward-line 1)
(dired-move-to-filename))
(defun my-magit-toggle-parent-section ()
"Toggle parent magit section."
(interactive)
(magit-section-up)
(magit-section-toggle (magit-section-at)))
(provide 'init-kbd-func)
;;; init-kbd-func.el ends here

View File

@@ -41,7 +41,8 @@
"g" 'consult-ripgrep
"e" 'consult-flycheck
"l" 'consult-locate
"m" 'consult-fd-global
"h" 'consult-fd-home
"m" 'consult-man
"d" 'my-open-current-directory
"j" 'consult-jinx
"k" 'consult-kmacro
@@ -120,6 +121,14 @@
"C-f" 'dired-find-file
"<SPC>" 'dirvish-layout-toggle)
;; magit
(general-def magit-mode-map
"C-<tab>" 'my-magit-toggle-parent-section
"p" 'magit-section-backward-sibling
"M-p" 'magit-section-backward
"n" 'magit-section-forward-sibling
"M-n" 'magit-section-forward)
;; flycheck
(general-def flycheck-mode-map
"M-{" 'flycheck-previous-error

View File

@@ -239,17 +239,6 @@ targets."
(modify-syntax-entry (+ start i) "_" jinx--syntax-table)))))
(require 'init-jinx)))
;; flycheck
(use-package flycheck)
(use-package flycheck-guile
:hook
(scheme-mode . (lambda ()
(require 'flycheck-guile))))
;; consult-flycheck
(use-package consult-flycheck)
;; vterm
;; (unless *is-windows*
;; (use-package vterm))
@@ -310,6 +299,9 @@ targets."
(not (persp-is-current-buffer buff))))
(setq persp-initial-frame-name "desktop"))
;; magit
(use-package magit)
(provide 'init-package)
;;; init-package.el ends here

View File

@@ -7,6 +7,17 @@
;; hs-minor-mode
(add-hook 'prog-mode-hook 'hs-minor-mode)
;; flycheck
(use-package flycheck)
(use-package flycheck-guile
:hook
(scheme-mode . (lambda ()
(require 'flycheck-guile))))
;; consult-flycheck
(use-package consult-flycheck)
;; tree-sitter
(use-package treesit-auto
:config

View File

@@ -30,7 +30,8 @@
"\\*Ibuffer\\*"
"\\*Geiser Debug\\*"
"\\*Kimi-Code\\*"
"\\*OpenRouter\\*"
"\\*gptel-agent:.*\\*"
"^magit"
bookmark-bmenu-mode
lsp-bridge-ref-mode
comint-mode
@@ -50,6 +51,7 @@
"^\\*shell.*\\*.*$" shell-mode
"^\\*terminal.*\\*.*$" term-mode
"^\\*vterm.*\\*.*$" vterm-mode
"^\\*eat.*\\*.*$" eat-mode
"\\*DAP Templates\\*$" dap-server-log-mode
"\\*ELP Profiling Restuls\\*" profiler-report-mode