GitHub Codespaces用の包括的なdotfiles設定集です。Bash/Zsh両対応で、快適な開発環境を素早く構築できます。
- Bash/Zsh両対応: どちらのシェルでも同じように使える設定
 - Codespaces最適化: GitHub Codespaces環境を自動検出して最適化
 - VSCode統合: VSCodeとシームレスに連携
 - Git強化: 便利なGitエイリアスとカラフルな表示
 - 美しいプロンプト: Starshipによるカスタマイズ可能なプロンプト
 - 日本語コメント: すべての設定に日本語の説明付き
 - 簡単インストール: 1コマンドでセットアップ完了
 
| ファイル | 説明 | 
|---|---|
.bashrc | 
Bash設定(エイリアス、プロンプト、環境変数) | 
.zshrc | 
Zsh設定(エイリアス、プロンプト、環境変数、補完) | 
.profile | 
シェル共通の環境変数設定 | 
.gitconfig | 
Git設定(エイリアス、カラー、diff/merge設定) | 
.gitignore_global | 
グローバルなgitignore設定 | 
.vimrc | 
Vim設定(キーバインド、カラースキーム) | 
.tmux.conf | 
tmux設定(キーバインド、ステータスバー) | 
.config/starship.toml | 
Starshipプロンプト設定 | 
install.sh | 
自動インストールスクリプト | 
- 
GitHub Codespacesの設定で dotfiles を有効化
- GitHubの Settings → Codespaces → Dotfiles
 - このリポジトリ (
ctxzz/dotfiles-codespaces) を指定 - "Install dotfiles automatically" をチェック
 
 - 
新しいCodespaceを作成すると自動的に適用されます
 
# リポジトリをクローン
git clone https://github.com/ctxzz/dotfiles-codespaces.git ~/.dotfiles
# インストールスクリプトを実行
cd ~/.dotfiles
./install.sh
# シェルを再起動するか、設定を再読み込み
source ~/.bashrc  # Bashの場合
source ~/.zshrc   # Zshの場合./install.sh# 既存ファイルを上書き
./install.sh --force
# 既存ファイルをバックアップしてからインストール
./install.sh --backup
# 最小限のインストール(外部ツールなし)
./install.sh --minimal
# ヘルプを表示
./install.sh --helpGitHub Codespacesは、リポジトリに .devcontainer/devcontainer.json がある場合、自動的にdotfilesをインストールします。
{
  "dotfilesRepository": "ctxzz/dotfiles-codespaces",
  "dotfilesInstallCommand": "install.sh",
  "dotfilesTargetPath": "~/dotfiles"
}既存のCodespaceでdotfilesを適用する場合:
# リポジトリをクローン
git clone https://github.com/ctxzz/dotfiles-codespaces.git ~/.dotfiles
# インストール
cd ~/.dotfiles
./install.sh --force
# シェルを再起動
exec $SHELLこのdotfilesは以下のCodespaces環境変数を自動的に検出して設定を最適化します:
CODESPACES: Codespaces環境であることを示すCODESPACE_NAME: Codespacesの名前VSCODE_GIT_IPC_HANDLE: VSCode統合GITHUB_TOKEN: GitHub認証トークン
主な設定内容:
- 履歴管理: 大きな履歴サイズ、重複削除
 - エイリアス: Git、Docker、ファイル操作の便利なショートカット
 - 関数: ディレクトリ作成・移動、ファイル展開、検索など
 - プロンプト: Starshipによる美しいプロンプト
 - ツール統合: fzf、GitHub CLI、nvm
 
主な機能:
- 豊富なエイリアス: 
git s(status),git lg(グラフ表示ログ) など - カラー出力: 見やすい色分け
 - diff/merge設定: VSCodeとの統合
 - 自動設定: プル時のrebase、プッシュ時のタグ追従
 
主な機能:
- 行番号表示: 絶対/相対行番号
 - シンタックスハイライト: コード編集を見やすく
 - Viスタイルキーバインド: 効率的な編集
 - ファイルタイプ別設定: 言語ごとの最適なインデント
 
