]> git.rmz.io Git - dotfiles.git/blob - nvim/lua/plugins/lang/cmake.lua
lazyvim: absorb all langs
[dotfiles.git] / nvim / lua / plugins / lang / cmake.lua
1 return {
2 {
3 "nvim-treesitter/nvim-treesitter",
4 opts = { ensure_installed = { "cmake" } },
5 },
6 {
7 "nvimtools/none-ls.nvim",
8 optional = true,
9 opts = function(_, opts)
10 local nls = require("null-ls")
11 opts.sources = vim.list_extend(opts.sources or {}, {
12 nls.builtins.diagnostics.cmake_lint,
13 })
14 end,
15 },
16 {
17 "mfussenegger/nvim-lint",
18 optional = true,
19 opts = {
20 linters_by_ft = {
21 cmake = { "cmakelint" },
22 },
23 },
24 },
25 {
26 "mason.nvim",
27 opts = { ensure_installed = { "cmakelang", "cmakelint" } },
28 },
29 {
30 "neovim/nvim-lspconfig",
31 opts = {
32 servers = {
33 neocmake = {},
34 },
35 },
36 },
37 {
38 "Civitasv/cmake-tools.nvim",
39 lazy = true,
40 init = function()
41 local loaded = false
42 local function check()
43 local cwd = vim.uv.cwd()
44 if vim.fn.filereadable(cwd .. "/CMakeLists.txt") == 1 then
45 require("lazy").load({ plugins = { "cmake-tools.nvim" } })
46 loaded = true
47 end
48 end
49 check()
50 vim.api.nvim_create_autocmd("DirChanged", {
51 callback = function()
52 if not loaded then
53 check()
54 end
55 end,
56 })
57 end,
58 opts = {},
59 },
60 }