Config: install denote and some extra packages, add plocate support on linux, optimize keybindings
This commit is contained in:
@@ -8,6 +8,9 @@
|
|||||||
|
|
||||||
;; dirvish
|
;; dirvish
|
||||||
(use-package dirvish
|
(use-package dirvish
|
||||||
|
:hook
|
||||||
|
(dired-mode-hook . denote-dired-mode)
|
||||||
|
|
||||||
:init
|
:init
|
||||||
(dirvish-override-dired-mode)
|
(dirvish-override-dired-mode)
|
||||||
|
|
||||||
@@ -53,7 +56,7 @@
|
|||||||
("s" "~/.config/guix/" "System config")
|
("s" "~/.config/guix/" "System config")
|
||||||
("p" "~/Pictures/" "Pictures")
|
("p" "~/Pictures/" "Pictures")
|
||||||
("d" "~/downloads/" "Downloads")
|
("d" "~/downloads/" "Downloads")
|
||||||
("v" "~/Video/" "Videos")
|
("v" "~/视频/" "Videos")
|
||||||
("n" "~/org/my-org-note/" "Notes")
|
("n" "~/org/my-org-note/" "Notes")
|
||||||
("g" "~/gptel/" "gptel sessions")))
|
("g" "~/gptel/" "gptel sessions")))
|
||||||
(t nil))))
|
(t nil))))
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
(let ((display-buffer-alist
|
(let ((display-buffer-alist
|
||||||
'((".*" . (display-buffer-no-window . nil)))))
|
'((".*" . (display-buffer-no-window . nil)))))
|
||||||
(async-shell-command command))))
|
(async-shell-command command))))
|
||||||
|
|
||||||
(defun restart-fcitx5 ()
|
(defun restart-fcitx5 ()
|
||||||
"Kill and restart fcitx5, to fix random issues in exwm."
|
"Kill and restart fcitx5, to fix random issues in exwm."
|
||||||
(interactive)
|
(interactive)
|
||||||
@@ -24,6 +24,21 @@
|
|||||||
(eshell-command "fcitx5 -d"))
|
(eshell-command "fcitx5 -d"))
|
||||||
(eshell-command "fcitx5 -d")))
|
(eshell-command "fcitx5 -d")))
|
||||||
|
|
||||||
|
(defun reboot ()
|
||||||
|
"Execute loginctl reboot command."
|
||||||
|
(interactive)
|
||||||
|
(eshell-command "loginctl reboot"))
|
||||||
|
|
||||||
|
(defun poweroff ()
|
||||||
|
"Execute loginctl poweroff command"
|
||||||
|
(interactive)
|
||||||
|
(eshell-command "loginctl poweroff"))
|
||||||
|
|
||||||
|
(defun suspend ()
|
||||||
|
"Execute loginctl suspend command"
|
||||||
|
(interactive)
|
||||||
|
(eshell-command "loginctl suspend"))
|
||||||
|
|
||||||
(defun my--exwm-switch-to-workspace (delta)
|
(defun my--exwm-switch-to-workspace (delta)
|
||||||
(let ((target
|
(let ((target
|
||||||
(mod (+ exwm-workspace-current-index delta)
|
(mod (+ exwm-workspace-current-index delta)
|
||||||
|
|||||||
@@ -66,6 +66,13 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
|||||||
nil 0 nil
|
nil 0 nil
|
||||||
(file-name-directory (expand-file-name file)))))
|
(file-name-directory (expand-file-name file)))))
|
||||||
|
|
||||||
|
(defun consult-fd-global ()
|
||||||
|
"Search for all files use fd"
|
||||||
|
(interactive)
|
||||||
|
(let ((consult-fd-args "fd -H -I -i -c never --full-path")
|
||||||
|
(default-directory "~/"))
|
||||||
|
(consult-fd)))
|
||||||
|
|
||||||
(defun my-open-current-directory ()
|
(defun my-open-current-directory ()
|
||||||
"Open current directory in default file explorer."
|
"Open current directory in default file explorer."
|
||||||
(interactive)
|
(interactive)
|
||||||
|
|||||||
@@ -128,6 +128,11 @@
|
|||||||
"M-]" nil
|
"M-]" nil
|
||||||
"C-q" 'vterm-send-next-key)
|
"C-q" 'vterm-send-next-key)
|
||||||
|
|
||||||
|
;; eat
|
||||||
|
(general-def (eat-semi-char-mode-map eat-line-mode-map eat-char-mode-map eat-eshell-semi-char-mode-map eat-eshell-char-mode-map)
|
||||||
|
"M-[" nil
|
||||||
|
"M-]" nil)
|
||||||
|
|
||||||
;; embark
|
;; embark
|
||||||
(general-def embark-file-map
|
(general-def embark-file-map
|
||||||
"d" 'consult-directory-externally
|
"d" 'consult-directory-externally
|
||||||
@@ -145,8 +150,8 @@
|
|||||||
(general-def org-mode-map
|
(general-def org-mode-map
|
||||||
"C-<tab>" 'org-cycle-parent-subtree
|
"C-<tab>" 'org-cycle-parent-subtree
|
||||||
"C-c i" 'consult-outline
|
"C-c i" 'consult-outline
|
||||||
"C-c o l" 'org-toggle-link-display
|
"C-c t l" 'org-toggle-link-display
|
||||||
"C-c C-k" 'kmacro-call-macro
|
"C-c C-k" 'kmacro-call-macroe
|
||||||
"M-{" 'org-previous-visible-heading
|
"M-{" 'org-previous-visible-heading
|
||||||
"M-}" 'org-next-visible-heading)
|
"M-}" 'org-next-visible-heading)
|
||||||
|
|
||||||
@@ -174,8 +179,10 @@
|
|||||||
"a" 'org-agenda
|
"a" 'org-agenda
|
||||||
"l" 'org-store-link
|
"l" 'org-store-link
|
||||||
"k" 'comment-line
|
"k" 'comment-line
|
||||||
"v" 'vterm
|
;; "v" 'vterm
|
||||||
"C-k" 'kmacro-call-macro)
|
"E" 'eshell
|
||||||
|
"C-k" 'kmacro-call-macro
|
||||||
|
"C-t" 'trashed)
|
||||||
|
|
||||||
;; global map
|
;; global map
|
||||||
(general-def
|
(general-def
|
||||||
@@ -249,20 +256,6 @@
|
|||||||
"j o" 'org-journal-open-entry-for-editing
|
"j o" 'org-journal-open-entry-for-editing
|
||||||
"<RET>" 'org-journal-open-entry-for-editing)
|
"<RET>" 'org-journal-open-entry-for-editing)
|
||||||
|
|
||||||
;; hydra
|
|
||||||
(use-package hydra
|
|
||||||
:defines (consult-imenu-config)
|
|
||||||
:init
|
|
||||||
(with-eval-after-load 'consult-imenu
|
|
||||||
(setq consult-imenu-config
|
|
||||||
'((emacs-lisp-mode :toplevel "Functions"
|
|
||||||
:types ((?f "Functions" font-lock-function-name-face)
|
|
||||||
(?h "Hydras" font-lock-constant-face)
|
|
||||||
(?m "Macros" font-lock-function-name-face)
|
|
||||||
(?p "Packages" font-lock-constant-face)
|
|
||||||
(?t "Types" font-lock-type-face)
|
|
||||||
(?v "Variables" font-lock-variable-name-face)))))))
|
|
||||||
|
|
||||||
;; multiple-cursors
|
;; multiple-cursors
|
||||||
(defhydra hydra-multiple-cursors ()
|
(defhydra hydra-multiple-cursors ()
|
||||||
"
|
"
|
||||||
|
|||||||
@@ -74,6 +74,29 @@
|
|||||||
'org-babel-load-languages
|
'org-babel-load-languages
|
||||||
org-babel-load-languages))
|
org-babel-load-languages))
|
||||||
|
|
||||||
|
;; denote
|
||||||
|
(use-package denote
|
||||||
|
:config
|
||||||
|
(setq denote-directory "~/org/my-org-note/")
|
||||||
|
(setq denote-prompts '(title signature keywords))
|
||||||
|
(setq denote-title-history nil)
|
||||||
|
(setq denote-known-keywords
|
||||||
|
'("emacs" "org" "elisp" "scheme" "programming" "philosophy" "film" "linux" "computerstuff" "game" "masterpiece")))
|
||||||
|
|
||||||
|
;; denote-org
|
||||||
|
(use-package denote-org)
|
||||||
|
|
||||||
|
;; denote-explore
|
||||||
|
(use-package denote-explore)
|
||||||
|
|
||||||
|
;; consult-notes
|
||||||
|
(use-package consult-notes
|
||||||
|
:init
|
||||||
|
(consult-notes-denote-mode)
|
||||||
|
:config
|
||||||
|
(setq consult-notes-file-dir-sources '(("Org Notes" ?n "~/org/my-org-note/" :hidden t)
|
||||||
|
("Org Journal" ?j "~/org/my-org-daily/" :hidden t))))
|
||||||
|
|
||||||
;; org-download
|
;; org-download
|
||||||
(use-package org-download
|
(use-package org-download
|
||||||
:config
|
:config
|
||||||
|
|||||||
@@ -57,13 +57,6 @@
|
|||||||
(use-package consult
|
(use-package consult
|
||||||
:config
|
:config
|
||||||
|
|
||||||
(defun consult-fd-global ()
|
|
||||||
"Search for all files use fd"
|
|
||||||
(interactive)
|
|
||||||
(let ((consult-fd-args "fd -H -I -i -c never --full-path")
|
|
||||||
(default-directory "~/"))
|
|
||||||
(consult-fd)))
|
|
||||||
|
|
||||||
;; everything
|
;; everything
|
||||||
(when *is-windows*
|
(when *is-windows*
|
||||||
(setq consult-locate-args (encode-coding-string "es.exe -i -p -r" 'gbk))
|
(setq consult-locate-args (encode-coding-string "es.exe -i -p -r" 'gbk))
|
||||||
@@ -74,12 +67,11 @@
|
|||||||
|
|
||||||
;; mdfind
|
;; mdfind
|
||||||
(when *is-mac*
|
(when *is-mac*
|
||||||
(setopt consult-locate-args "mdfind -name")))
|
(setq consult-locate-args "mdfind -name"))
|
||||||
|
|
||||||
(use-package consult-notes
|
;; plocate
|
||||||
:config
|
(when *is-linux*
|
||||||
(setq consult-notes-file-dir-sources '(("Org Notes" ?n "~/org/my-org-note/")
|
(setq consult-locate-args "plocate --basename --ignore-case")))
|
||||||
("Org Journal" ?j "~/org/my-org-daily/" :hidden t))))
|
|
||||||
|
|
||||||
;; embark
|
;; embark
|
||||||
(use-package embark
|
(use-package embark
|
||||||
@@ -234,8 +226,8 @@ targets."
|
|||||||
(use-package consult-flycheck)
|
(use-package consult-flycheck)
|
||||||
|
|
||||||
;; vterm
|
;; vterm
|
||||||
(unless *is-windows*
|
;; (unless *is-windows*
|
||||||
(use-package vterm))
|
;; (use-package vterm))
|
||||||
|
|
||||||
;; eat
|
;; eat
|
||||||
(use-package eat
|
(use-package eat
|
||||||
@@ -257,6 +249,20 @@ targets."
|
|||||||
;; general
|
;; general
|
||||||
(use-package general)
|
(use-package general)
|
||||||
|
|
||||||
|
;; hydra
|
||||||
|
(use-package hydra
|
||||||
|
:defines (consult-imenu-config)
|
||||||
|
:init
|
||||||
|
(with-eval-after-load 'consult-imenu
|
||||||
|
(setq consult-imenu-config
|
||||||
|
'((emacs-lisp-mode :toplevel "Functions"
|
||||||
|
:types ((?f "Functions" font-lock-function-name-face)
|
||||||
|
(?h "Hydras" font-lock-constant-face)
|
||||||
|
(?m "Macros" font-lock-function-name-face)
|
||||||
|
(?p "Packages" font-lock-constant-face)
|
||||||
|
(?t "Types" font-lock-type-face)
|
||||||
|
(?v "Variables" font-lock-variable-name-face)))))))
|
||||||
|
|
||||||
;; perspective
|
;; perspective
|
||||||
(use-package perspective
|
(use-package perspective
|
||||||
:bind
|
:bind
|
||||||
|
|||||||
@@ -94,6 +94,9 @@
|
|||||||
(setq use-short-answers t)
|
(setq use-short-answers t)
|
||||||
(fset 'yes-or-no-p 'y-or-n-p))
|
(fset 'yes-or-no-p 'y-or-n-p))
|
||||||
|
|
||||||
|
;; 移动到垃圾桶
|
||||||
|
(setq delete-by-moving-to-trash t)
|
||||||
|
|
||||||
(provide 'init-startup)
|
(provide 'init-startup)
|
||||||
|
|
||||||
;;; init-startup.el ends here
|
;;; init-startup.el ends here
|
||||||
|
|||||||
@@ -41,6 +41,8 @@
|
|||||||
`(dashboard-heading ((,class (:foreground ,green :weight bold))))
|
`(dashboard-heading ((,class (:foreground ,green :weight bold))))
|
||||||
`(dirvish-file-time ((,class (:foreground ,base01))))
|
`(dirvish-file-time ((,class (:foreground ,base01))))
|
||||||
`(dired-header ((,class (:foreground ,green))))
|
`(dired-header ((,class (:foreground ,green))))
|
||||||
|
`(consult-file ((,class (:foreground ,green))))
|
||||||
|
`(denote-faces-keywords ((,class (:foreground ,cyan))))
|
||||||
`(mode-line ((,class (:foreground ,base0 :background ,base02))))
|
`(mode-line ((,class (:foreground ,base0 :background ,base02))))
|
||||||
`(mode-line-inactive ((,class (:foreground ,base01 :background ,base03))))
|
`(mode-line-inactive ((,class (:foreground ,base01 :background ,base03))))
|
||||||
`(display-time-date-and-time ((,class (:foreground ,base1 :bold t))))
|
`(display-time-date-and-time ((,class (:foreground ,base1 :bold t))))
|
||||||
|
|||||||
@@ -41,6 +41,8 @@
|
|||||||
`(dashboard-heading ((,class (:foreground ,green :weight bold))))
|
`(dashboard-heading ((,class (:foreground ,green :weight bold))))
|
||||||
`(dirvish-file-time ((,class (:foreground ,base01))))
|
`(dirvish-file-time ((,class (:foreground ,base01))))
|
||||||
`(dired-header ((,class (:foreground ,green))))
|
`(dired-header ((,class (:foreground ,green))))
|
||||||
|
`(consult-file ((,class (:foreground ,green))))
|
||||||
|
`(denote-faces-keywords ((,class (:foreground ,cyan))))
|
||||||
`(mode-line ((,class (:foreground ,base0 :background ,base02))))
|
`(mode-line ((,class (:foreground ,base0 :background ,base02))))
|
||||||
`(mode-line-inactive ((,class (:foreground ,base01 :background ,base03))))
|
`(mode-line-inactive ((,class (:foreground ,base01 :background ,base03))))
|
||||||
`(display-time-date-and-time ((,class (:foreground ,base1 :bold t))))
|
`(display-time-date-and-time ((,class (:foreground ,base1 :bold t))))
|
||||||
|
|||||||
Reference in New Issue
Block a user