Repository navigation
Tidy-ups from #44: submodule scripts, late settings, terraform-ls - #152
Merged
Merged
Conversation
- set-submodule-branch: a missing submodule path now makes the run fail, and the gitlink the branch checkout moved is committed with .gitmodules. - mvsubmodule: drop the 2btested target; .vim/2btested no longer exists. - update-coc-extensions: add installed extensions to the .vimrc list instead of rebuilding it, so a machine without one no longer drops it. - docs/scripts.md follows. Refs #44 Co-Authored-By: AI Agent <noreply@harleypig.com>
- coc.vim: drop the <Tab>/<C-Space> branches for a completion plugin that is not installed, make CheckBackspace script-local, wrap the long <CR> mapping. - help.vim: autocmds in an augroup, so re-sourcing does not stack them. - maps.vim: <Leader>pp is nnoremap (in Visual mode it raised E481); remove the two unexplained commented-out blocks (diagnostic navigation and a terminal launcher). - xdg-settings.vim: CleanOldFiles is script-local; 'spellfile' points at the spell directory it already creates, instead of the checkout's .vim. - ftplugins: yaml.vim adds yamllint once; isort's poetry option and shfmt's options are buffer-local; vim.vim names the early ale.vim. - docs/json.md, docs/python.md, learning.txt follow. - tests/vim/tidy.bats covers each behaviour change. Refs #44 Co-Authored-By: AI Agent <noreply@harleypig.com>
- coc-settings.json: terraform-ls no longer lists the tf filetype, which is TinyFugue in Vim; vim-polyglot gives every *.tf terraform. - docs/hashicorp.md: terraform and terraform-ls come from HashiCorp, not the distribution's package manager (since #130). - .gitmodules: the one tab-indented line uses two spaces like the rest. - docs/plugins-to-try.md: fugitive-azure-devops links its web page. Refs #44 Co-Authored-By: AI Agent <noreply@harleypig.com>
harleypig
added a commit
that referenced
this pull request
Nov 4, 2026
…er (#155) * fix(settings): CustomFoldText is script-local (#44) The late fold.vim's fold-text function is now s:CustomFoldText(), and 'foldtext' is set with the s: form, which Vim (8.2.3908 and later) replaces with the function's <SNR> name. tests/vim/fold.bats checks for that name and that no global CustomFoldText() exists. Co-Authored-By: AI Agent <noreply@harleypig.com> * fix(settings): gutter toggles are script-local Normal-mode mappings (#44) ToggleLineNumbers and its sibling ToggleSigns in the late gutter.vim are now script-local, and <leader>ln and <leader>signs are nnoremap calls to <SID> versions. The old recursive map also defined them in Visual and Operator-pending mode, where the :call ran once per selected line. The docs name no mode for either, so they are unchanged. tests/vim/tidy.bats checks the mappings' modes, that neither function is global, and that each toggle still cycles as documented. Co-Authored-By: AI Agent <noreply@harleypig.com> * docs: drop the coc-ale-setup bullet on removed completion branches (#44) The <Tab> and <C-Space> mappings in the late coc.vim no longer check for a completion plugin that is not installed (removed in #152 - coc.vim tidy-ups), so the bullet saying they do is gone. Co-Authored-By: AI Agent <noreply@harleypig.com> * test(vim): colors, ale-settings and tidy use the shared launcher (#44) The three Vim test files added alongside #151 each carried their own copy of the headless-Vim launcher. They now load helpers/vim, set up with vim_fixture and start Vim with headless_vim, as every other file in tests/vim does. No test changes what it checks. Each file was seen to fail with one guarded behaviour broken: the Insert mode StatusLine colour (colors), g:ale_disable_lsp in the early ale.vim (ale-settings) and 'spellfile' (tidy). Co-Authored-By: AI Agent <noreply@harleypig.com> --------- Co-authored-by: AI Agent <noreply@harleypig.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.
Summary
The tidy-ups from #44 that were still open on
master, in three commits:fix(bin)set-submodule-branch: a submodule whose path is missing now makes therun fail. Before, it was skipped and the script still exited 0. The
gitlink that the branch checkout moves is now committed together with
.gitmodules, so nothing is left uncommitted.mvsubmodule: the2btestedtarget is gone, because.vim/2btestedno longer exists.
update-coc-extensions: it now adds the installed extensions to the.vimrclist and no longer rebuilds the list from scratch. Before, amachine that lacked an extension dropped it from the list for every
machine.
fix(settings)coc.vim: the<Tab>/<C-Space>branches for a completion pluginthat is not installed are removed.
CheckBackspaceis script-local.The long
<CR>mapping is wrapped.help.vim: the autocmds are in an augroup.maps.vim:<Leader>ppis nownnoremap. In Visual mode it raisedE481: No range allowed. Two commented-out blocks with no statedreason are removed.
xdg-settings.vim:CleanOldFilesis script-local.'spellfile'nowpoints into the spell directory this file already created. Before,
zgwrote into the checkout's.vim.yaml.vimadds yamllint only once. isort's poetry optionand shfmt's options are buffer-local.
fix(config)languageserver.terraformno longer lists thetffiletype (TinyFuguein Vim; vim-polyglot gives every
*.tftheterraformfiletype).docs/hashicorp.mdsays where terraform and terraform-ls actually comefrom.
.gitmodulesnow uses the same indentation on every line.docs/plugins-to-try.mdpoints toits web page.
Depends on #150 for two wording changes.
after/ftplugin/vim.vimnowsays the early
ale.vimsetsg:ale_disable_lsp, anddocs/json.mdnolonger says the late
ale.vimsets the JSONC fixer. Both statements becometrue once #150 removes the
.vimrcline and the lateale.vimfixer. Untilthen, the
vim.vimcomment is still true, because the earlyale.vimdoesset the flag. The
json.mdchange describes the state after #150.Refs #44
#44 checklist
envsubstitutehelp missing closing quoteenvsubstitute, SC1091dump-maps, shfmt incheck-setup/post-clonedump-maps, #121 removedenvsubstitute, shfmt clean since #95). Re-checked:shfmt -d bin/andshellcheck bin/*are cleandocs/proselint.mdconfig pathenvsubstitutehelp prints a FIXMEdocs/about-docs.mdline 152 over 78 columnsmaster. The only long lines left are table rows, which are exempt, and markdownlint passescoc.vimlong<CR>mapping.vimrcline 6 long (URL)addsubmodulesubstring duplicate checkupdate-coc-extensionsmalformed-JSON messagemvsubmodule2btestedtargetmvsubmodule"and updated readme" message.gitmodulestab vs spaces.gitlinkenvsubstitutewarnprints a literal'%s'envsubstituteSC2319post-clonepipx substring matchpost-clonenvm install has no failure checkpost-clone"did not complete" shown in greenenvsubstituteunuseddebug()g:ale_disable_lspset twiceg:ale_fixers.jsoncset twiceyaml.vimappends yamllint again each timeisort_auto_poetry/shfmt_optionsale#Var)docs/ansible.md/post-clonesay pipx ansible brings the linterspost-clonenow say it brings neithervim.vimstray comment over"let b:ale_fixersALEVirtualText*highlights.eslintrc.json'spellfile'never set'spellfile'now points into it)<leader>ppuses a recursivemapin every modemvsubmodule/rmsubmodulemessages and unexplained commented-out linesupdate-coc-extensionsignoresXDG_CONFIG_HOMEpost-clonenodejs startup file,dpkg -lupdate-coc-extensions.batsshfmt driftmaps.vimcommented-out diagnostic-navigation and terminal-launcher blocksc[/c]and<leader>q[/q]move through it)coc.vimbranches for an uninstalled completion plugintests/vim/oldfiles.batsname and headerhelp.vimautocmds outside an augroupafter/plugin/statusline.vimautocmdsCheckBackspace,CleanOldFilesglobalCustomFoldTextglobaltests/vim/oldfiles.batsassertsfoldtext=CustomFoldText(), and another PR this round is changing that file. The fix is a one-line pair,s:CustomFoldText()infold.vimplus that assertion, and should land after that PRToggleLineNumbersglobalplugin/gutter.vim, which is outside this PR's filescoc-settings.jsonterraformtffiletypeale.vimMarkdown TODOmvsubmodule2btested(repeat of 10)set-submodule-branchexits 0 on a missing path, leaves the gitlink uncommittedupdate-coc-extensionsdrops entries that are not installed.claude/TESTS.mddoes not say where helpers livedocs/hashicorp.md"via package manager"Items 37b and 37c are still open, so this PR says
Refs #44, notCloses.Decisions
set-submodule-branchcommits the gitlink. bin/ fixes: terraform install, submodule scripts, shared fixture, tidy-ups #141 left it for the userto commit. Round 2 of Small tidy-ups: envsubstitute help quote, old shell-lint warnings, proselint config path #44 asked for it to be committed. The commit names
only
.gitmodulesand the submodule's path, so anything else that isstaged stays uncommitted, as before.
update-coc-extensionsadds and never removes. The list says whatevery machine installs, so an extension missing from one machine is not a
reason to drop it. Removing an extension is now done by hand, and the
usage text and
docs/scripts.mdsay so. The list is still sorted, so onthe current
.vimrcthe first run moves@yaegassy/coc-ansibleto thetop, the same as the old script did. Only lines of the form
\ 'name',are read. A commented-out entry is not taken as an extension.tests/vim/xdg.batsexpects the directory, and leaving
'spellfile'empty sendszginto thecheckout.
maps.vimblocks: removed, not annotated. Diagnostic navigation isalready covered by the quickfix mappings. The terminal-launcher block
needed an external tool, and nothing referred to it.
Testing evaluation
Run by the author, to the qa-tester's standard (no
team-managed:sentinelhere).
wording, the
.gitmoduleswhitespace and the link change need none.The
coc-settings.jsonfiletype list has no test: the file is JSONC,and the suite does not test CoC configuration values (TESTS.md, grey
area).
tests/shell/set-submodule-branch.bats,mvsubmodule.bats,update-coc-extensions.batsand the newtests/vim/tidy.bats.and fails": red while the missing path is just
continued.only
.gitmodules..vim/2btestedbranch.here" and "adds the installed extensions…": red against the rebuild.
master. That covers theuninstalled-plugin branches and the global
CheckBackspace, are-source that stacks the help autocmds,
<Leader>ppin Visual mode,global
CleanOldFiles, an empty'spellfile', a duplicate yamllint,and the global isort/shfmt options. The backup-cleanup assertion was
also made red on purpose by raising the age to 900 days, then
restored.
were exercised through Vim started on
.vimrc.Manual verification
.vimrc.:set ft=yaml, then:echo b:ale_linters,:echo &spellfile,:map <Leader>ppand:help help.['yamllint']once. A spellfile under$XDG_DATA_HOME/vim/spell/en.utf-8.add.<Leader>pplisted fornonly. Help opens in a vertical split.
['yamllint', 'yamllint'], an empty spellfile, or anentry for every mode.
b:ale_linters:['yamllint'].<tmp>/d/vim/spell/en.utf-8.add.:map <Leader>pp:n \pp * :set paste!<CR>.:help help: two windows,helpfiletype.bin/mvsubmodule --helpandbin/set-submodule-branch --helpprintthe new usage text.
bin/update-coc-extensionson a copy of the real.vimrc, with onlycoc-json installed: exit 0, every entry kept, and the list sorted.
Test plan
bash -c "trap '' PIPE; exec bats tests/shell": 100 pass.bats tests/vim: 83 pass.shfmt -d bin/andshellcheck bin/*: clean.*.md: clean.Review
opt-out: no named review skill ran. The diff is a set of small tidy-ups,
and none of them can block or refuse work; the author's own read of the
diff stands in its place.
Points worth a second look:
update-coc-extensions;-- .gitmodules "$path"commit inset-submodule-branch;<SID>call in the<Tab><expr>mapping, also covered by theexisting coc.bats test that inserts a Tab at the start of a line.
Completion report
set-submodule-branchnow fails on a missing path,and
update-coc-extensionskeeps its existing failure messages.docs/scripts.md,docs/hashicorp.md,docs/python.md,docs/json.mdandlearning.txtare updated.docs/coc-ale-setup.mdstill describes the removed
<Tab>/<C-Space>branches. It belongs toanother PR this round, so it is not edited here.
Co-Authored-By: AI Agent noreply@harleypig.com