Skip to content

feat: markdown opt-in extra + fix local.lua load order#2043

Closed
4rc0s wants to merge 18 commits into
nvim-lua:masterfrom
4rc0s:feat/markdown-optin
Closed

feat: markdown opt-in extra + fix local.lua load order#2043
4rc0s wants to merge 18 commits into
nvim-lua:masterfrom
4rc0s:feat/markdown-optin

Conversation

@4rc0s
Copy link
Copy Markdown

@4rc0s 4rc0s commented May 10, 2026

Summary

  • Adds lua/whipsmart/plugins/markdown.lua as a new opt-in extra bundling render-markdown.nvim (always loaded) and obsidian.nvim + blink.compat (gated on vim.g.obsidian_vaults being set in local.lua)
  • Fixes a load-order bug where pcall(require, 'local') ran before vim.g.have_nerd_font and all vim.o.* defaults, making local.lua unable to override them — the call is now at the end of Section 1
  • Updates UNIFIED.md: markdown extra documented, roci migration and load-order fix checked off

Enabling the markdown extra on a machine

In lua/local.lua:

vim.g.obsidian_vaults = { { name = 'personal', path = '~/Obsidian/Main' } }

In lua/custom/plugins/markdown.lua:

require 'whipsmart.plugins.markdown'

render-markdown loads even without obsidian_vaults set — only the obsidian/blink.compat block is gated.

blink.cmp integration notes

blink.compat is added without a version pin (HEAD/main branch) — released tags historically lacked cmp.get_config() that obsidian.nvim calls internally.

The obsidian sources and [[ wikilink trigger behaviour are applied via require('blink.cmp.config').merge_with(...) — the correct v1 post-setup extension API — called from custom/plugins/ (Section 3) after plugins.cmp has already run setup().

Test plan

  • Launch nvim with no obsidian_vaults set — no errors, render-markdown active in markdown buffers
  • Launch nvim with obsidian_vaults set — obsidian completion sources available via [[
  • Type a regular word in markdown — completion menu does NOT auto-open
  • Ctrl-Space in markdown — menu opens with full source list
  • Non-markdown buffer — completion behaviour unchanged
  • Machine without Nerd Font sets vim.g.have_nerd_font = false in local.lua — override takes effect

4rc0s and others added 18 commits May 10, 2026 11:38
- Rename lua/kickstart/ -> lua/whipsmart/ (health check, opt-in extras)
- Replace doc/kickstart.txt with doc/whipsmart.txt; regenerate help tags
- Rename all kickstart-* augroups to whipsmart-* in lsp.lua and telescope.lua
- Fix missed kickstart-lsp-highlight reference in nvim_clear_autocmds
- Wire up custom/plugins loading (was silently never called)
- Replace implicit glob plugin loader with explicit ordered list in init.lua
- Remove dead mason-lspconfig dependency (unused with 0.12 native LSP)
- Simplify format.lua format_on_save to a clear user-editable ft table

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mason-tool-installer uses Mason registry names (e.g. lua-language-server)
which differ from lspconfig names (e.g. lua_ls). Previously mason-lspconfig
handled this translation; now that it's removed, maintain a separate
mason_tools list with correct Mason package names.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add 'Adding LSP Servers' section explaining the servers/mason_tools split
  and linking to mason-registry and lspconfig server list for name lookups
- Fix 'Adding a Plugin' section — core plugins need explicit registration
  in init.lua loader list; personal plugins go in lua/custom/plugins/
- Update project layout to include lua/whipsmart/ and lua/custom/
- Add format-on-save opt-in instructions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
README:
- Add :checkhealth whipsmart step to Quick Start flow

UNIFIED.md:
- Update module list to match explicit load order in init.lua
- Document lua/whipsmart/plugins/ opt-in extras and how to enable them
- Tick off completed roadmap items from the rebrand/cleanup session
- Replace stale kickstart.nvim upstream sync instructions with a note
  that the project has diverged and upstream syncing no longer applies

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
pack-manager.nvim is the UI layer over vim.pack and the most significant
third-party dependency. Added to UNIFIED.md with repo link, rationale,
and the workflow for picking up upstream improvements via the lockfile.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… custom plugins

- init.lua: relativenumber, colorcolumn=120, expandtab=false, isfname @-@,
  [d/]d diagnostic navigation, <leader>e diagnostic float, hecate hostname
- lsp.lua: add gopls, basedpyright (uv venv detection), ts_ls, nimls/gleam
  (conditional), rust-analyzer in mason_tools; gleam indentation autocmd
- treesitter.lua: expand parsers (rust, go, js, ts, py, json, yaml, toml, gleam, nim)
- format.lua: full conform config with all formatters and :Format range command
- telescope.lua: add <C-p> git_files and <leader>pf prompted grep
- custom/plugins/rust.lua: rustaceanvim ^6
- custom/plugins/trouble.lua: trouble.nvim with standard keybindings
- custom/plugins/gitsigns.lua: enable whipsmart gitsigns extended keymaps
…overrides

- init.lua: swap hostname if/elseif block for pcall(require, 'local')
- .gitignore: add lua/local.lua
- lua/local.lua.example: documented template (font, colorscheme, paths, opt-in extras)
- UNIFIED.md: update Machine Detection section and roadmap
Adds lua/whipsmart/plugins/markdown.lua as an opt-in extra that bundles
render-markdown.nvim (unconditional) and obsidian.nvim + blink.compat
(gated on vim.g.obsidian_vaults being set in local.lua). Uses
blink.cmp.config.merge_with to extend the completion config post-setup
with markdown-specific per_filetype sources and [[wikilink trigger behaviour.

Also fixes a load-order bug where pcall(require, 'local') ran before
vim.g.have_nerd_font and all vim.o.* defaults were set, making it
impossible for local.lua to override them. The call is now at the end
of Section 1 so local.lua runs last and overrides work correctly.

UNIFIED.md updated: markdown extra documented, roci migration and
load-order fix checked off the roadmap.
@4rc0s
Copy link
Copy Markdown
Author

4rc0s commented May 10, 2026

Opened against wrong repo by mistake — intended for 4rc0s/whipsmart.nvim

@4rc0s 4rc0s closed this May 10, 2026
@4rc0s 4rc0s deleted the feat/markdown-optin branch May 10, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant