google-vimscript-style

Applies Google's Vimscript style guide when writing or reviewing Vimscript code.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/chughtapan/google-guide-skills --skill google-vimscript-style-chughtapan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: google-vimscript-style
Source: https://github.com/chughtapan/google-guide-skills/tree/main/skills/google-vimscript-style
Command: npx skills add https://github.com/chughtapan/google-guide-skills --skill google-vimscript-style-chughtapan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Vimscript behavior depends heavily on user settings, making scripts fragile and non-portable. This Skill provides Google's official conventions for writing portable, maintainable Vimscript and Vim plugins. ## Core Features & Use Cases - Portability Rules: Enforces explicit regex prefixes (\m\C), case-sensitive matching operators (=~#, =~?), and normal! to avoid dependence on user settings. - Plugin Structure Guidance: Defines where functions, commands, autocommands, and mappings belong (autoload/, plugin/, ftplugin/) with correct [!] and [abort] modifiers. - Naming and Formatting Conventions: Covers scope-prefixed variables, naming patterns for plugins, functions, commands, and augroups, plus Python-like whitespace rules. - Use Case: When reviewing a Vim plugin pull request, use this Skill to check that autocommands live in uniquely named augroups, functions are autoloaded with [abort], and variables carry proper scope prefixes. ## Quick Start Review this Vimscript plugin file against Google's Vimscript style guide and list any violations.

Frequently Asked Questions about google-vimscript-style

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write portable Vimscript that works across user settings?

Prefix all regexes with \m\C, use the =~# or =~? operator families for string matching, and always use normal! instead of normal. These choices make behavior independent of the user's ignorecase, smartcase, magic, and mapping settings.

What is Google's Vimscript style guide for plugin structure?

Functions go in autoload/ defined with [!] and [abort], general commands go in plugin/commands.vim, filetype commands in ftplugin/, autocommands in plugin/autocmds.vim within uniquely named augroups, and mappings in plugin/mappings.vim.

Does this Vimscript guide apply to Neovim Lua configuration?

No. The guide explicitly excludes Lua-based Neovim code and even recommends avoiding other scripting languages like Lua and Ruby inside Vimscript, since the end user's Vim may lack support for them.

Why should I avoid :substitute in Vimscript plugins?

The :substitute command moves the cursor, prints error messages, and depends on local settings, making it fragile in scripts. Prefer built-in functions like search() that perform the same work with fewer side effects.

How should Vimscript variables be named and scoped?

Use variable_names_like_this and always prefix with scope: g: for global, s: for script-local, and a: for function arguments. The l: and v: prefixes are recommended for consistency in new code but not strictly required.