Commit graph

15 commits

Author SHA1 Message Date
0ba2e84e0c fix: correct 13 bugs across .vimrc, install.sh, and docs
.vimrc:
- Fix syntax=OFF no-op in large file handler (syntax= is correct)
- Fix <leader>rG broken -F flag (new RgWord command with -F before --)
- Fix :Gdiff → :Gdiffsplit (fugitive v3+ compat)
- Fix go_def_mode/go_info_mode conflicting with go_gopls_enabled=0
- Fix <leader>m prefix collision with mt/mp (renamed to <leader>ms)
- Wrap PlugInstall autocmd in augroup (prevent doubling on re-source)

install.sh:
- Guard against empty version string in hadolint/marksman downloads
- Add HAS_SUDO check in _do_binary_apt before sudo mv
- Add PlugClean warning when existing plugins directory is non-empty
- Fix pkg_install brew-first priority (macOS-only now, Linux fallback)
- Fix menu double-draw flicker on first render
- Fix Fedora deselected tools not tracked in SKIPPED array

docs:
- Remove nonexistent nvm install step from README
- Fix TOC description (side window, not quickfix) in README/QUICKSTART
- Fix TTY detection description (add dumb, empty, builtin)
- Add missing ,cd and ,wa mappings to README
- Remove dead CoC formatOnSaveFiletypes from coc-settings.json
2026-04-15 09:57:26 +08:00
0b3f631e98 fix: correct non-TTY vim-plug install; add real plugin count check
- _vim_run non-TTY branch: remove </dev/null (caused "Error reading
  input, exiting" before downloads finished → 0 plugins installed) and
  >/dev/null (broke async job callbacks → partial install of ~13/26).
  Now only redirects stderr; stdin inherits from caller so vim's event
  loop runs to completion.
- Add post-install verification: count ~/.vim/plugged entries and die
  if empty, replacing the unconditional "ok Plugins installed" that
  masked failures silently.
- .vimrc, install.sh, QUICKSTART.md, README.md: carry forward the full
  v1.2 rewrite (checkbox module selection, solarized palette, LSP
  stack) that accumulated in the previous session.

Tested: macOS (27 plugins, exit 0) and Arch Linux SSH (26 plugins,
exit 0). shellcheck: zero warnings.
2026-04-10 18:43:52 +08:00
716e7e5808 fix: silence fzf post-install hook false-positive exit code 2026-04-09 22:57:42 +08:00
a605185a2e fix: use TERM=dumb+/dev/null for non-interactive vim runs, eliminating escape sequence leakage 2026-04-09 22:53:53 +08:00
b2b1632857 fix: terminal garble, black screen on startup, Unicode in header
.vimrc:
- TTY detection: add empty($TERM) and dumb — fixes black screen when
  TERM is unset (non-interactive SSH, minimal environments)
- Replace StartifyHeader() with a static ASCII list — removes the
  synchronous system('git ...') call that caused the black screen while
  vim waited for git before rendering, and removes Unicode block chars
  (███╗) that rendered as garbage on terminals without full UTF-8

install.sh:
- _vim_run() helper: uses </dev/tty when accessible so vim properly
  manages the alternate screen buffer and restores terminal state on
  exit — this was the root cause of garbled output after PlugInstall
  and CocInstall steps; falls back to --not-a-term for CI environments
- Remove 'screen may go dark' warning — no longer needed since terminal
  state is properly managed via /dev/tty

Remove CHANGELOG.md — use git log
2026-04-09 22:48:55 +08:00
8820d1d107 fix: use test-open for /dev/tty instead of -e check
[[ -e /dev/tty ]] returns true even in non-interactive SSH sessions
where the device file exists but cannot actually be opened, causing
'No such device or address' errors. Replace with { true </dev/tty; }
which tests actual openability before redirecting.
2026-04-09 22:32:04 +08:00
825633d623 feat: robust installer with preflight checks, one-command get.sh
install.sh:
- set -eo pipefail + trap ERR with line number and debug hint
- Network connectivity check before any downloads
- curl and git preflight: auto-install or die with clear instructions
- vim auto-install attempt before dying
- sudo availability check (one-time auth, graceful skip when unavailable)
- macOS: offer to install Homebrew if missing
- Node.js: offer nvm install if missing (with fallback to vim-lsp)
- Python3: offer install if missing
- ask() reads from /dev/tty — interactive prompts work under curl | bash
- safe_download(): verifies file non-empty and not an HTML error page
- pkg_install(): unified cross-platform helper (brew/apt/pacman/dnf)
- arch_github()/arch_linux_x64(): normalize uname -m (handles aarch64)
- Temp files cleaned up via EXIT trap
- Symlink creation verified after ln -sf
- vim-plug: fallback to git clone if curl fails; verify file non-empty
- vim +PlugInstall: warn on failure instead of silent continue
- Binary downloads (hadolint, marksman) use named temp files

get.sh (new):
- One-command bootstrap: curl | bash
- Installs git if missing
- Clones repo to ~/.vim (or git pull if already present)
- exec bash install.sh </dev/tty so interactive prompts work correctly
2026-04-09 13:59:30 +08:00
23ad2e5b7a feat: ergonomics overhaul, tmux integration, and beginner onboarding (v1.1.0)
Keybindings:
- Add jk → Esc in insert mode (ergonomic escape)
- Add Ctrl+s save in normal and insert mode
- Add // visual search (very-nomagic escaped)
- Add <leader>p/P clipboard paste
- Add <leader>rG ripgrep word under cursor (-F literal)
- Add <leader>u / <leader>tt as leader aliases for F5/F8
- Fix ALE [e/]e navigation direction (was reversed)
- Remove dead <C-h/j/k/l> maps (owned by vim-tmux-navigator)
- Remove <leader>pp (duplicate of F2, caused 500ms delay on <leader>p)

Plugins:
- Add vim-tmux-navigator for seamless Vim/tmux pane navigation
- Fix <leader>rG: pass -F so regex metacharacters don't corrupt matches
- Fix LargeFileSettings: disable ALE for files >10MB

In-Vim UX:
- Add ,? cheat sheet (read-only buffer, q to close)
- ALE lint triggers: normal/enter/insert-leave now active

install.sh:
- Add tmux.conf auto-configuration step with C-l warning
- Add post-install survival guide for first-time Vim users

Docs:
- README: full badge row (release, stars, issues, last-commit, PRs, plugins, languages)
- README: Contributing section with bug/PR guidelines
- QUICKSTART: Step 0 — Vim modes and 4 survival commands for beginners
- CHANGELOG: v1.1.0 entry
2026-04-09 12:20:10 +08:00
3daf725ad8
audit: wrap loose autocmds in augroups, fix install.sh robustness (#13)
.vimrc:
- Wrap all loose autocmds in named augroups with autocmd! (prevents
  doubling on :source $MYVIMRC): ChopstickTabHistory, ChopstickResize,
  ChopstickStdin, CocHighlight, ChopstickCleanup, ChopstickFiletype,
  ChopstickTTYLargeFile, ChopstickWhichKey, ChopstickStartify

install.sh:
- Add Arch Linux (pacman) branch for system tools
- Add hadolint to system tools (brew/apt binary download/pacman)
- Add staticcheck to Go tools
- Add yamllint to pip tools
- Remove sqlfmt from npm (SQL unified to sqlfluff via pip)
- Remove coc-marksman (package does not exist on npm)
- Add coc-settings.json symlink step with backup
- Add pip3 bootstrap when python3 present but pip3 absent
- Fix PlugInstall and CocInstall to use </dev/null (TTY-safe)

coc-settings.json:
- New file: configures marksman as Markdown LSP server for CoC
  (replaces the broken coc-marksman npm package approach)
2026-03-29 16:36:43 +08:00
d8eee9dc23
install.sh: automate linter/formatter installation (fixes #10)
Rewrite install.sh from a tool-listing script into an actual installer.
Tools are now installed automatically in grouped, prompted steps.

New sections:
- System tools (ripgrep, fzf, ctags, shellcheck, marksman)
  macOS: brew | Debian/Ubuntu: apt | Fedora: dnf
  marksman on Linux: auto-downloads binary from GitHub releases

- npm tools (prettier, markdownlint-cli, stylelint,
  stylelint-config-standard, eslint, typescript, sqlfmt)

- Python tools (black, isort, flake8, pylint, sqlfluff)

- Go tools (gopls, goimports)
  Adds GOPATH/bin to PATH for the session; warns if not in shell profile

- CoC language server extensions (unchanged, now last step)

Other changes:
- --yes flag for non-interactive/CI installs
- try_install / pip_install / npm_install / go_install helpers with
  already-installed detection to avoid redundant reinstalls
- End-of-run summary: Installed / Skipped / Failed lists
- Symlink step now always points to $SCRIPT_DIR/.vimrc (the repo),
  ensuring the right version is always linked regardless of clone path
2026-03-29 11:42:11 +08:00
43baa9753a
Expand LSP and lint coverage for full-stack development languages (#7)
ALE linters:
- Add css/scss: stylelint
- Add markdown: markdownlint
- Add sql: sqlfluff

ALE fixers:
- Add scss, less: prettier
- Add sql: sqlfmt

vim-lsp fallback (no Node.js path):
- Add html, css, scss, json, yaml: vscode language servers
- Add markdown: marksman
- Add sql: sqls

install.sh (CoC path):
- Add coc-go, coc-rust-analyzer, coc-marksman, coc-sql to auto-install
- Expand optional tools section with stylelint, markdownlint, sqlfluff, marksman
2026-03-28 18:30:19 +08:00
323bf4a6b3
LSP 分层后端、UI 增强、UX 修复与完整文档
合并 PR #5:tiered LSP backend (CoC/vim-lsp), vim-which-key, vim-startify, indentLine, 修复按键冲突,UX 改进。
2026-02-21 12:30:06 +08:00
0e61537142 Fix critical installation and configuration bugs
This commit addresses multiple issues discovered during code review:

1. Fix variable definition order in .vimrc
   - Move g:is_tty and g:has_true_color definitions to top of file
   - Previously used at line 32 but defined at line 263
   - Ensures variables are available before first use

2. Remove duplicate configuration settings in .vimrc
   - Remove duplicate set number, wildmenu, ruler
   - Remove duplicate search settings (ignorecase, smartcase, hlsearch, incsearch)
   - Remove duplicate backspace and wildignore settings
   - Reduces file size and eliminates confusion

3. Enhance install.sh reliability
   - Add directory validation to ensure script runs from ~/.vim
   - Add symlink validation after creation
   - Fix CoC installation command syntax (vim -c to vim +)
   - Move helper functions before usage
   - Prevents symlink-to-self errors

4. Improve installation documentation
   - Add warnings in README.md about running from correct directory
   - Add IMPORTANT notes in QUICKSTART.md
   - Update installation step descriptions
   - Prevents common user installation mistakes

These fixes improve installation reliability and prevent configuration errors.
2025-12-30 09:53:14 +08:00
Claude
0ea76e6ae7
Remove all icons and emojis - keep it simple (KISS principle)
Changes:
- Replaced checkmarks with plain text in README.md
- Replaced emoji icons with [OK] in install.sh
- Changed ALE error/warning signs from unicode to ASCII (X and !)
- Removed rocket emoji from QUICKSTART.md
- All output now uses simple ASCII characters

Follows KISS (Keep It Simple, Stupid) principle for better:
- Terminal compatibility
- Accessibility
- Readability in all environments
- No font dependencies
2025-12-30 00:29:35 +00:00
Claude
2941614b45
工程化优化:添加快速安装脚本和企业级开发功能
新增功能:
 一键安装脚本 (install.sh)
  - 自动备份现有配置
  - 自动安装 vim-plug
  - 自动安装所有插件
  - 可选安装 CoC 语言服务器
  - 美化的安装界面和详细提示

 快速开始指南 (QUICKSTART.md)
  - 5分钟上手教程
  - 常用工作流程示例
  - 语言特定配置说明
  - 故障排除指南
  - 快速参考卡片

配置增强:
📦 新增插件
  - vim-obsession: 会话管理
  - vim-prosession: 项目会话
  - vim-unimpaired: 便捷的括号映射
  - targets.vim: 额外的文本对象
  - vim-snippets: 代码片段集合

🛠️ 工程化特性
  - 项目特定配置支持 (.vimrc in project root)
  - 大文件自动优化 (>10MB)
  - 终端集成 (,tv, ,th)
  - 会话自动保存
  - 父目录自动创建

⌨️ 新增快捷键
  Git 工作流:
    ,gs - Git status
    ,gc - Git commit
    ,gp - Git push
    ,gl - Git pull
    ,gd - Git diff
    ,gb - Git blame

  工程实用工具:
    ,ev - 编辑 .vimrc
    ,sv - 重载 .vimrc
    ,F  - 格式化整个文件
    ,wa - 保存所有缓冲区
    ,cp - 复制文件路径
    ,cf - 复制文件名
    ,*  - 搜索并替换光标下的单词
    ,,  - 切换到上一个文件

  窗口管理:
    ,=  - 增大窗口高度
    ,-  - 减小窗口高度
    ,+  - 增大窗口宽度
    ,_  - 减小窗口宽度

🌐 语言支持增强
  新增语言配置:
    - Rust (rustfmt, cargo)
    - Shell (shellcheck)
    - YAML (yamllint)
    - Docker (hadolint)
    - HTML/CSS (prettier)
    - Markdown (spell check, prettier)

  改进的 ALE 配置:
    - 更多语言的 linters
    - 优化的性能设置
    - 详细错误显示 (,ad)

🔍 增强的 FZF 集成
  - 改进的预览窗口
  - Git 文件搜索命令
  - 更好的 Ripgrep 集成
  - 自定义布局

📝 NERDTree 优化
  - 自动打开项目目录
  - 忽略 node_modules, __pycache__ 等
  - 可配置窗口大小

文档改进:
📚 README.md 重大更新
  - 添加快速开始章节
  - 详细的工程特性说明
  - 完整的键位映射表
  - 项目配置示例
  - 会话管理说明
  - 大文件处理说明
  - 终端集成文档

适用场景:
 企业级开发团队
 多语言项目
 大型代码库
 持续集成环境
 远程开发
 代码审查

性能优化:
 大文件自动禁用重度功能
 ALE 按需 lint (不在输入时)
 优化的语法高亮
 更快的启动时间
2025-12-30 00:17:46 +00:00