Communitygithub.com

G1Joshi/Agent-Skills

Expert Vim assistance covering modal editing, .vimrc configuration, registers, macros, search/replace, and plugin management via vim-plug. Use when editing text efficiently in terminal environments, writing Vimscript, recording macros, or configuring core Vim settings.

Agent-Skills 是什麼?

Agent-Skills is a Cursor agent skill that expert Vim assistance covering modal editing, .vimrc configuration, registers, macros, search/replace, and plugin management via vim-plug. Use when editing text efficiently in terminal environments, writing Vimscript, recording macros, or configuring core Vim settings.

相容平台~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/G1Joshi/Agent-Skills/tree/HEAD/skills/tools/vim

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Vim

Vim is the universal text editor installed on every UNIX system. While Neovim innovates, Vim focuses on backward compatibility and stability.

When to Use

  • Universal Server & System Editing: Editing system configs, scripts, and code on any Unix/Linux server without installing external software.
  • Modal Text Manipulation: Composing text transformations with operator-motion grammar (dap, ci", gUiw).
  • Headless Macro Automation: Recording and replaying repetitive editing operations across hundreds of lines (qa, @a).
  • Git Commit & Merge Editing: Fast interactive editing for commit messages, interactive rebases, and diff conflict resolution.

Quick Start

1. Minimal ~/.vimrc

syntax on
set number
set relativenumber
set tabstop=2
set shiftwidth=2
set expandtab
set hlsearch
set incsearch
set clipboard=unnamed

let mapleader = " "
nnoremap <leader>w :w<CR>
nnoremap <leader>q :q<CR>

2. Core Editing Commands

  • i / a: Insert mode (before / after cursor)
  • ci": Change inside quotes
  • da{: Delete around curly braces
  • :%s/foo/bar/g: Replace all occurrences of foo with bar in file
  • . : Repeat last modification

Core Concepts

Modern Production Vimrc (~/.vimrc)

Configuring sensible defaults, plugin manager, and code navigation:

" ~/.vimrc
set nocompatible
filetype plugin indent on
syntax on

" General settings
set number
set relativenumber
set expandtab
set shiftwidth = 2
set tabstop = 2
set autoindent
set smartindent
set hlsearch
set incsearch
set ignorecase
set smartcase
set hidden
set backspace=indent,eol,start
set updatetime=300
set clipboard=unnamed

" Leader key mapping
let mapleader = " "

" Fast split navigation
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l

" Clear search highlight
nnoremap <leader>h :nohlsearch<CR>

Essential Text Objects & Grammar

Combining operators (d, c, y, v) with text objects and motions:

ci"      - Change inside double quotes ("foo" -> "")
di(      - Delete inside parentheses
yap      - Yank (copy) around paragraph
gUiw     - Convert inner word to UPPERCASE
dt,      - Delete from cursor until comma
.        - Repeat last change immediately

Macro Recording & Execution

Automating repetitive tabular data transformations:

1. Press `qa` to start recording macro into register 'a'
2. Perform text editing steps (e.g. `0iconst <Esc>A = true;<Esc>j`)
3. Press `q` to finish recording
4. Replay macro on current line: `@a`
5. Replay macro 50 times across lines: `50@a`
6. Run macro on visual selection: `:'<,'>normal @a`

Common Patterns

Macro Recording and Bulk Execution

Problem: Perform repetitive multi-step edits across multiple lines.
Solution: Record keystrokes into register q.

  1. Place cursor at target start position.
  2. Press qq to start recording to register q.
  3. Perform editing sequence (e.g. I" <Esc> A",<Esc> j ^).
  4. Press q to stop recording.
  5. Replay with @q, or run across 50 lines: 50@q.

Plugin Management with vim-plug

Problem: Install and organize Vim plugins without manual path manipulation.
Solution: Use vim-plug.

call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-fugitive'
Plug 'preservim/nerdtree'
call plug#end()

Run :PlugInstall inside Vim to install.

Best Practices (2026)

  • Do master modal navigation (h, j, k, l, w, b, e) and avoid reaching for arrow keys.
  • Do leverage Text Objects (ciw, da(, yi{) to edit structured code blocks with minimal keystrokes.
  • Do use the dot command (.) to repeat recent text transformations across similar lines.
  • Do enable set hidden so buffers can stay open in the background without forcing immediate saves.
  • Don't install hundreds of heavy legacy VimScript plugins; transition to Neovim Lua if a rich IDE experience is required.
  • Don't leave swap files (.swp) lingering; configure set noswapfile or set a dedicated swap directory.
  • Don't use synchronous external calls in ~/.vimrc that cause noticeable startup delay on remote machines.

Troubleshooting

Error / SymptomCauseSolution
System clipboard copy fails ("+y does nothing)Vim compiled without +clipboard supportInstall vim-gtk3 (Ubuntu) or macvim / neovim with clipboard support enabled.
Arrow keys insert A, B, C, D charactersRunning in strict Vi compatible modeAdd set nocompatible at top of ~/.vimrc.
Trailing whitespace highlighting persists after searchHighlight search remained activePress :nohlsearch or bind <leader>h :nohlsearch<CR>.

References

Individual skills in this repo

This repo contains 11 individual skills — each has its own dedicated page.

G1Joshi/Agent-Skills

Expert Dask distributed computing assistance covering Dask DataFrames, Arrays, Futures, and cluster scaling. Use when analyzing datasets too large for pandas on a single machine or multi-node cluster.

G1Joshi/Agent-Skills

Expert dbt (data build tool) assistance covering SQL modeling, Jinja macros, tests, documentation, and semantic layer. Use when building analytics engineering pipelines on BigQuery, Snowflake, or PostgreSQL.

G1Joshi/Agent-Skills

Expert JAX assistance covering Autograd, XLA compilation (`jit`), vectorization (`vmap`), and parallelization (`pmap`). Use when building high-performance numerical computing and cutting-edge deep learning research.

G1Joshi/Agent-Skills

Expert Ray distributed computing assistance covering Ray Core (actors, tasks), Ray Train, Ray Tune, and Ray Serve. Use when scaling Python compute and ML training across multi-node clusters.

G1Joshi/Agent-Skills

Expert Git version control assistance covering branching, interactive rebase, cherry-pick, submodules, worktrees, and conflict resolution. Use when managing source code history and collaboration workflows.

G1Joshi/Agent-Skills

Expert K9s CLI assistance covering terminal Kubernetes cluster navigation, real-time log streaming, port forwarding, and pod debugging. Use when managing and troubleshooting Kubernetes clusters with speed.

G1Joshi/Agent-Skills

Expert SWC assistance covering high-performance Rust-based JavaScript/TypeScript compilation, .swcrc configuration, Jest testing via @swc/jest, and minification. Use when replacing Babel with SWC for faster builds, accelerating test execution, or compiling modern ECMAScript features.

G1Joshi/Agent-Skills

Expert Tig assistance covering text-mode interface for Git, interactive staging, commit graph visualization, diff exploration, and blame navigation. Use when navigating Git commit history in the terminal, staging hunks interactively, browsing file changes, or reviewing revisions.

G1Joshi/Agent-Skills

Expert Zed editor assistance covering high-performance Rust-based text editing, multi-buffer editing, language server protocols (LSP), and AI assistant integrations. Use when configuring Zed settings.json, setting up language extensions, collaborating in real-time channels, or optimizing editor startup speed.

G1Joshi/Agent-Skills

Expert Zsh assistance covering shell customization, Oh My Zsh plugins, Zinit plugin manager, prompt engineering (Starship/Powerlevel10k), and shell scripting. Use when configuring .zshrc, writing Zsh automation scripts, optimizing shell startup time, or configuring tab-completion.

G1Joshi/Agent-Skills

Expert [skill-name] assistance covering [feature 1], [feature 2], and [feature 3]. Use when [working with X], [debugging Y], or [implementing Z].

相關技能