Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[![macOS](https://github.com/long-910/dotfiles/actions/workflows/macos.yml/badge.svg)](https://github.com/long-910/dotfiles/actions/workflows/macos.yml)
[![ShellCheck](https://github.com/long-910/dotfiles/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/long-910/dotfiles/actions/workflows/shellcheck.yml)
[![License](https://img.shields.io/github/license/long-910/dotfiles)](https://github.com/long-910/dotfiles/blob/main/LICENSE)
[![Sponsor](https://img.shields.io/badge/Sponsor-GitHub-pink?logo=github)](https://github.com/sponsors/long-910)

[English](README.md) | [日本語](README.ja.md) | [中文](README.zh.md)

Expand All @@ -14,7 +15,27 @@ macOS・Ubuntu・WSL 向け開発環境セットアップスクリプト集で

## クイックスタート

### bootstrap.sh(推奨)
### ワンライナーインストール(curl)

1コマンドでクローンしてインタラクティブインストーラーを起動:

```bash
curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash
```

すべてを非インタラクティブにインストールする場合:

```bash
curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash -s -- --all
```

リポジトリは `~/.dotfiles` にクローンされます。`DOTFILES_DIR` で変更可能:

```bash
DOTFILES_DIR=~/my-dotfiles curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash
```

### bootstrap.sh(git clone)

インタラクティブメニューで機能ブロックを選択してインストール。

Expand Down Expand Up @@ -83,6 +104,14 @@ bash bootstrap.sh --list # モジュール一覧表示
| [jq](https://jqlang.github.io/jq/) | コマンドライン JSON プロセッサ |
| [lazygit](https://github.com/jesseduffield/lazygit) | git のターミナル UI |

### ターミナルマルチプレクサ

| ツール | 説明 |
|-------|------|
| [tmux](https://github.com/tmux/tmux) | ターミナルマルチプレクサ。ログイン時に自動起動し、tmux 終了でシェルも終了 |

新しいターミナルを開くと tmux が自動的に起動し、`main` という名前のセッションにアタッチ(なければ作成)します。tmux を終了するとシェルも終了します。無効にするには `~/.zshrc.d/tmux.zsh` を削除してください。

### ファイル管理

| ツール | 説明 |
Expand Down
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[![macOS](https://github.com/long-910/dotfiles/actions/workflows/macos.yml/badge.svg)](https://github.com/long-910/dotfiles/actions/workflows/macos.yml)
[![ShellCheck](https://github.com/long-910/dotfiles/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/long-910/dotfiles/actions/workflows/shellcheck.yml)
[![License](https://img.shields.io/github/license/long-910/dotfiles)](https://github.com/long-910/dotfiles/blob/main/LICENSE)
[![Sponsor](https://img.shields.io/badge/Sponsor-GitHub-pink?logo=github)](https://github.com/sponsors/long-910)

[English](README.md) | [日本語](README.ja.md) | [中文](README.zh.md)

Expand All @@ -14,7 +15,27 @@ Select and install only the feature blocks you need via an interactive menu.

## Quick Start

### bootstrap.sh (Recommended)
### One-line install (curl)

Clone and run the interactive installer in one command:

```bash
curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash
```

To install everything non-interactively:

```bash
curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash -s -- --all
```

The repository is cloned to `~/.dotfiles`. Set `DOTFILES_DIR` to override the location:

```bash
DOTFILES_DIR=~/my-dotfiles curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash
```

### bootstrap.sh (git clone)

Select feature blocks from an interactive menu.

Expand Down Expand Up @@ -83,6 +104,14 @@ bash bootstrap.sh --list # List modules
| [jq](https://jqlang.github.io/jq/) | Command-line JSON processor |
| [lazygit](https://github.com/jesseduffield/lazygit) | Terminal UI for git |

### Terminal Multiplexer

| Tool | Description |
|------|-------------|
| [tmux](https://github.com/tmux/tmux) | Terminal multiplexer. Auto-starts on login; exit tmux to close the shell |

tmux starts automatically when you open a new terminal and attaches to (or creates) a session named `main`. Closing tmux also exits the shell. To disable, remove `~/.zshrc.d/tmux.zsh`.

### File Management

| Tool | Description |
Expand Down
31 changes: 30 additions & 1 deletion README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
[![macOS](https://github.com/long-910/dotfiles/actions/workflows/macos.yml/badge.svg)](https://github.com/long-910/dotfiles/actions/workflows/macos.yml)
[![ShellCheck](https://github.com/long-910/dotfiles/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/long-910/dotfiles/actions/workflows/shellcheck.yml)
[![License](https://img.shields.io/github/license/long-910/dotfiles)](https://github.com/long-910/dotfiles/blob/main/LICENSE)
[![Sponsor](https://img.shields.io/badge/Sponsor-GitHub-pink?logo=github)](https://github.com/sponsors/long-910)

[English](README.md) | [日本語](README.ja.md) | [中文](README.zh.md)

Expand All @@ -14,7 +15,27 @@

## 快速开始

### bootstrap.sh(推荐)
### 一键安装(curl)

用一条命令克隆并启动交互式安装程序:

```bash
curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash
```

非交互式安装所有模块:

```bash
curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash -s -- --all
```

仓库将克隆到 `~/.dotfiles`,可通过 `DOTFILES_DIR` 自定义路径:

```bash
DOTFILES_DIR=~/my-dotfiles curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash
```

### bootstrap.sh(git clone)

通过交互式菜单选择功能模块进行安装。

Expand Down Expand Up @@ -82,6 +103,14 @@ bash bootstrap.sh --list # 列出所有模块
| [jq](https://jqlang.github.io/jq/) | 命令行 JSON 处理器 |
| [lazygit](https://github.com/jesseduffield/lazygit) | git 的终端 UI |

### 终端复用器

| 工具 | 说明 |
|------|------|
| [tmux](https://github.com/tmux/tmux) | 终端复用器。登录时自动启动;退出 tmux 同时退出 Shell |

打开新终端时 tmux 会自动启动,并附加到名为 `main` 的会话(不存在则创建)。关闭 tmux 时 Shell 也会一并退出。如需禁用,请删除 `~/.zshrc.d/tmux.zsh`。

### 文件管理

| 工具 | 说明 |
Expand Down
15 changes: 15 additions & 0 deletions dotfiles/.zshrc.d/tmux.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# shellcheck shell=bash
# Auto-start tmux when opening a new terminal.
# - If any session exists, attach to the most recent one.
# - Otherwise, create a new session.
# - When tmux exits, the shell (and terminal window) also exits.
# Skip if: already inside tmux, tmux not installed, or VSCode terminal.
if command -v tmux >/dev/null 2>&1 \
&& [ -z "${TMUX:-}" ] \
&& [ "${TERM_PROGRAM:-}" != "vscode" ]; then
if tmux list-sessions >/dev/null 2>&1; then
exec tmux attach-session
else
exec tmux new-session
fi
fi
26 changes: 26 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# install.sh — One-line installer for long-910/dotfiles
# Usage: curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash
# curl -fsSL https://raw.githubusercontent.com/long-910/dotfiles/main/install.sh | bash -s -- --all
set -euo pipefail

DOTFILES_DIR="${DOTFILES_DIR:-$HOME/.dotfiles}"
REPO="https://github.com/long-910/dotfiles.git"

echo "=> Installing long-910/dotfiles into ${DOTFILES_DIR}"

if [ -d "${DOTFILES_DIR}/.git" ]; then
echo "=> Repository already exists — pulling latest changes"
git -C "${DOTFILES_DIR}" pull --ff-only
else
echo "=> Cloning repository"
git clone --depth=1 "${REPO}" "${DOTFILES_DIR}"
fi

# When piped from curl, stdin is the pipe (not a TTY).
# Redirect from /dev/tty so the interactive menu can read keyboard input.
if [ ! -t 0 ] && [ -c /dev/tty ]; then
exec bash "${DOTFILES_DIR}/bootstrap.sh" "$@" </dev/tty
else
exec bash "${DOTFILES_DIR}/bootstrap.sh" "$@"
fi
1 change: 1 addition & 0 deletions modules/core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,5 @@ _deploy_core_configs() {
deploy_config ".zshrc" "${HOME}/.zshrc"
deploy_config ".tmux.conf" "${HOME}/.tmux.conf"
deploy_config ".emacs.el" "${HOME}/.emacs.el"
deploy_zshrc_d "tmux.zsh"
}
Loading