refactor: typed autocmd/highlight wrappers (shino.autocmd, shino.highlight) - #16
Merged
Merged
Conversation
Mirror shino.keymap for two more raw-API surfaces: - shino.autocmd: `autocmd(event, desc, opts)` forces a self-documenting desc; `group(name)` is a cleared-augroup shorthand. opts borrows vim.api.keyset.create_autocmd. - shino.highlight: `set(name, val)` drops the `0` namespace boilerplate; `extend(name, base, val)` folds the get_hl + merge pattern. val borrows vim.api.keyset.highlight. Callers migrate in following commits. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace raw nvim_create_autocmd/nvim_create_augroup calls with the typed wrappers across autocmds.lua, lsp/init.lua, vimtex.lua, and copilot.lua. Each now carries a required desc (the BufEnter and LspAttach ones were previously undocumented). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replace raw nvim_set_hl calls with the typed wrappers: - vim-options CursorLineNr and the catppuccin TelescopeSelection highlight (converted from a `:highlight` command string) use hl.set. - copilot's ComplHint/ComplHintMore use hl.extend, folding the get_hl + tbl_extend pattern. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the two new typed wrappers to the Custom Modules section, alongside shino.keymap. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extend the
shino.keymappattern to two more raw-API surfaces, then migrate every call site (full migration, matching the keymap precedent).New modules
lua/shino/autocmd.luaautocmd(event, desc, opts)—descrequired (self-documenting);optsborrowsvim.api.keyset.create_autocmd.group(name)— cleared-augroup shorthand.lua/shino/highlight.luaset(name, val)— drops the0namespace;valborrowsvim.api.keyset.highlight.extend(name, base, val)— define a group by inheritingbaseand mergingval(folds theget_hl+tbl_extendpattern).Migrated sites
autocmds.lua,lsp/init.lua(×2),vimtex.lua,copilot.lua(+ itsCopilotAttachaugroup). TheBufEnterandLspAttachones gained descriptions.vim-options.lua(CursorLineNr),catppuccin.lua(TelescopeSelection, converted from a:highlightcommand string),copilot.lua(ComplHint/ComplHintMoreviaextend).No raw
nvim_create_autocmd/nvim_set_hlremain outside the wrapper modules. No behavior change.Test
bin/check(headless startup): OKvim.api.keyset.*gives LuaLS field completion).🤖 Generated with Claude Code