refactor(segmentation): clean up cns config with use-package
This commit is contained in:
@@ -120,6 +120,9 @@
|
||||
(mode . eww-bookmark-mode)
|
||||
(mode . eww-buffers-mode)
|
||||
(mode . eww-history-mode)))
|
||||
("Calc" (or
|
||||
(mode . calc-mode)
|
||||
(mode . calc-trail-mode)))
|
||||
("Shell" (or
|
||||
(mode . eshell-mode)
|
||||
(mode . eat-mode)
|
||||
@@ -192,8 +195,6 @@
|
||||
(name . "^*Buffer List*")
|
||||
(name . "\\*discomfort\\*")
|
||||
(mode . calendar-mode)
|
||||
(mode . calc-mode)
|
||||
(mode . calc-trail-mode)
|
||||
(mode . grep-mode)
|
||||
(mode . occur-mode))))))
|
||||
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
|
||||
(use-package dashboard
|
||||
:autoload dashboard-setup-startup-hook
|
||||
:init
|
||||
:hook after-init
|
||||
:config
|
||||
(setq dashboard-banner-logo-title (format "%s" emacs-version)
|
||||
dashboard-banner-ascii " ##### # # # # ####### # # # ##### ##### \n# # ## # # # # ## ## # # # # # # \n# # # # # # # # # # # # # # # \n# #### # # # # # ##### # # # # # # ##### \n# # # # # # # # # # ####### # # \n# # # ## # # # # # # # # # # # \n ##### # # ##### ####### # # # # ##### ##### "
|
||||
dashboard-startup-banner 'ascii
|
||||
|
||||
@@ -117,7 +117,6 @@ Disable jinx-mode if it's enable and global-jinx-mode is disable , otherwise tog
|
||||
"~/org/hugo/this-is-my-blog/")))
|
||||
(timestamp (format-time-string "%Y-%m-%d %H:%M:%S"))
|
||||
(default-directory blog-dir))
|
||||
(save-buffer)
|
||||
(message "Adding files...")
|
||||
(eshell-command "git add .")
|
||||
(message "Committing: %s" timestamp)
|
||||
|
||||
@@ -229,7 +229,8 @@
|
||||
;; org-mode
|
||||
(general-def org-mode-map
|
||||
"C-<tab>" 'org-cycle-parent-subtree
|
||||
"C-c i" 'consult-outline
|
||||
"M-g i" 'consult-outline
|
||||
"M-g M-i" 'consult-outline
|
||||
"C-c t l" 'org-toggle-link-display
|
||||
"M-{" 'org-previous-visible-heading
|
||||
"M-}" 'org-next-visible-heading
|
||||
@@ -306,8 +307,6 @@
|
||||
"r" 'restart-emacs
|
||||
"e" 'er/expand-region
|
||||
"s" 'consult-line
|
||||
"i" 'consult-imenu
|
||||
"I" 'consult-imenu-multi
|
||||
"a" 'org-agenda
|
||||
"l" 'org-store-link
|
||||
"k" 'comment-line
|
||||
@@ -368,6 +367,7 @@
|
||||
"M-g g" 'avy-goto-line
|
||||
"M-g M-g" 'consult-goto-line
|
||||
"M-g i" 'consult-imenu
|
||||
"M-g I" 'consult-imenu-multi
|
||||
"M-g M-i" 'consult-imenu
|
||||
|
||||
;; window
|
||||
|
||||
@@ -13,8 +13,6 @@
|
||||
(org-mode . electric-pair-local-mode)
|
||||
|
||||
:config
|
||||
(require 'org-tempo)
|
||||
|
||||
(defun my-org-electric-pair-fix ()
|
||||
(setq-local electric-pair-inhibit-predicate
|
||||
(lambda (char)
|
||||
|
||||
@@ -5,6 +5,12 @@
|
||||
;;; Code:
|
||||
|
||||
;; emacs-chinese-word-segmentation
|
||||
(use-package cns
|
||||
:straight nil
|
||||
:hook
|
||||
(after-init . require-cns)
|
||||
(after-init . global-cns-mode)
|
||||
:init
|
||||
(cond
|
||||
(*is-windows*
|
||||
(add-to-list 'load-path "h:/emacs/emacs-chinese-word-segmentation/") ;设置为进程调用方式
|
||||
@@ -26,16 +32,11 @@
|
||||
(setq cns-prog "~/emacs-stuff/emacs-chinese-word-segmentation/cnws")
|
||||
(setq cns-dict-directory "~/emacs-stuff/emacs-chinese-word-segmentation/cppjieba/dict/")))
|
||||
|
||||
;; 其他配置
|
||||
:config
|
||||
(defun require-cns ()
|
||||
(require 'cns nil t))
|
||||
|
||||
(setq cns-recent-segmentation-limit 40)
|
||||
(require 'cns nil t)
|
||||
|
||||
;; 自动启动
|
||||
(when (featurep 'cns)
|
||||
(add-hook 'after-init-hook 'global-cns-mode))
|
||||
|
||||
;; 取消C-<backspace>绑定
|
||||
(with-eval-after-load 'cns
|
||||
(define-key cns-mode-map (kbd "C-<backspace>") nil))
|
||||
|
||||
(provide 'init-segmentation)
|
||||
|
||||
Reference in New Issue
Block a user