diff --git a/.#init 10.el b/.#init 10.el new file mode 120000 index 0000000..41e3a74 --- /dev/null +++ b/.#init 10.el @@ -0,0 +1 @@ +yanguangshaonian@yangguangshaoniandeMacBook-Pro.local.66428 \ No newline at end of file diff --git a/.#init 11.el b/.#init 11.el new file mode 120000 index 0000000..f6acfe5 --- /dev/null +++ b/.#init 11.el @@ -0,0 +1 @@ +yanguangshaonian@yangguangshaoniandeMacBook-Pro.local.72617 \ No newline at end of file diff --git a/.#init 12.el b/.#init 12.el new file mode 120000 index 0000000..f6acfe5 --- /dev/null +++ b/.#init 12.el @@ -0,0 +1 @@ +yanguangshaonian@yangguangshaoniandeMacBook-Pro.local.72617 \ No newline at end of file diff --git a/init.el b/init.el index 304d1e6..99e0d03 100644 --- a/init.el +++ b/init.el @@ -10,6 +10,7 @@ (global-set-key (kbd "s-x") 'kill-region) ; 对应Windows上面的Ctrol-x 剪切 + (set-default-coding-systems 'utf-8) ; 设置编码 (global-hl-line-mode 1) ; 高亮当前光标所在行 ;;(set-face-background 'hl-line "#e3f0fe") ; 高亮行的颜色 @@ -118,6 +119,15 @@ (setq which-key-suppress-keymap-warning t) ;; 不显示警告信息 ) +(use-package treesit-auto + :ensure t + :demand t + :config + (setq treesit-auto-install t) + (global-treesit-auto-mode) + (setq treesit-font-lock-level 4) + ) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -150,20 +160,19 @@ (use-package eglot :ensure nil :init + (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-ts-mode)) ;; 不知道为啥需要手动设置关联文件类型 :config - (add-to-list 'eglot-server-programs '((c++-mode c-mode) "clangd")) + (add-to-list 'eglot-server-programs '((c++-ts-mode c-ts-mode) "clangd")) + (add-to-list 'eglot-server-programs '(rust-ts-mode "rust-analyzer")) (setq c-basic-offset 4) + (setq eglot-logging t) :hook - (c-mode . eglot-ensure) - (c++-mode . eglot-ensure) + (c-ts-mode . eglot-ensure) + (c++-ts-mode . eglot-ensure) + (python-ts-mode . eglot-ensure) + (rust-ts-mode . eglot-ensure) ) -(setq a "~/.emacs.d/") - -(defun say ()) - - -