-
-
Notifications
You must be signed in to change notification settings - Fork 309
Expand file tree
/
Copy pathinit.lua
More file actions
98 lines (97 loc) · 2.98 KB
/
init.lua
File metadata and controls
98 lines (97 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
local uname = (vim.uv or vim.loop).os_uname()
local is_linux_arm = uname.sysname == "Linux" and (uname.machine == "aarch64" or vim.startswith(uname.machine, "arm"))
return {
{
"AstroNvim/astrolsp",
optional = true,
opts = function(_, opts)
opts.config = vim.tbl_deep_extend("keep", opts.config, {
clangd = {
capabilities = {
offsetEncoding = "utf-8",
},
},
})
if is_linux_arm then opts.servers = require("astrocore").list_insert_unique(opts.servers, { "clangd" }) end
end,
},
{
"nvim-treesitter/nvim-treesitter",
optional = true,
opts = function(_, opts)
if opts.ensure_installed ~= "all" then
opts.ensure_installed =
require("astrocore").list_insert_unique(opts.ensure_installed, { "cpp", "c", "objc", "cuda", "proto" })
end
end,
},
{
"williamboman/mason-lspconfig.nvim",
optional = true,
opts = function(_, opts)
if not is_linux_arm then
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "clangd" })
end
end,
},
{
"p00f/clangd_extensions.nvim",
lazy = true,
dependencies = {
"AstroNvim/astrocore",
opts = {
autocmds = {
clangd_extensions = {
{
event = "LspAttach",
desc = "Load clangd_extensions with clangd",
callback = function(args)
if assert(vim.lsp.get_client_by_id(args.data.client_id)).name == "clangd" then
require "clangd_extensions"
vim.api.nvim_del_augroup_by_name "clangd_extensions"
end
end,
},
},
clangd_extension_mappings = {
{
event = "LspAttach",
desc = "Load clangd_extensions with clangd",
callback = function(args)
if assert(vim.lsp.get_client_by_id(args.data.client_id)).name == "clangd" then
require("astrocore").set_mappings({
n = {
["<Leader>lw"] = { "<Cmd>ClangdSwitchSourceHeader<CR>", desc = "Switch source/header file" },
},
}, { buffer = args.buf })
end
end,
},
},
},
},
},
},
{
"Civitasv/cmake-tools.nvim",
ft = { "c", "cpp", "objc", "objcpp", "cuda", "proto" },
dependencies = {
{
"jay-babu/mason-nvim-dap.nvim",
opts = function(_, opts)
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "codelldb" })
end,
},
},
opts = {},
},
{
"WhoIsSethDaniel/mason-tool-installer.nvim",
optional = true,
opts = function(_, opts)
local tools = { "codelldb" }
if not is_linux_arm then table.insert(tools, "clangd") end
opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, tools)
end,
},
}