主な機能:
- Ctrl+a プレフィックス: 使いやすいプレフィックスキー
 - Vimスタイルキーバインド: ペイン移動がhjklで可能
 - マウス操作: マウスでペイン選択やリサイズが可能
 - 美しいステータスバー: 時刻、セッション名などを表示
 
主な機能:
- Git情報: ブランチ、ステータス、差分を表示
 - 言語バージョン: Node.js、Python、Rustなどのバージョンを表示
 - 実行時間: コマンドの実行時間を表示
 - Codespaces統合: Codespace名を表示
 
g       # git
gs      # git status
ga      # git add
gc      # git commit
gp      # git push
gl      # git pull
gd      # git diff
gco     # git checkout
gb      # git branch
glog    # git log --oneline --graph --decorate --allgit s       # status --short --branch
git lg      # 美しいグラフ表示のログ
git cm      # commit -m
git ca      # commit --amend
git last    # 最新のコミットを表示
git cleanup # マージ済みブランチを削除
git today   # 今日のコミットを表示d       # docker
dc      # docker-compose
dps     # docker ps
dimg    # docker imagesmkcd <dir>       # ディレクトリを作成して移動
extract <file>   # 各種圧縮ファイルを展開
fif <text>       # ファイル内のテキストをfzfで検索
gcof             # Gitブランチをfzfで選択してチェックアウト
killp            # プロセスをfzfで選択してkill..      # cd ..
...     # cd ../..
....    # cd ../../..
.....   # cd ../../../..dotfilesをカスタマイズする場合は、各ファイルの最後に追加するか、別ファイルを作成してください:
# ~/.bashrc.local を作成して個人設定を追加
echo 'export MY_VAR="my_value"' >> ~/.bashrc.local
# .bashrc の最後に以下を追加
if [ -f ~/.bashrc.local ]; then
    source ~/.bashrc.local
fiユーザー情報を設定:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"~/.config/starship.toml を編集してプロンプトをカスタマイズ:
# シンプルなプロンプトに変更
[character]
success_symbol = "[➜](bold green)"
error_symbol = "[➜](bold red)".vimrc でカラースキームを変更:
" カラースキームを変更
colorscheme desert
" または
colorscheme molokai- Git: バージョン管理
 - Bash or Zsh: シェル
 
- 
Starship: 美しいプロンプト
curl -sS https://starship.rs/install.sh | sh - 
fzf: ファジーファインダー
# Ubuntu/Debian sudo apt-get install fzf # macOS brew install fzf
 - 
ripgrep: 高速検索ツール
# Ubuntu/Debian sudo apt-get install ripgrep # macOS brew install ripgrep
 
- tmux: ターミナルマルチプレクサ
 - vim: テキストエディタ
 - GitHub CLI (gh): GitHubとの統合(Codespacesには標準装備)
 - Docker: コンテナ管理
 
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y tmux vim git curl wget
# macOS
brew install tmux vim git# 実行権限を確認
chmod +x install.sh
# Bashで直接実行
bash install.sh# バックアップを取ってからインストール
./install.sh --backup
# または強制的に上書き
./install.sh --force# Starshipがインストールされているか確認
which starship
# インストールされていない場合
curl -sS https://starship.rs/install.sh | sh
# .bashrc または .zshrc を再読み込み
source ~/.bashrc  # または source ~/.zshrc# .gitconfigが正しくリンクされているか確認
ls -la ~/.gitconfig
# グローバルなgitignoreを設定
git config --global core.excludesfile ~/.gitignore_global# undoディレクトリを作成
mkdir -p ~/.vim/undo# tmuxがインストールされているか確認
which tmux
# 設定ファイルの構文エラーをチェック
tmux source-file ~/.tmux.conf- GitHub Settings → Codespaces → Dotfiles でリポジトリが正しく設定されているか確認
 - Codespacesを再作成してみる
 - 手動でインストールスクリプトを実行
 
cd ~
git clone https://github.com/ctxzz/dotfiles-codespaces.git .dotfiles
cd .dotfiles
./install.sh --forceMIT License