Added back C and other languages LSPs and tooling

This commit is contained in:
2024-11-30 11:55:46 +02:00
parent 03e05cddf8
commit ccc402964b
3 changed files with 47 additions and 47 deletions

View File

@@ -13,48 +13,48 @@ return {
},
},
}, -- lua
-- clangd = {
-- cmd = {
-- 'clangd',
-- '--background-index',
-- '--clang-tidy',
-- '--header-insertion=iwyu',
-- '--completion-style=detailed',
-- '--function-arg-placeholders',
-- '--fallback-style=llvm',
-- },
-- root_dir = function(filename)
-- return require('lspconfig/util').root_pattern(
-- '.clang-tidy',
-- '.clang-format',
-- 'compile_commands.json',
-- '.git'
-- )(filename) or vim.fn.getcwd()
-- end,
-- init_options = {
-- usePlaceholders = true,
-- completeUnimported = true,
-- clangdFileStatus = true,
-- },
-- }, -- c/cpp
-- neocmake = {
-- root_dir = function(filename)
-- return require('lspconfig/util').root_pattern(
-- 'CMakePresets.json',
-- 'CTestConfig.cmake',
-- 'build',
-- 'cmake',
-- '.git' -- NOTE: git is last due to monorepos (so it tries to use build/cmake first)
-- )(filename) or vim.fn.getcwd()
-- end,
-- },
-- pyright = {
-- settings = {
-- python = {
-- pythonPath = '~/python/venv/bin/python',
-- },
-- },
-- }, -- python
clangd = {
cmd = {
'clangd',
'--background-index',
'--clang-tidy',
'--header-insertion=iwyu',
'--completion-style=detailed',
'--function-arg-placeholders',
'--fallback-style=llvm',
},
root_dir = function(filename)
return require('lspconfig/util').root_pattern(
'.clang-tidy',
'.clang-format',
'compile_commands.json',
'.git'
)(filename) or vim.fn.getcwd()
end,
init_options = {
usePlaceholders = true,
completeUnimported = true,
clangdFileStatus = true,
},
}, -- c/cpp
neocmake = {
root_dir = function(filename)
return require('lspconfig/util').root_pattern(
'CMakePresets.json',
'CTestConfig.cmake',
'build',
'cmake',
'.git' -- NOTE: git is last due to monorepos (so it tries to use build/cmake first)
)(filename) or vim.fn.getcwd()
end,
},
pyright = {
settings = {
python = {
pythonPath = '~/python/venv/bin/python',
},
},
}, -- python
bashls = true, -- bash
taplo = true, -- toml
lemminx = true, -- xml

View File

@@ -13,7 +13,7 @@ return {
opts = {
formatters_by_ft = {
['lua'] = { 'stylua' },
-- ['c'] = { 'clang-format' },
['c'] = { 'clang-format' },
-- ['python'] = { 'isort', 'black' },
-- ['rust'] = { 'rustfmt' },
['go'] = { 'gofumpt', 'goimports-reviser' },

View File

@@ -18,14 +18,14 @@ return {
opts = {
ensure_installed = {
'stylua', -- lua formatting
-- 'clang-format', -- C/C++ formatter
-- 'codelldb', -- C/C++ debugger
-- 'cpplint', -- C/C++ linter
'clang-format', -- C/C++ formatter
'codelldb', -- C/C++ debugger
'cpplint', -- C/C++ linter
-- 'black', -- python formatter
-- 'isort', -- python formatter for imports
-- 'flake8', -- python linter
'gofumpt', -- go formatter
-- 'golangci-lint', -- go linter
'golangci-lint', -- go linter
'prettierd', -- multi-lang formatter
'prettier', -- prettierd but slower, used as a fallback
'jq', -- json formatter