Config: optimize consult config, change some keybindings and function
This commit is contained in:
@@ -71,11 +71,15 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
||||
(interactive)
|
||||
(consult-directory-externally default-directory))
|
||||
|
||||
(defun org-cycle-current-subtree()
|
||||
"Cycle current subtree."
|
||||
(defun org-cycle-parent-subtree()
|
||||
"Cycle parent org subtree."
|
||||
(interactive)
|
||||
(org-back-to-heading)
|
||||
(if (org-at-heading-p)
|
||||
(progn
|
||||
(org-up-heading 1)
|
||||
(org-cycle))
|
||||
(org-back-to-heading)
|
||||
(org-cycle)))
|
||||
|
||||
(defun consult-org-ripgrep ()
|
||||
"Search in org files use consult-ripgrep."
|
||||
|
||||
@@ -42,7 +42,8 @@
|
||||
"l" 'consult-locate
|
||||
"m" 'consult-fd-global
|
||||
"d" 'my-open-current-directory
|
||||
"j" 'consult-jinx)
|
||||
"j" 'consult-jinx
|
||||
"k" 'consult-kmacro)
|
||||
|
||||
;; t for modes toggle
|
||||
(general-def
|
||||
@@ -140,10 +141,11 @@
|
||||
|
||||
;; org-mode
|
||||
(general-def org-mode-map
|
||||
"C-<tab>" 'org-cycle-current-subtree
|
||||
"C-c i" 'consult-org-heading
|
||||
"C-<tab>" 'org-cycle-parent-subtree
|
||||
"C-c i" 'consult-outline
|
||||
"C-c o w" 'my-org-refile-to-new-file
|
||||
"C-c o l" 'org-toggle-link-display)
|
||||
"C-c o l" 'org-toggle-link-display
|
||||
"C-c C-k" 'kmacro-call-macro)
|
||||
|
||||
;; emms
|
||||
(general-def emms-playlist-mode-map
|
||||
@@ -165,10 +167,12 @@
|
||||
"e" 'er/expand-region
|
||||
"s" 'consult-focus-lines
|
||||
"i" 'consult-imenu
|
||||
"C-i" 'consult-outline
|
||||
"a" 'org-agenda
|
||||
"l" 'org-store-link
|
||||
"k" 'comment-line
|
||||
"v" 'vterm)
|
||||
"v" 'vterm
|
||||
"C-k" 'kmacro-call-macro)
|
||||
|
||||
;; global map
|
||||
(general-def
|
||||
@@ -264,7 +268,7 @@
|
||||
_p_ : prev line _P_ : previous _c_ : edit lines
|
||||
_n_ : next line _N_ : next _._ : pop
|
||||
_b_ : prev word _q_ : quit
|
||||
_f_ : next word
|
||||
_f_ : next word _i_ : insert numbers
|
||||
_B_ : prev symbol
|
||||
_F_ : next symbol
|
||||
_s_ : in region
|
||||
@@ -281,6 +285,7 @@ _a_ : all dwim
|
||||
("a" mc/mark-all-dwim)
|
||||
("s" mc/mark-all-in-region)
|
||||
("c" mc/edit-lines)
|
||||
("i" mc/insert-numbers)
|
||||
("." mc/mark-pop)
|
||||
("q" nil))
|
||||
|
||||
|
||||
@@ -58,7 +58,8 @@
|
||||
(use-package restart-emacs)
|
||||
|
||||
;; 安装multiple-cursors
|
||||
(use-package multiple-cursors)
|
||||
(use-package multiple-cursors
|
||||
:config (setq mc/insert-numbers-default 1))
|
||||
|
||||
;; 安装crux,增强快捷键,快捷键配置在init-kbd.el中
|
||||
(use-package crux)
|
||||
@@ -106,18 +107,22 @@
|
||||
(add-to-list 'process-coding-system-alist '("es" gbk . gbk)))
|
||||
|
||||
(when *is-mac*
|
||||
(setopt consult-locate-args "mdfind -name")))
|
||||
(setopt consult-locate-args "mdfind -name"))
|
||||
|
||||
(delete 'consult-source-recent-file consult-buffer-sources))
|
||||
|
||||
(use-package consult-dir
|
||||
:bind (("C-x C-d" . consult-dir)
|
||||
:map minibuffer-local-completion-map
|
||||
("C-x C-d" . consult-dir)
|
||||
("C-x C-j" . consult-dir-jump-file)))
|
||||
("C-x C-j" . consult-dir-jump-file))
|
||||
:config
|
||||
(delete 'consult-dir--source-recentf consult-dir-sources))
|
||||
|
||||
(use-package consult-notes
|
||||
:config
|
||||
(setq consult-notes-file-dir-sources '(("org notes" ?n "~/org/my-org-note/")
|
||||
("org journal" ?j "~/org/my-org-daily/" :hidden t))))
|
||||
(setq consult-notes-file-dir-sources '(("Org Notes" ?n "~/org/my-org-note/")
|
||||
("Org Journal" ?j "~/org/my-org-daily/" :hidden t))))
|
||||
|
||||
;; embark
|
||||
(use-package embark
|
||||
|
||||
@@ -33,15 +33,17 @@
|
||||
;; 设置字典目录
|
||||
(setq cns-dict-directory "~/emacs-stuff/emacs-chinese-word-segmentation/cppjieba/dict/")))
|
||||
|
||||
;; 其他配置
|
||||
(setq cns-recent-segmentation-limit 40)
|
||||
(require 'cns nil t)
|
||||
;; 自动启动
|
||||
(when (featurep 'cns)
|
||||
;; 其他配置
|
||||
(setq cns-recent-segmentation-limit 40)
|
||||
(require 'cns nil t)
|
||||
;; 自动启动
|
||||
(when (featurep 'cns)
|
||||
(add-hook 'find-file-hook 'global-cns-mode))
|
||||
;; 取消C-<backspace>绑定
|
||||
(with-eval-after-load 'cns
|
||||
;; 取消C-<backspace>绑定
|
||||
(with-eval-after-load 'cns
|
||||
(define-key cns-mode-map (kbd "C-<backspace>") nil))
|
||||
;; vterm下关闭cns-mode
|
||||
(add-hook 'vterm-mode-hook (lambda () (setq-local global-cns-mode nil cns-mode nil)))
|
||||
|
||||
(provide 'init-segmentation)
|
||||
|
||||
|
||||
@@ -42,12 +42,18 @@
|
||||
"C-<tab>" 'org-cycle-current-subtree
|
||||
"C-c o l" 'org-toggle-link-display)
|
||||
|
||||
;; vterm
|
||||
(general-def vterm-mode-map
|
||||
"M-]" nil
|
||||
"C-q" 'vterm-send-next-key)
|
||||
|
||||
;; global map with C-c prefix
|
||||
(general-def
|
||||
:prefix "C-c"
|
||||
"c" 'hydra-multiple-cursors/body
|
||||
"e" 'er/expand-region
|
||||
"k" 'comment-line)
|
||||
"k" 'comment-line
|
||||
"v" 'vterm)
|
||||
|
||||
;; global map
|
||||
(general-def
|
||||
|
||||
@@ -16,9 +16,6 @@
|
||||
(set-language-environment "UTF-8")
|
||||
(prefer-coding-system 'utf-8)))
|
||||
|
||||
;; 高亮当前行
|
||||
(global-hl-line-mode t)
|
||||
|
||||
;; 显示文件大小
|
||||
(size-indication-mode t)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user