diff --git a/elementaryx-dev.el b/elementaryx-dev.el index 39aa6ffe550ba6e9d6c7c874c2c7489419228b2b..d3d2d856ab62c6182a7561e3a82433a782d215e7 100644 --- a/elementaryx-dev.el +++ b/elementaryx-dev.el @@ -1,24 +1,68 @@ ;;; elementaryx-full.el --- Further packaging of emacs elementaryx starter kit for HPC development and literate programming -*- lexical-binding: t; -*- -;; Copyright (C) 2023 Emmanuel Agullo +;; Copyright (C) 2023, 2024 Emmanuel Agullo ;; Author: Emmanuel Agullo <eagullo@tek11> ;; Keywords: emacs emacs-elementaryx emacs-starter-kit ide hpc (use-package elementaryx-dev-minimal) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; +;;; Built-in config for developers +;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (use-package emacs :config ;; Treesitter config + ;; Tell Emacs to prefer the treesitter mode + (setq major-mode-remap-alist + '( + ;; (yaml-mode . yaml-ts-mode) + (bash-mode . bash-ts-mode) + ;; (js2-mode . js-ts-mode) + ;; (typescript-mode . typescript-ts-mode) ;; No need for json-mode, we got with ts + ;; (json-mode . json-ts-mode) ;; No Need for json-mode, we go with ts + (css-mode . css-ts-mode) + (python-mode . python-ts-mode))) + :hook + ;; Auto parenthesis matching + ((prog-mode . electric-pair-mode))) + +(use-package emacs + :config + + ;; Treesitter config: remap classical mode to ts-mode (add-to-list 'major-mode-remap-alist '(bash-mode . bash-ts-mode)) (add-to-list 'major-mode-remap-alist '(bibtex-mode . bibtex-ts-mode)) (add-to-list 'major-mode-remap-alist '(c-mode . c-ts-mode)) (add-to-list 'major-mode-remap-alist '(c++-mode . c++-ts-mode)) (add-to-list 'major-mode-remap-alist '(c-or-c++-mode . c-or-c++-ts-mode)) - ;; (add-to-list 'major-mode-remap-alist '(cmake-mode . cmake-ts-mode)) - ;; (add-to-list 'major-mode-remap-alist '(julia-mode . julia-ts-mode)) - (add-to-list 'major-mode-remap-alist ' (python-mode . python-ts-mode))) + ;; (add-to-list 'major-mode-remap-alist '(html-mode . html-ts-mode)) + (add-to-list 'major-mode-remap-alist '(java-mode . java-ts-mode)) + (add-to-list 'major-mode-remap-alist '(javascript-mode . js-ts-mode)) + (add-to-list 'major-mode-remap-alist '(js-mode . js-ts-mode)) ;; + (add-to-list 'major-mode-remap-alist '(python-mode . python-ts-mode)) + + ;; Treesitter config: directly map to ts-mode + (add-to-list 'auto-mode-alist '("CMakeLists\\.txt\\'" . cmake-ts-mode)) + (add-to-list 'auto-mode-alist '("\\.cmake\\'" . cmake-ts-mode)) + (add-to-list 'auto-mode-alist '("\\Dockerfile\\'" . dockerfile-ts-mode)) + ;; (add-to-list 'auto-mode-alist '("\\.hs\\'" . haskell-ts-mode)) ;; TODO: inverstigate bug + ;; (add-to-list 'auto-mode-alist '("\\.lhs\\'" . haskell-ts-mode)) ;; TODO: inverstigate bug + ;; (add-to-list 'auto-mode-alist '("\\.jl\\'" . julia-ts-mode)) ;; TODO: inverstigate bug + (add-to-list 'auto-mode-alist '("\\.json\\'" . json-ts-mode)) + ;; (add-to-list 'auto-mode-alist '("\\.lua\\'" . lua-ts-mode)) ;; TODO: inverstigate bug + (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-ts-mode)) ;; TODO: inverstigate bug + (add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-ts-mode)) ;; TODO: inverstigate bug + ;; (add-to-list 'auto-mode-alist '("\\.php\\'" . php-ts-mode)) ;; TODO: inverstigate bug + (add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-ts-mode)) + (add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-ts-mode)) + ;; (add-to-list 'auto-mode-alist '("\\.ml\\'" . ml-ts-mode)) ;; TODO: not sure how to set it up with tree-sitter-ocaml + ;; (add-to-list 'auto-mode-alist '("\\.\\(e?ya?\\|ra\\)ml\\'" . yaml-ts-mode)) ;; https://issues.guix.gnu.org/66836 + ) ;; https://github.com/emacsmirror/rmsbolt (use-package rmsbolt