blob: 6080510a730c690b27fac2fda40925cc40f628e3 (
plain)
| 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
 | local lspconfig = require("lspconfig")
local brew_clangd_path = "/usr/local/opt/llvm/bin/clangd"
local function setup()
    local clangd = "clangd"
    if vim.uv.fs_stat(brew_clangd_path) ~= nil then
        clangd = brew_clangd_path
    end
    -- setup lsp clangd
    lspconfig.clangd.setup {
        cmd = { clangd },
        on_attach = function(_, bufnr)
            vim.keymap.set('n', 'grs', "<cmd>ClangdSwitchSourceHeader<cr>", {
                buffer = bufnr
            })
        end
    }
end
return {
    setup = setup
}
 |