🙌

42用vscodeのエディタ設定

に公開

概要

42生向けの設定を保管。半分は自分が見る用。
追加が必要な場合は追加予定。

設定

設定名 概要 設定
Insert Final Newline 保存時に改行を末尾に挿入 on
Trim Trailing Whitespace 保存時に末尾の空白をトリミング on
Trim Final Newlines 保存時に最終行以降の新しい行をトリミング on
Insert Spaces Tabを押すとスペースが挿入される off

settings.json for user

{
    "files.trimTrailingWhitespace": true,
    "editor.insertSpaces": false,
    "files.insertFinalNewline": true,
    "files.trimFinalNewlines": true
}

おすすめ拡張機能

名前 機能概要 拡張機能ID
42 ft count line 関数の行数を数えてくれるinC DoKca.42-ft-count-line
42 Header 42ヘッダーを挿入してくれる kube.42header
C/C++ Extension Pack C開発関連の拡張機能一式 ms-vscode.cpptools-extension-pack
Code Spell Checker スペルミスチェック streetsidesoftware.code-spell-checker
Error Lens エラーを末尾に表示してくれる usernamehw.errorlens
Path Intellisense パスの予測変換 christian-kohler.path-intellisense
42 Norminette Highlighter(3.x) normエラーに赤でマーカー MariusvanWijk-JoppeKoers.codam-norminette-3

codeコマンドがあるマシンのみ以下のスクリプトでインストール・アンインストール可能(only Linux, Windows)
(プロファイルを設定している場合は、profnameにプロファイル名を入れる。)

インストールスクリプト例(zshで確認済み)

extensions=(
  DoKca.42-ft-count-line
  kube.42header
  ms-vscode.cpptools-extension-pack
  streetsidesoftware.code-spell-checker
  usernamehw.errorlens
  christian-kohler.path-intellisense
  MariusvanWijk-JoppeKoers.codam-norminette-3
)

install() {
  profname="$2"
  ext="$1"
  test -z "$ext" && return 1
  if [ -n "$profname" ]; then
    code --profile "$profname" --install-extension "$1"
  else
    code --install-extension $ext
  fi
}

profname=""
for ext in $extensions; do
  install "$ext" "$profname"
done

アンインストールスクリプト例(zshで確認済み)

extensions=(
  DoKca.42-ft-count-line
  kube.42header
  ms-vscode.cpptools-extension-pack
  streetsidesoftware.code-spell-checker
  usernamehw.errorlens
  christian-kohler.path-intellisense
  MariusvanWijk-JoppeKoers.codam-norminette-3
)

uninstall() {
  profname="$2"
  ext="$1"
  test -z "$ext" && return 1
  if [ -n "$profname" ]; then
    code --profile "$profname" --uninstall-extension "$1"
  else
    code --uninstall-extension $ext
  fi
}

profname=""
for ext in $extensions; do
  uninstall "$ext" "$profname"
done

追記

なし

Discussion