srctree

Gregory Mullen parent 4b1ef21c a621efc4
vim make clangd a bit "smarter"

inlinesplit
.config/nvim/init.vim added: 15, removed: 2, total 13
@@ -278,9 +278,22 @@ require('lspconfig')['pylsp'].setup{
}
}
 
local util = require 'lspconfig.util'
local root_files = {
'compile_commands.json',
'.clangd',
'.clang-tidy',
'.clang-format',
'compile_flags.txt',
'configure.ac', -- AutoTools
}
require('lspconfig')['clangd'].setup{
on_attach = on_attach,
filetypes = { "c", "cpp", "objc", "objcpp" }
filetypes = { "c", "h", "cpp", "hpp", "objc", "objcpp" },
root_dir = function(fname)
return util.root_pattern(unpack(root_files))(fname) or util.find_git_ancestor(fname)
end,
single_file_support = true,
}
 
EOF