@@ -49,7 +49,7 @@ This configuration file contains setup my config of emacs
4949#+begin_src emacs-lisp
5050 (defconst ctm-org-agenda-dir (expand-file-name "~/Desktop/gtd/"))
5151 (defconst ctm-org-agenda-filename-input "inbox.org")
52- (defconst ctm-org-agenda-filename-gtd "gtd .org")
52+ (defconst ctm-org-agenda-filename-task "task .org")
5353#+end_src
5454*** Org Roam Constant
5555#+begin_src emacs-lisp
@@ -97,6 +97,7 @@ This configuration file contains setup my config of emacs
9797
9898 (setq-default pathname-coding-system 'utf-8)
9999 (set-file-name-coding-system 'utf-8)
100+
100101#+end_src
101102*** BackUp Settings
102103donot backup file
@@ -126,23 +127,42 @@ donot backup file
126127#+end_src
127128*** Tabs Indentation Settings
128129#+begin_src emacs-lisp
129- ;; (use-package smart-tabs-mode)
130130 (setq tab-width 4)
131131 (setq-default tab-width 4)
132132 (setq-default indent-line-function 4)
133133 (setq-default lisp-indent-offset 4)
134134 (setq-default sgml-basic-offset 4)
135- ;; (smart-tabs-insinuate 'c 'c++ 'java 'javascript 'cperl 'python 'ruby 'nxml)
136135 (setq c-basic-offset 4)
137136 ;; (setq tab-always-indent)
138137 (setq-default indent-tabs-mode nil)
138+
139+ (setq-default electric-indent-inhibit t)
140+
139141 ;; nxml-mode
140142 (setq
141143 nxml-child-indent 4
142144 nxml-attribute-indent 4
143145 nxml-slash-auto-complete-flag t)
144- #+end_src
145146
147+ ;; js ts indent-tab 2 spaces
148+ (setq js-indent-level 2)
149+
150+ #+end_src
151+ **** COMMENT Smart Tabs Settings
152+ #+begin_src emacs-lisp
153+ (use-package! smart-tabs-mode
154+ :config
155+ (smart-tabs-add-language-support jsx rjsx-mode-hook
156+ ((rjsx-indent-line . standard-indent)))
157+ (smart-tabs-add-language-support ts typescript-mode-hook
158+ ((typescript-indent-line . standard-indent)))
159+ (smart-tabs-add-language-support tsx tsx-mode-hook
160+ ((typescript-tsx-indent-line . standard-indent)))
161+ (smart-tabs-add-language-support py python-mode-hook
162+ ((python-indent-line-function . standard-indent)))
163+ (smart-tabs-insinuate 'c 'c++ 'java 'javascript 'jsx 'ts 'tsx 'py)
164+ )
165+ #+end_src
146166*** Undo Settings
147167#+begin_src emacs-lisp
148168 (use-package undo-tree
@@ -237,7 +257,8 @@ window auto Zoom,current window Larger display
237257
238258 (use-package doom-modeline
239259 :vc (:fetcher github :repo seagle0128/doom-modeline)
240- :init (doom-modeline-mode t)
260+ :init
261+ (doom-modeline-mode t)
241262 :config
242263 (setq doom-modeline-height 5)
243264 (custom-set-faces
@@ -246,7 +267,7 @@ window auto Zoom,current window Larger display
246267 )
247268 (doom-modeline-def-modeline 'ownml
248269 '(bar matches buffer-info remote-host buffer-position misc-info major-mode)
249- '(input-method buffer-encoding process check))
270+ '(buffer-encoding process vcs check))
250271 ;; Add to `doom-modeline-mode-hook` or other hooks
251272 (defun setup-custom-doom-modeline ()
252273 (doom-modeline-set-modeline 'ownml 'default))
@@ -333,14 +354,20 @@ window auto Zoom,current window Larger display
333354
334355 (use-package page-break-lines)
335356#+end_src
336- *** Delimiters Highlights Setup
357+ *** COMMENT Delimiters Highlights Setup
358+ :tip:
359+ replaced by treesit
360+ :END:
337361#+begin_src emacs-lisp
338362 (use-package rainbow-delimiters
339363 :hook
340364 (prog-mode . rainbow-delimiters-mode)
341365 )
342366#+end_src
343- *** Highlight Symbol Setup
367+ *** COMMENT Highlight Symbol Setup
368+ :tip:
369+ replaced by treesit
370+ :END:
344371#+begin_src emacs-lisp
345372 (use-package auto-highlight-symbol)
346373 (global-auto-highlight-symbol-mode t)
@@ -359,7 +386,6 @@ window auto Zoom,current window Larger display
359386 (interactive)
360387 (save-excursion
361388 (indent-region (point-min) (point-max) nil)))
362-
363389#+end_src
364390*** Org Table Tidy Settings
365391#+begin_src emacs-lisp
@@ -427,17 +453,17 @@ window auto Zoom,current window Larger display
427453
428454 (setq org-default-notes-file (concat ctm-org-agenda-dir ctm-org-agenda-filename-input))
429455 (setq org-agenda-file-inbox (concat ctm-org-agenda-dir ctm-org-agenda-filename-input))
430- (setq org-agenda-file-gtd (concat ctm-org-agenda-dir ctm-org-agenda-filename-gtd ))
456+ (setq org-agenda-file-gtd (concat ctm-org-agenda-dir ctm-org-agenda-filename-task ))
431457 ;; (setq org-agenda-file-journal (concat org-agenda-dir "journal.org"))
432458 (setq org-agenda-files (list ctm-org-agenda-dir))
433459 (setq org-refile-targets '((org-agenda-files :maxlevel . 3)))
434460 (setq org-agenda-include-diary t)
435461 (setq org-capture-templates `(
436462 ("i" "input [inbox]" entry (file ,org-agenda-file-inbox) "* %i%?")
437- ("c" "calendar [gtd ]" entry (file+headline ,org-agenda-file-gtd "Calendar") "* TODO %i%? \nSCHEDULED: %^t")
438- ("h" "Habit [gtd ]" entry (file+headline ,org-agenda-file-gtd "Habits") "* HABI %i%? \nDEADLINE: %^t")
439- ("p" "Projects [gtd ]" entry (file+headline ,org-agenda-file-gtd "Projects") "* %i%?")
440- ("I" "Incubate [gtd ]" entry (file+headline ,org-agenda-file-gtd "Incubate") "* %i%?")
463+ ("c" "calendar [task ]" entry (file+headline ,org-agenda-file-gtd "Calendar") "* TODO %i%? \nSCHEDULED: %^t")
464+ ("h" "Habit [task ]" entry (file+headline ,org-agenda-file-gtd "Habits") "* HABI %i%? \nDEADLINE: %^t")
465+ ("p" "Projects [task ]" entry (file+headline ,org-agenda-file-gtd "Projects") "* %i%?")
466+ ("I" "Incubate [task ]" entry (file+headline ,org-agenda-file-gtd "Incubate") "* %i%?")
441467 ;;("j" "Journal [journal]" entry (file+datetree ,org-agenda-file-journal) "* %i%? \n%a")
442468 ))
443469 (setq org-todo-keywords
@@ -662,8 +688,7 @@ easy to jump windows
662688#+end_src
663689** Undo Tree Setup
664690#+begin_src emacs-lisp
665- (use-package undo-tree
666- )
691+ (use-package undo-tree)
667692 (global-undo-tree-mode t)
668693#+end_src
669694** Command Completion
@@ -712,7 +737,6 @@ command completion use ivy
712737 ("C-." . 'counsel-imenu)
713738 ("C-c o" . 'counsel-outline)
714739 ("C-x C-f" . counsel-find-file)
715- ("C-c k" . counsel-ag)
716740 ("C-c g" . counsel-rg)
717741 ("C-h f" . 'counsel-describe-function)
718742 ("C-h v" . 'counsel-describe-variable)
@@ -742,7 +766,6 @@ text search use ivy
742766#+begin_src emacs-lisp
743767 ;; bind-key conflict, unbind
744768 (define-key org-mode-map (kbd "C-'") nil)
745-
746769 (use-package swiper
747770 :bind(
748771 ("C-s" . swiper)
@@ -1018,56 +1041,12 @@ jumping to visible text using a char-based decision tree
10181041#+end_src
10191042** Treesit
10201043#+begin_src emacs-lisp
1021- (setq treesit-language-source-alist
1022- '((bash . ("https://github.com/tree-sitter/tree-sitter-bash"))
1023- (c . ("https://github.com/tree-sitter/tree-sitter-c"))
1024- (cpp . ("https://github.com/tree-sitter/tree-sitter-cpp"))
1025- (css . ("https://github.com/tree-sitter/tree-sitter-css"))
1026- (cmake . ("https://github.com/uyha/tree-sitter-cmake"))
1027- (csharp . ("https://github.com/tree-sitter/tree-sitter-c-sharp.git"))
1028- (dockerfile . ("https://github.com/camdencheek/tree-sitter-dockerfile"))
1029- (elisp . ("https://github.com/Wilfred/tree-sitter-elisp"))
1030- (go . ("https://github.com/tree-sitter/tree-sitter-go"))
1031- (gomod . ("https://github.com/camdencheek/tree-sitter-go-mod.git"))
1032- (html . ("https://github.com/tree-sitter/tree-sitter-html"))
1033- (java . ("https://github.com/tree-sitter/tree-sitter-java.git"))
1034- (javascript . ("https://github.com/tree-sitter/tree-sitter-javascript"))
1035- (json . ("https://github.com/tree-sitter/tree-sitter-json"))
1036- (lua . ("https://github.com/Azganoth/tree-sitter-lua"))
1037- (make . ("https://github.com/alemuller/tree-sitter-make"))
1038- (markdown . ("https://github.com/MDeiml/tree-sitter-markdown" nil "tree-sitter-markdown/src"))
1039- (ocaml . ("https://github.com/tree-sitter/tree-sitter-ocaml" nil "ocaml/src"))
1040- (org . ("https://github.com/milisims/tree-sitter-org"))
1041- (python . ("https://github.com/tree-sitter/tree-sitter-python"))
1042- (php . ("https://github.com/tree-sitter/tree-sitter-php"))
1043- (typescript . ("https://github.com/tree-sitter/tree-sitter-typescript" nil "typescript/src"))
1044- (tsx . ("https://github.com/tree-sitter/tree-sitter-typescript" nil "tsx/src"))
1045- (ruby . ("https://github.com/tree-sitter/tree-sitter-ruby"))
1046- (rust . ("https://github.com/tree-sitter/tree-sitter-rust"))
1047- (sql . ("https://github.com/m-novikov/tree-sitter-sql"))
1048- (vue . ("https://github.com/merico-dev/tree-sitter-vue"))
1049- (yaml . ("https://github.com/ikatyang/tree-sitter-yaml"))
1050- (toml . ("https://github.com/tree-sitter/tree-sitter-toml"))
1051- (zig . ("https://github.com/GrayJack/tree-sitter-zig"))))
1052-
1053- (add-to-list 'major-mode-remap-alist '(sh-mode . bash-ts-mode))
1054- (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode))
1055- (add-to-list 'major-mode-remap-alist '(c++-mode . c++-ts-mode))
1056- (add-to-list 'major-mode-remap-alist '(c-or-c++-mode . c-or-c++-ts-mode))
1057- (add-to-list 'major-mode-remap-alist '(css-mode . css-ts-mode))
1058- (add-to-list 'major-mode-remap-alist '(js-mode . js-ts-mode))
1059- ;; (add-to-list 'major-mode-remap-alist '(java-mode . java-ts-mode))
1060- (add-to-list 'major-mode-remap-alist '(js-json-mode . json-ts-mode))
1061- (add-to-list 'major-mode-remap-alist '(makefile-mode . cmake-ts-mode))
1062- (add-to-list 'major-mode-remap-alist '(python-mode . python-ts-mode))
1063- (add-to-list 'major-mode-remap-alist '(ruby-mode . ruby-ts-mode))
1064- (add-to-list 'major-mode-remap-alist '(conf-toml-mode . toml-ts-mode))
1065- (add-to-list 'auto-mode-alist '("\\(?:Dockerfile\\(?:\\..*\\)?\\|\\.[Dd]ockerfile\\)\\'" . dockerfile-ts-mode))
1066- (add-to-list 'auto-mode-alist '("\\.go\\'" . go-ts-mode))
1067- (add-to-list 'auto-mode-alist '("/go\\.mod\\'" . go-mod-ts-mode))
1068- (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-ts-mode))
1069- (add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-ts-mode))
1070- (add-to-list 'auto-mode-alist '("\\.y[a]?ml\\'" . yaml-ts-mode))
1044+ (use-package treesit-auto
1045+ :init
1046+ (setq tressit-font-lock-level 4)
1047+ :config
1048+ (global-treesit-auto-mode)
1049+ )
10711050#+end_src
10721051** Language Setup
10731052*** Eglot Setup
@@ -1195,7 +1174,7 @@ jumping to visible text using a char-based decision tree
11951174#+begin_src emacs-lisp
11961175 (with-eval-after-load 'eglot
11971176 (add-to-list 'eglot-server-programs
1198- `(java-mode ,(concat ctm-lsp-java-server-install-dir "bin/jdtls")
1177+ `(( java-mode java-ts-mode) ,(concat ctm-lsp-java-server-install-dir "bin/jdtls")
11991178 "-configuration" ,(concat ctm-lsp-java-server-install-dir "config_mac")
12001179 "-data" ,(expand-file-name ".cache/workspace" user-emacs-directory)
12011180 ,(concat "--jvm-arg=-javaagent:" ctm-lombok-jar-path)))
@@ -1327,8 +1306,6 @@ use spring-devtools , gradle no autocompile classes, so command: `gradle bootJar
13271306 (add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
13281307 (add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
13291308 (add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
1330- (add-to-list 'auto-mode-alist '("\\.js[x]?\\'" . web-mode))
1331- (add-to-list 'auto-mode-alist '("\\.ts[x]?\\'" . web-mode))
13321309 (add-to-list 'auto-mode-alist '("\\.css?\\'" . web-mode))
13331310
13341311 ;; (use-package js2-mode
@@ -1352,6 +1329,9 @@ react configuration reference: [[http://codewinds.com/blog/2015-04-02-emacs-flyc
13521329#+begin_src emacs-lisp
13531330 (use-package rjsx-mode
13541331 )
1332+
1333+ (add-to-list 'auto-mode-alist '("\\.js[x]?\\'" . rjsx-mode))
1334+ (add-to-list 'auto-mode-alist '("\\.ts[x]?\\'" . rjsx-mode))
13551335#+end_src
13561336*** Javascript REPL
13571337**** js-comint
@@ -1433,7 +1413,16 @@ git tools
14331413
14341414 ;; (add-to-list 'auto-mode-alist '("\\.hpct\\'" . restclient-mode))
14351415#+end_src
1436- ** Youdao Translate Setup
1416+ ** Ediff Setup
1417+ #+begin_src emacs-lisp
1418+ (use-package ediff
1419+ :config
1420+ (setq ediff-keep-variants nil)
1421+ (setq ediff-split-window-function 'split-window-horizontally)
1422+ (setq ediff-window-setup-function #'ediff-setup-windows-plain))
1423+ #+end_src
1424+ ** COMMENT Youdao Translate Setup
1425+ startup tip : Edebug: names-edebug-anon0
14371426#+begin_src emacs-lisp
14381427 (use-package youdao-dictionary
14391428 :init
0 commit comments