LoginSignup
35
19

More than 5 years have passed since last update.

GitHub 上のハードタブの表示幅を変える

Posted at

どうやるの

実は GitHub は EditorConfig の一部をネイティブサポートしています
EditorConfig のサイトから辿って知りました)

ということで、リポジトリに下記のような .editorconfig を置くとハードタブの表示幅が変更できます。

.editorconfig
root = true

[*]
indent_style = tab
indent_size  = tab

[*.txt]
tab_width = 4

[*.rb]
tab_width = 3

[*.js]
tab_width = 2

サンプルリポジトリも用意しました。このような表示が確認できます。

sample.txt.annotated.png

sample.rb.annotated.png

sample.js.annotated.png

さいごに

これは、Rebuild179: Rustacean (typester) を聴いていたら

  • GitHub でハードタブの表示幅を変えられるといいのに

といった話がでていたので 「それ、できますよ!」 といいたいだけのエントリでした :octocat:

( :microphone2: 29m00s あたりの話題です)

35
19
0

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
35
19