Moved lsp configurations per language to ftplugins folder
This commit is contained in:
20
lua/barink/after/ftplugin/cpp.lua
Normal file
20
lua/barink/after/ftplugin/cpp.lua
Normal file
@@ -0,0 +1,20 @@
|
||||
local root_files = {
|
||||
'premake5.lua',
|
||||
'.clang-tidy',
|
||||
'.clang-format',
|
||||
'compile_commands',
|
||||
'compile_commands.json',
|
||||
'compile_flags.txt',
|
||||
'configure.ac',
|
||||
'.git'
|
||||
}
|
||||
local util = require('lspconfig.util')
|
||||
require('lspconfig')['clangd'].setup({
|
||||
capabilities = capabilities,
|
||||
filetypes= { 'c', 'cpp', 'objc', 'objcpp', 'cuda', 'proto' },
|
||||
cmd = { 'clangd' },
|
||||
single_file_support = true,
|
||||
root_dir = function (fname)
|
||||
return util.root_pattern(unpack(root_files))(fname)
|
||||
end
|
||||
})
|
||||
Reference in New Issue
Block a user