mirror of
https://oauth2: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@github.com/m1ngsama/chopsticks.git
synced 2026-05-10 19:10:59 +08:00
docs: update README, QUICKSTART, CHANGELOG for v1.2.0
- README: one-liner curl install as primary method, updated Requirements table to reflect auto-install capability, expanded Installation section with 11-step installer description - QUICKSTART: Step 1 now leads with curl one-liner, includes traditional and --yes variants - CHANGELOG: add v1.2.0 entry covering all robustness and get.sh changes
This commit is contained in:
parent
8820d1d107
commit
b20bedaa8b
3 changed files with 90 additions and 31 deletions
38
CHANGELOG.md
38
CHANGELOG.md
|
|
@ -4,6 +4,44 @@ All notable changes to chopsticks are documented here.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## [1.2.0] - 2026-04-09
|
||||||
|
|
||||||
|
Installer robustness overhaul and one-command bootstrap.
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- **`get.sh`** — one-command bootstrap: `curl -fsSL .../get.sh | bash`
|
||||||
|
- Installs `git` if missing (apt / pacman / dnf / brew)
|
||||||
|
- Clones repo to `~/.vim`; `git pull` if already present
|
||||||
|
- `exec bash install.sh </dev/tty` — interactive prompts work correctly even when piped from curl
|
||||||
|
- **Network connectivity check** — warns early if `github.com` is unreachable
|
||||||
|
- **`curl` preflight** — detects missing curl, auto-installs or dies with clear instructions
|
||||||
|
- **`git` preflight** — same as curl
|
||||||
|
- **`vim` auto-install** — attempts `pkg_install` before dying if vim is not found
|
||||||
|
- **`sudo` availability check** — authenticates once upfront; `--yes` mode skips sudo gracefully with a warning
|
||||||
|
- **macOS Homebrew installer** — offers to install Homebrew when `brew` is missing on macOS
|
||||||
|
- **Node.js via nvm** — when Node.js is missing, offers to install nvm + Node.js LTS automatically
|
||||||
|
- **Python 3 installer** — offers to install python3 via package manager when missing
|
||||||
|
- **`safe_download()`** helper — verifies downloads are non-empty and not HTML error pages (guards against GitHub 404 / rate-limit pages being silently treated as binaries)
|
||||||
|
- **`pkg_install()`** helper — unified cross-platform install (brew / apt / pacman / dnf)
|
||||||
|
- **`arch_github()` / `arch_linux_x64()`** helpers — normalize `uname -m` including `aarch64` → `arm64`
|
||||||
|
- **`trap on_error ERR`** — catches unexpected failures, shows line number and debug command
|
||||||
|
- **`trap EXIT`** — cleans up temp files (`/tmp/chopsticks-hadolint`, `/tmp/chopsticks-marksman`)
|
||||||
|
- **Symlink verification** — confirms `[[ -L ]]` after `ln -sf`
|
||||||
|
- **vim-plug fallback** — if curl download fails, falls back to `git clone`; verifies file is non-empty
|
||||||
|
- **`vim +PlugInstall` error handling** — warns on non-zero exit instead of silent continue
|
||||||
|
- **Screen-dark notice** — informs user before each Vim fullscreen step (PlugInstall, CocInstall)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- `set -e` → `set -eo pipefail` — pipeline failures now propagate correctly
|
||||||
|
- `ask()` now reads from `/dev/tty` with a test-open check (`{ true </dev/tty; }`) — interactive prompts work under `curl | bash` and non-interactive SSH sessions fall back to "no" safely
|
||||||
|
- Binary downloads (hadolint, marksman) use named temp files and `safe_download()` instead of bare curl
|
||||||
|
- Arch architecture detection handles `aarch64` in addition to `arm64`
|
||||||
|
- System tools section checks `HAS_SUDO` before running apt / pacman / dnf commands
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## [1.1.1] - 2026-04-09
|
## [1.1.1] - 2026-04-09
|
||||||
|
|
||||||
Systematic absorption of best practices from amix/vimrc, tpope/vim-sensible,
|
Systematic absorption of best practices from amix/vimrc, tpope/vim-sensible,
|
||||||
|
|
|
||||||
|
|
@ -39,17 +39,27 @@ Once in Normal mode, press `,?` to open a cheat sheet covering everything else.
|
||||||
|
|
||||||
## Step 1: Install
|
## Step 1: Install
|
||||||
|
|
||||||
|
**One command — works on macOS and Linux:**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -fsSL https://raw.githubusercontent.com/m1ngsama/chopsticks/main/get.sh | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
This clones the repo to `~/.vim` and runs the full installer. Interactive prompts
|
||||||
|
let you choose which optional tools to install (ripgrep, Node.js, Python tools, etc.).
|
||||||
|
|
||||||
|
The installer automatically handles missing dependencies — it will offer to install
|
||||||
|
`git`, Homebrew (macOS), or Node.js via nvm if they are not found.
|
||||||
|
|
||||||
|
**Traditional install:**
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/m1ngsama/chopsticks.git ~/.vim
|
git clone https://github.com/m1ngsama/chopsticks.git ~/.vim
|
||||||
cd ~/.vim && ./install.sh
|
cd ~/.vim && ./install.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
The script handles everything: symlinks, vim-plug, plugins, and all tools.
|
**Non-interactive (CI / server / scripting):**
|
||||||
It detects your OS (macOS/Debian/Arch/Fedora) and installs what it can automatically.
|
|
||||||
|
|
||||||
**Non-interactive (CI / server):**
|
|
||||||
```bash
|
```bash
|
||||||
./install.sh --yes
|
curl -fsSL https://raw.githubusercontent.com/m1ngsama/chopsticks/main/get.sh | bash -s -- --yes
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
||||||
63
README.md
63
README.md
|
|
@ -15,8 +15,7 @@
|
||||||
[](#language-support)
|
[](#language-support)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/m1ngsama/chopsticks.git ~/.vim
|
curl -fsSL https://raw.githubusercontent.com/m1ngsama/chopsticks/main/get.sh | bash
|
||||||
cd ~/.vim && ./install.sh
|
|
||||||
```
|
```
|
||||||
|
|
||||||
> **New to Vim?** Read [Step 0 in QUICKSTART.md](QUICKSTART.md#step-0-vim-basics) first —
|
> **New to Vim?** Read [Step 0 in QUICKSTART.md](QUICKSTART.md#step-0-vim-basics) first —
|
||||||
|
|
@ -56,54 +55,66 @@ cd ~/.vim && ./install.sh
|
||||||
|
|
||||||
| Tool | Minimum | Role |
|
| Tool | Minimum | Role |
|
||||||
|------|---------|------|
|
|------|---------|------|
|
||||||
| Vim | **8.0+** | Required |
|
| Vim | **8.0+** | Required — `install.sh` installs it if missing |
|
||||||
| git | any | Cloning and vim-fugitive |
|
| git | any | Required — `install.sh` installs it if missing |
|
||||||
| curl | any | vim-plug bootstrap |
|
| curl | any | Required — `install.sh` installs it if missing |
|
||||||
| Node.js | 14.14+ | Optional — enables CoC LSP (recommended) |
|
| Node.js | 14.14+ | Optional — enables CoC LSP; `install.sh` offers nvm install |
|
||||||
| ripgrep | any | Optional — enables `,rg` / `,rG` project search |
|
| ripgrep | any | Optional — enables `,rg` / `,rG` project search |
|
||||||
| fzf | any | Optional — enables `Ctrl+p` fuzzy finder |
|
| fzf | any | Optional — enables `Ctrl+p` fuzzy finder |
|
||||||
| ctags | any | Optional — enables `,tt` tag browser |
|
| ctags | any | Optional — enables `,tt` tag browser |
|
||||||
| tmux | 1.8+ | Optional — enables seamless pane navigation |
|
| tmux | 1.8+ | Optional — enables seamless pane navigation |
|
||||||
|
|
||||||
All optional tools are installed automatically by `install.sh` when prompted.
|
`install.sh` detects your environment and installs missing dependencies automatically.
|
||||||
|
On macOS it will offer to install Homebrew if not present. On any platform it will
|
||||||
|
offer to install Node.js via nvm if missing.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
### Automatic (recommended)
|
### One command (recommended)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -fsSL https://raw.githubusercontent.com/m1ngsama/chopsticks/main/get.sh | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
This bootstrap script clones the repo to `~/.vim`, then runs the full installer.
|
||||||
|
It works correctly even when piped from curl — interactive prompts use `/dev/tty`.
|
||||||
|
|
||||||
|
For non-interactive or CI environments:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -fsSL https://raw.githubusercontent.com/m1ngsama/chopsticks/main/get.sh | bash -s -- --yes
|
||||||
|
```
|
||||||
|
|
||||||
|
### Traditional (git clone)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/m1ngsama/chopsticks.git ~/.vim
|
git clone https://github.com/m1ngsama/chopsticks.git ~/.vim
|
||||||
cd ~/.vim
|
cd ~/.vim && ./install.sh
|
||||||
./install.sh
|
|
||||||
```
|
```
|
||||||
|
|
||||||
The installer handles everything in sequence:
|
### What the installer does
|
||||||
|
|
||||||
1. Verifies Vim 8.0+ and detects OS / package manager
|
1. **Preflight** — checks network, detects OS and package manager, verifies or installs `curl`, `git`, and `vim`
|
||||||
2. Backs up any existing `~/.vimrc` with a timestamp
|
2. **sudo** — authenticates once upfront; gracefully skips system packages when unavailable
|
||||||
3. Symlinks `~/.vimrc → ~/.vim/.vimrc` and `~/.vim/coc-settings.json`
|
3. **macOS** — offers to install Homebrew if `brew` is not found
|
||||||
4. Installs vim-plug and runs `:PlugInstall`
|
4. **Node.js** — offers to install via nvm if not found (falls back to vim-lsp if declined)
|
||||||
5. Optionally installs system tools (ripgrep, fzf, ctags, shellcheck, hadolint, marksman)
|
5. **Python** — offers to install Python 3 if missing; bootstraps pip3 if only python3 is present
|
||||||
6. Optionally installs language tools (npm, pip, Go)
|
6. **Symlinks** — backs up any existing `~/.vimrc` with a timestamp, then symlinks `~/.vimrc → ~/.vim/.vimrc`
|
||||||
7. Optionally installs CoC language server extensions
|
7. **Plugins** — installs vim-plug and runs `:PlugInstall` (with a progress notice during the black-screen period)
|
||||||
8. Optionally configures tmux for seamless pane navigation
|
8. **System tools** — ripgrep, fzf, ctags, shellcheck, hadolint, marksman (verified downloads)
|
||||||
|
9. **Language tools** — npm formatters, pip formatters/linters, Go tools
|
||||||
|
10. **CoC extensions** — all language servers in one step
|
||||||
|
11. **tmux** — optionally appends vim-tmux-navigator bindings to `~/.tmux.conf`
|
||||||
|
|
||||||
**Supported platforms:** macOS (Homebrew), Debian/Ubuntu (apt), Arch Linux (pacman), Fedora (dnf).
|
**Supported platforms:** macOS (Homebrew), Debian/Ubuntu (apt), Arch Linux (pacman), Fedora (dnf).
|
||||||
|
|
||||||
Use `--yes` for non-interactive or CI environments:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./install.sh --yes
|
|
||||||
```
|
|
||||||
|
|
||||||
### Manual
|
### Manual
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/m1ngsama/chopsticks.git ~/.vim
|
git clone https://github.com/m1ngsama/chopsticks.git ~/.vim
|
||||||
ln -sf ~/.vim/.vimrc ~/.vimrc
|
ln -sf ~/.vim/.vimrc ~/.vimrc
|
||||||
ln -sf ~/.vim/coc-settings.json ~/.vim/coc-settings.json
|
|
||||||
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
|
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
|
||||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||||
vim +PlugInstall +qall </dev/null
|
vim +PlugInstall +qall </dev/null
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue