fixed ts-mode usage and use-package for file-mode associations
removed treesit-auto for now. didn't work and wasn't necessary, biggest problem is knowing there's a ts version and fetching it. otherwise, built in major-mode-remap-alist seems to be fine
This commit is contained in:
@@ -153,8 +153,8 @@
|
||||
;; --- File & Buffer Handling ---
|
||||
find-file-visit-truename t
|
||||
vc-follow-symlinks t
|
||||
recentf-max-saved-items 100
|
||||
history-length 300
|
||||
recentf-max-saved-items 150
|
||||
history-length 500
|
||||
savehist-additional-variables '(kill-ring search-ring)
|
||||
|
||||
;; --- Undo System ---
|
||||
@@ -208,7 +208,7 @@
|
||||
(electric-pair-mode t) ; automatically handle pairs
|
||||
(fringe-mode '(0 . 8)) ; fringe only on right edge
|
||||
(delete-selection-mode 1)
|
||||
|
||||
|
||||
;; --- Special UI Settings ---
|
||||
(setq ispell-program-name "hunspell"
|
||||
ispell-dictionary "en_US,nl_NL")
|
||||
@@ -247,11 +247,37 @@
|
||||
(add-hook hook (lambda () (buffer-face-set '(:family "Noto Sans" :height 140)))))
|
||||
|
||||
;; File Associations
|
||||
(add-to-list 'auto-mode-alist '("\\.qd$" . markdown-mode))
|
||||
(add-to-list 'auto-mode-alist '("\\.ino$" . c++-mode))
|
||||
(add-to-list 'auto-mode-alist '("\\.ts$" . typescript-ts-mode))
|
||||
(add-to-list 'term-file-aliases '("xterm-256" . "xterm"))
|
||||
|
||||
(use-package markdown-mode
|
||||
:mode "\\.qd$")
|
||||
|
||||
(use-package c++-mode
|
||||
:mode "\\.ino$")
|
||||
|
||||
(use-package typescript-ts-mode
|
||||
:mode "\\.ts$")
|
||||
|
||||
(use-package js-ts-mode
|
||||
:mode "\\.json$")
|
||||
|
||||
(setq major-mode-remap-alist
|
||||
'((c-mode . c-ts-mode)
|
||||
(c++-mode . c++-ts-mode)
|
||||
(cmake-mode . cmake-ts-mode)
|
||||
(css-mode . css-ts-mode)
|
||||
(java-mode . java-ts-mode)
|
||||
(javascript-mode . js-ts-mode)
|
||||
(js-mode . js-ts-mode)
|
||||
(js2-mode . js-ts-mode)
|
||||
(json-mode . json-ts-mode)
|
||||
(python-mode . python-ts-mode)
|
||||
(ruby-mode . ruby-ts-mode)
|
||||
(rust-mode . rust-ts-mode)
|
||||
(sh-mode . bash-ts-mode)
|
||||
(typescript-mode . typescript-ts-mode)
|
||||
(yaml-mode . yaml-ts-mode)))
|
||||
|
||||
;; Visual Finalization
|
||||
(add-hook
|
||||
'window-setup-hook
|
||||
|
||||
@@ -88,7 +88,6 @@
|
||||
;; CODE ANALYSIS & VISUALS
|
||||
;; ==============================================================================
|
||||
|
||||
(elpaca treesit-auto) ; automatically install treesitter grammars
|
||||
(elpaca treesit-fold) ; folding based on treesit
|
||||
(elpaca highlight-quoted) ; emacs
|
||||
(elpaca highlight-defined) ; emacs
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
;; Tree-sitter & LSP tweaks (Core transformative changes)
|
||||
|
||||
(use-package treesit-auto
|
||||
:functions global-treesit-auto-mode
|
||||
:config
|
||||
(treesit-auto-add-to-auto-mode-alist 'all)
|
||||
:hook (after-init . global-treesit-auto-mode)
|
||||
:custom
|
||||
(treesit-auto-install 'prompt)
|
||||
)
|
||||
|
||||
(use-package treesit-fold
|
||||
:defer t
|
||||
:commands (treesit-fold-close
|
||||
@@ -27,7 +18,8 @@
|
||||
(set-face-attribute 'treesit-fold-replacement-face nil
|
||||
:foreground "#808080"
|
||||
:box nil
|
||||
:weight 'bold))
|
||||
:weight 'bold)
|
||||
)
|
||||
|
||||
;; Tree-sitter hooks
|
||||
(dolist (hook '(c-ts-mode-hook c++-ts-mode-hook java-ts-mode-hook rust-ts-mode-hook go-ts-mode-hook ruby-ts-mode-hook js-ts-mode-hook typescript-ts-mode-hook tsx-ts-mode-hook css-ts-mode-hook html-ts-mode-hook bash-ts-mode-hook cmake-ts-mode-hook dockerfile-ts-mode-hook json-ts-mode-hook toml-ts-mode-hook yaml-ts-mode-hook))
|
||||
@@ -43,9 +35,8 @@
|
||||
|
||||
|
||||
(defvar my/lsp-mode-hooks
|
||||
'(c-mode-hook
|
||||
c++-mode-hook
|
||||
c-ts-mode-hook
|
||||
;List of major mode hooks to enable LSP.
|
||||
'(c-ts-mode-hook
|
||||
c++-ts-mode-hook
|
||||
typescript-ts-mode-hook
|
||||
js-ts-mode-hook
|
||||
@@ -53,8 +44,8 @@
|
||||
arduino-mode-hook
|
||||
toml-ts-mode-hook
|
||||
json-ts-mode-hook
|
||||
python-mode-hook)
|
||||
"List of major mode hooks to enable LSP.")
|
||||
python-ts-mode-hook)
|
||||
)
|
||||
|
||||
(dolist (hook my/lsp-mode-hooks)
|
||||
(add-hook hook #'lsp-deferred))
|
||||
|
||||
Reference in New Issue
Block a user