8000 GitHub - deifactor/tsx-mode.el: a batteries-included Emacs major mode for Typescript, Javascript, TSX, and JSX files
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

deifactor/tsx-mode.el

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tsx-mode.el: a batteries-included major mode for TSX/JSX files

use lsp-mode for code analysis and completion, tree-sitter for highlighting and indentation, and some godawful hacks for CSS-in-JS support. Aims to provide proper JSX/TSX indentation and syntax highlighting as well as some fancy features related to CSS-in-JS.

Screenshot:

Installation

  1. Dependencies: Emacs 27 (or, better, 28.1+) with the following packages installed:
  1. Install: download this package and place tsx-mode.el inside a directory on your load-path.

or install this repository (and all its package dependencies) via straight.el: (straight-use-package '(tsx-mode :type git :host github :repo "orzechowskid/tsx-mode.el"))

  1. Require: (require 'tsx-mode)
  2. Enable: (tsx-mode t)

Keybindings

all tsx-mode keybindings live under the C-c t prefix.

Binding Command Function
C-c t f toggle code-folding for current CSS-in-JS region tsx-mode-css-toggle-fold
C-c t F toggle code-folding for all CSS-in-JS regions tsx-mode-css-toggle-fold-all
C-c t c toggle code-coverage overlay tsx-mode-coverage-toggle

Configuration

Useful variables are members of the tsx-mode customization group and can be viewed and modified with the command M-x customize-group [RET] tsx-mode [RET].

You may also want to customize variables in the coverlay customization group if you enable code coverage.

Bugs and limitations

tons!

  • lsp-mode is currently the only supported LSP client.
  • TS/TSX indentation might not be quite right. (if you notice something, please open an issue against tsi.el)
  • CSS indentation might not be quite right either. (if you notice something, please open an issue against this repo)
  • only a couple of CSS-in-JS formats are currently supported.
  • CSS fontification relies on a feature introduced in Emacs 28.1, so on Emacs 27 CSS fragments won't be fontified.

License

GPLv3. see LICENSE in the top level of this repository.

About

a batteries-included Emacs major mode for Typescript, Javascript, TSX, and JSX files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 100.0%
0