Skip to content

nvim: reduce startup cost — lazy-load rust, scope ccc/lint triggers, consolidate mini, web LSP root_dir guards#1

Merged
Gerrrt merged 1 commit into
mainfrom
copilot/nvim-directory-improvements
Jun 2, 2026
Merged

nvim: reduce startup cost — lazy-load rust, scope ccc/lint triggers, consolidate mini, web LSP root_dir guards#1
Gerrrt merged 1 commit into
mainfrom
copilot/nvim-directory-improvements

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 2, 2026

Several plugins were loading or triggering unconditionally on every startup or file open. This addresses the worst offenders.

Changes

  • rustaceanvimlazy = falseft = "rust". rust-analyzer was spawning on every Neovim startup regardless of filetype.

  • ccc.nvim — replaced global BufReadPost/BufNewFile event with ft = { "css", "scss", "html", "javascript", ... }. Color highlighter was attaching virtual text to every buffer.

  • nvim-lint — removed BufReadPost from the inner autocmd (was also in plugin load event, causing redundant lint runs on every buffer switch). Now triggers on BufWritePost + InsertLeave only.

  • mini.nvim — collapsed 9 separate per-module specs into a single echasnovski/mini.nvim spec. Reduces lazy.nvim lockfile entries and update checks; all modules still initialized via config.

  • ts_ls / emmet_ls / tailwindcss — added root_dir guards using vim.fs.root. Servers were attaching to any matching filetype system-wide; now require project markers:

    • ts_ls: tsconfig.json, jsconfig.json, or package.json
    • emmet_ls: package.json or .git
    • tailwindcss: tailwind.config.{js,ts,mjs} or postcss.config.{js,ts}

…ni.nvim

- rustaceanvim: lazy = false → ft = "rust" (only loads on Rust files)
- ccc.nvim: global BufReadPost/BufNewFile → ft scoped to CSS/HTML/JS family
- nvim-lint: remove BufReadPost from inner autocmd; lint on BufWritePost + InsertLeave only
- mini.nvim: collapse 9 separate module specs into one consolidated spec
- ts_ls, emmet_ls, tailwindcss: add root_dir scoping via vim.fs.root to prevent
  attaching in non-web projects
@Gerrrt Gerrrt marked this pull request as ready for review June 2, 2026 02:59
Copilot AI review requested due to automatic review settings June 2, 2026 02:59
@Gerrrt Gerrrt merged commit 989dffa into main Jun 2, 2026
1 check passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +6 to +12
return vim.fs.root(fname, {
"tailwind.config.js",
"tailwind.config.ts",
"tailwind.config.mjs",
"postcss.config.js",
"postcss.config.ts",
})
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.

3 participants