1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

VScode 言語によってtabキーを押下したときのスペース数を変える

Posted at

概要

VScodeにて開いているファイルのプログラミング言語によってtabキーを押下したときに入力される半角スペース数を変える方法を簡単にまとめる。

方法

  1. setting.jsonを開く

  2. 下記の内容を追記する。

    "[言語]": {
        "editor.tabSize": タブ押下1回で入力される半角スペース数,
        "editor.insertSpaces": 半角スペースとして入力するか(trueの場合)、tab文字として入力するか(falseの場合)
    },
    
  3. 筆者はPHPのコードを書くことが多いので、デフォルトの設定を半角スペース4個に設定し、下記の様に必要になったら半角スペース2個の設定を追記していっている。

    setting.json
    "[blade]": {
        "editor.tabSize": 2,
        "editor.insertSpaces": true
    },
    "[json]": {
        "editor.tabSize": 2,
        "editor.insertSpaces": true
    },
    "[yaml]": {
        "editor.tabSize": 2,
        "editor.insertSpaces": true
    },
    "[javascript]": {
        "editor.tabSize": 2,
        "editor.insertSpaces": true
    },
    
1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?