LoginSignup
1
1

More than 1 year has passed since last update.

Spacemacsのtypescript-tsx-modeでインデント幅を設定する方法

Posted at

挙動

  • 複数行を選択し = でインデントの実行をした場合には4spaceでインデントされる
  • 1行ごとに == でインデントを実行した場合には2spaceでインデントされる。

ezgif.com-gif-maker.gif

System Info :computer:

  • OS: darwin
  • Emacs: 27.2
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. f5bd49cc8)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: hybrid
  • Completion: ivy
  • Layers:
 lsp
 (javascript :variables js-indent-level 2)
 (html :variables web-mode-code-indent-offset 2 
  web-mode-markup-indent-offset 2 
  web-mode-css-indent-offset 2 
  web-mode-script-padding 2)
 (typescript :variables typescript-indent-level 2)

修正方法

dotspacemacs/user-config に下記を追加。

(with-eval-after-load 'lsp-mode
  (add-to-list 'lsp--formatting-indent-alist '(typescript-tsx-mode . typescript-indent-level)))

調査ログ

1
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1