config: add macOS support with cross-platform compatibility
- Add platform-specific keybindings, paths, and settings for macOS - Update org-mode templates and agenda files for both Windows and Mac - Add vterm and lua-ts-mode packages (non-Windows) - Configure Chinese segmentation for macOS - Adjust font sizes and encoding settings per platform
This commit is contained in:
@@ -18,15 +18,25 @@
|
||||
(concat (file-name-as-directory cns-dict-directory) "hmm_model.utf8")
|
||||
(concat (file-name-as-directory cns-dict-directory) "user.dict.utf8")
|
||||
(concat (file-name-as-directory cns-dict-directory) "idf.utf8")
|
||||
(concat (file-name-as-directory cns-dict-directory) "stop_words.utf8")))
|
||||
(concat (file-name-as-directory cns-dict-directory) "stop_words.utf8"))))
|
||||
|
||||
(when *is-mac*
|
||||
(add-to-list 'load-path "~/emacs-stuff/emacs-chinese-word-segmentation/")
|
||||
;; 设置为进程调用方式
|
||||
(setq cns-process-type 'shell)
|
||||
;; 设置可执行文件路径
|
||||
(setq cns-prog "~/emacs-stuff/emacs-chinese-word-segmentation/cnws")
|
||||
;; 设置字典目录
|
||||
(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)
|
||||
(add-hook 'find-file-hook 'cns-auto-enable))
|
||||
(add-hook 'find-file-hook 'global-cns-mode))
|
||||
;; 取消C-<backspace>绑定
|
||||
(with-eval-after-load 'cns
|
||||
(define-key cns-mode-map (kbd "C-<backspace>") nil)))
|
||||
(define-key cns-mode-map (kbd "C-<backspace>") nil))
|
||||
|
||||
(provide 'init-segmentation)
|
||||
|
||||
Reference in New Issue
Block a user