M emacs.org => emacs.org +33 -20
@@ 1422,6 1422,14 @@ erc is a cool irc client for emacs
(erc-update-modules))
#+END_SRC
+** Screenshot
+Sharing pictures of code is useful, why not build that into Emacs.
+
+#+BEGIN_SRC emacs-lisp
+(use-package screenshot
+ :straight (:host github :repo "tecosaur/screenshot"))
+#+END_SRC
+
** System Packages
Although Guix has a really cool emacs package to manage packages, I'm
not always on Guix. This is the next best thing for every other
@@ 2006,32 2014,37 @@ with them.) This is my configuration for JS, TS, React, and whatever
else I'll eventually need.
#+BEGIN_SRC emacs-lisp
- (use-package web-mode
- :mode "\\.tsx\\'"
- :custom
- (web-mode-markup-indent-offset 2)
- (web-mode-css-indent-offset 2)
- (web-mode-code-indent-offset 2)
- (web-mode-enable-auto-quoting nil)
- (web-mode-attr-indent-offset 2)
- (web-mode-attr-value-indent-offset 2))
-
- (use-package rjsx-mode
- :mode "\\.js.*$")
+(use-package typescript-mode
+ :hook (typescript-mode . (lambda () (electric-indent-local-mode -1) (setq-local create-lockfiles nil)))
+ :init
+ (define-derived-mode typescript-tsx-mode typescript-mode "tsx")
+ :config
+ (setq typescript-indent-level 2)
+ (add-to-list 'auto-mode-alist '("\\.tsx?\\'" . typescript-tsx-mode)))
- (use-package typescript-mode)
+(use-package tree-sitter
+ :hook ((typescript-mode . tree-sitter-hl-mode)
+ (typescript-tsx-mode . tree-sitter-hl-mode)))
- (use-package json-mode
- :mode "\\.json$")
+(use-package tree-sitter-langs
+ :after tree-sitter
+ :config
+ (tree-sitter-require 'tsx)
+ (add-to-list 'tree-sitter-major-mode-language-alist '(typescript-tsx-mode . tsx)))
- (use-package prettier-js
- :config
- (setq prettier-js-show-errors nil))
+(use-package rjsx-mode
+ :hook (rjsx-mode . (lambda () (electric-indent-local-mode -1) (setq-local create-lockfiles nil)))
+ :mode "\\.js.*$")
- (flycheck-add-mode 'typescript-tslint 'web-mode)
+(use-package json-mode
+ :mode "\\.json$")
- (add-hook 'rjsx-mode-hook #'(lambda () (electric-indent-local-mode -1)))
+(use-package prettier-js
+ :hook ((typescript-mode typescript-tsx-mode rjsx-mode json-mode css-mode html-mode) . prettier-js-mode)
+ :config
+ (setq prettier-js-show-errors nil))
#+END_SRC
+
*** MIT/GNU Scheme
I don't see any projects these days done in MIT/GNU Scheme, but to
work through SICP and Software Design for Flexibility in it is great!
M init.el => init.el +25 -15
@@ 995,6 995,9 @@
(erc-services-mode 1)
(erc-update-modules))
+(use-package screenshot
+ :straight (:host github :repo "tecosaur/screenshot"))
+
(use-package system-packages
:custom
(system-packages-package-manager 'paru) ;; For Arch
@@ 1364,32 1367,36 @@
(use-package clojure-mode)
(use-package cider)
-(use-package web-mode
- :mode "\\.tsx\\'"
- :custom
- (web-mode-markup-indent-offset 2)
- (web-mode-css-indent-offset 2)
- (web-mode-code-indent-offset 2)
- (web-mode-enable-auto-quoting nil)
- (web-mode-attr-indent-offset 2)
- (web-mode-attr-value-indent-offset 2))
+(use-package typescript-mode
+ :hook (typescript-mode . (lambda () (electric-indent-local-mode -1) (setq-local create-lockfiles nil)))
+ :init
+ (define-derived-mode typescript-tsx-mode typescript-mode "tsx")
+ :config
+ (setq typescript-indent-level 2)
+ (add-to-list 'auto-mode-alist '("\\.tsx?\\'" . typescript-tsx-mode)))
+
+(use-package tree-sitter
+ :hook ((typescript-mode . tree-sitter-hl-mode)
+ (typescript-tsx-mode . tree-sitter-hl-mode)))
+
+(use-package tree-sitter-langs
+ :after tree-sitter
+ :config
+ (tree-sitter-require 'tsx)
+ (add-to-list 'tree-sitter-major-mode-language-alist '(typescript-tsx-mode . tsx)))
(use-package rjsx-mode
+ :hook (rjsx-mode . (lambda () (electric-indent-local-mode -1) (setq-local create-lockfiles nil)))
:mode "\\.js.*$")
-(use-package typescript-mode)
-
(use-package json-mode
:mode "\\.json$")
(use-package prettier-js
+ :hook ((typescript-mode typescript-tsx-mode rjsx-mode json-mode css-mode html-mode) . prettier-js-mode)
:config
(setq prettier-js-show-errors nil))
-(flycheck-add-mode 'typescript-tslint 'web-mode)
-
-(add-hook 'rjsx-mode-hook #'(lambda () (electric-indent-local-mode -1)))
-
(use-package geiser-mit)
(use-package macrostep-geiser
@@ 1409,6 1416,9 @@
(use-package flycheck-kotlin
:disabled)
+(use-package android-mode
+ :disabled)
+
(use-package scala-mode
:mode "\\.s\\(cala\\|bt\\)$"
:disabled)