diff options
Diffstat (limited to 'user/emacs')
-rw-r--r-- | user/emacs/init.el | 47 |
1 files changed, 14 insertions, 33 deletions
diff --git a/user/emacs/init.el b/user/emacs/init.el index 9f8d18e4..10f9c98d 100644 --- a/user/emacs/init.el +++ b/user/emacs/init.el @@ -435,9 +435,9 @@ _C-k_: prev _u_pper _=_: upper/lower _s_mart resolve :after evil :defer 2 :config (progn - (add-hook 'js-ts-mode-hook (lambda () - (define-and-bind-quoted-text-object "slash" "/" "\\/" "\\/") - (push '(?\/ . ("/" . "/")) evil-surround-pairs-alist))) + (add-hook 'js-mode-hook (lambda () + (define-and-bind-quoted-text-object "slash" "/" "\\/" "\\/") + (push '(?\/ . ("/" . "/")) evil-surround-pairs-alist))) (add-hook 'emacs-lisp-mode-hook (lambda () (push '(?` . ("`" . "'")) evil-surround-pairs-alist))) (global-evil-surround-mode +1))) @@ -447,7 +447,7 @@ _C-k_: prev _u_pper _=_: upper/lower _s_mart resolve :after evil-surround :ghook ('LaTex-mode-hook #'embrace-LaTeX-mode-hook) :ghook ('org-mode-hook #'embrace-org-mode-hook) - :ghook ('ruby-ts-mode-hook #'embrace-ruby-mode-hook) + :ghook ('ruby-mode-hook #'embrace-ruby-mode-hook) :ghook ('emacs-lisp-mode-hook #'embrace-emacs-lisp-mode-hook) :config (progn (setq evil-embrace-show-help-p nil) @@ -737,22 +737,12 @@ _C-k_: prev _u_pper _=_: upper/lower _s_mart resolve ;;; Major modes -(setq major-mode-remap-alist '((c-mode . c-ts-mode) - (c++-mode . c++-ts-mode) - (c-or-c++-mode . c-or-c++-ts-mode) - (cmake-mode . cmake-ts-mode) - (csharp-mode . csharp-ts-mode) - (dockerfile-mode . dockerfile-ts-mode) - (go-mode . go-ts-mode) - (java-mode . java-ts-mode) - (python-mode . python-ts-mode) - (ruby-mode . ruby-ts-mode) - (toml-mode . toml-ts-mode) - (yaml-mode . yaml-ts-mode))) +;;;; tree-sitter +(use-package treesit-auto + :config (global-treesit-auto-mode)) ;;;; golang -(with-eval-after-load 'go-ts-mode - (setq go-ts-mode-indent-offset tab-width)) +(setq go-mode-indent-offset tab-width) (with-eval-after-load 'project (add-to-list 'project-vc-extra-root-markers "go.mod")) @@ -766,16 +756,8 @@ _C-k_: prev _u_pper _=_: upper/lower _s_mart resolve ;;;; js (setq js-indent-level 2 js-enabled-frameworks '(javascript)) -(add-to-list 'major-mode-remap-alist '(js-mode . js-ts-mode)) -(add-to-list 'major-mode-remap-alist '(json-mode . json-ts-mode)) ;;;; typescript -(use-package typescript-mode - :mode (("\\.tsx\\'" . tsx-ts-mode)) - :config (progn - (setq typescript-indent-level 2 - typescript-ts-mode-indent-offset 2))) -(add-to-list 'major-mode-remap-alist '(typescript-mode . typescript-ts-mode)) (use-package astro-ts-mode :mode (("\\.astro\\'" . astro-ts-mode))) @@ -873,7 +855,6 @@ _C-k_: prev _u_pper _=_: upper/lower _s_mart resolve :defer t :config (progn (setq css-indent-offset 2))) -(add-to-list 'major-mode-remap-alist '(css-mode . css-ts-mode)) (use-package web-mode :mode (("\\.html?.erb\\'" . web-mode)) @@ -1050,12 +1031,12 @@ _C-k_: prev _u_pper _=_: upper/lower _s_mart resolve "gd" #'xref-find-definitions "gr" #'xref-find-references "C-t" #'xref-pop-marker-stack) - :ghook ('(typescript-ts-mode-hook - dockerfile-ts-mode-hook - yaml-ts-mode-hook - js-ts-mode-hook - css-ts-mode-hook - go-ts-mode-hook + :ghook ('(typescript-mode-hook + dockerfile-mode-hook + yaml-mode-hook + js-mode-hook + css-mode-hook + go-mode-hook lua-mode-hook nim-mode-hook html-mode-hook |