
caps-word.nvim
github.com/dmtrkovalenko/caps-word.nvim- Category
- Developer Tools
- Rank
- No. 1941Tools index
- Pricing
- Open Source
- Type
- TOOL
- Use case
- Coding
- Interfaces
- Editor Extension
- Builder
- dmtrkovalenko
- GitHub
- 18 stars
- Latest release
- 1.0.0
- Date
About
Neovim plugin: a much better way to type SCREAMING_SNAKE_CASE — caps-lock for the duration of one word, then releases.
What it does
After a keybinding activates the mode, it intercepts inserted characters and uppercases those accepted by Vim’s word rules. A hyphen can become an underscore automatically. Spaces, punctuation, other non-word input, or leaving insert mode return typing to normal.
Why it's ranked here
This is a focused convenience with unusually sensible editor awareness. State belongs to each buffer, insert-mode keybindings remain intact, and termination follows Vim’s configurable idea of a word. The implementation is compact, documented, and checked on stable and nightly Neovim, though the supplied test tree shows only its harness.
What's good
The stopping rule respects the editor’s keyword configuration instead of imposing a fixed character list. Optional number handling and a custom matching expression cover different constant styles. Activation and deactivation callbacks support notifications or status-line feedback, while buffer-local state behaves predictably when moving among splits.
Tradeoffs
The plugin supplies no built-in visual indicator, so visible state requires callback configuration. Its purpose is deliberately narrow: inserted character conversion, automatic underscore substitution, and mode termination. The supplied repository text includes a test runner and continuous integration, but no behavioral test specifications. One configuration path for disabling number support also appears inconsistent in the implementation.
How to use it well
Give it a convenient insert-mode keybinding if you regularly write constants or macro-style names in Neovim. Keep automatic underscore conversion enabled for fast hyphen-based typing, and add callbacks when hidden mode state feels risky. It does not replace firmware-level caps behavior across applications or provide general text case transformations.
Technical notes+
lua/caps-word/module.lua installs buffer-scoped InsertCharPre and InsertLeave autocommands in the CapsWord augroup, stores state in vim.b[bufnr].caps_word_active, rewrites vim.v.char, and invokes configured callbacks. lua/caps-word.lua exposes setup and toggle, merging options with vim.tbl_deep_extend. Its default matcher selection reads config.enable_numbers_in_caps rather than the merged M.config.enable_numbers_in_caps, so setting enable_numbers_in_caps = false without a custom match_word_string still selects \K. Makefile invokes Plenary Busted through tests/minimal_init.lua; among the supplied files, no behavioral specification appears under tests/. .github/workflows/lint-test.yml runs StyLua plus the test target against stable and nightly Neovim. .github/workflows/release.yml publishes tagged releases through LuaRocks.
Observed
- License
- MIT License
- Primary language
- Lua
- Platform
- Neovim 0.8.0 or newer
- Install surface
- Neovim plugin managers, with documented lazy.nvim configuration and optimization for lazy loading
- Interface
- Lua plugin module with setup and toggle entry points
- Packaging
- Tagged releases are configured for upload to LuaRocks
- Verification
- Continuous integration checks StyLua and runs the Plenary Busted test target on stable and nightly Neovim
- Test structure
- The supplied tests tree contains a minimal Plenary initialization harness but no behavioral test specification
Read from README.md, Makefile, LICENSE, .stylua.toml, lua/caps-word.lua, doc/caps-word-docs.txt, tests/minimal_init.lua, lua/caps-word/module.lua, .github/workflows/docs.yml, .github/workflows/release.yml, .github/workflows/lint-test.yml, .github/ISSUE_TEMPLATE/bug_report.yml, .github/ISSUE_TEMPLATE/feature_request.yml.
What it can do
Enable caps lock for single word typing
User keystroke or command → Temporary caps lock state for one word
Automatically release caps lock after word completion
Word boundary detection (space, punctuation, etc.) → Normal typing mode restored
Type SCREAMING_SNAKE_CASE variable names
Regular text input while caps-word mode is active → Uppercase text with underscores preserved
Preserve underscore characters during caps typing
Underscore keypress in caps-word mode → Literal underscore character without mode exit
Integrate caps-word functionality into Neovim workflow
Neovim editor session → Enhanced text input capabilities within the editor
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.