mirror of
https://github.com/Dichgrem/DCGOS.git
synced 2025-12-16 19:22:00 -05:00
93 lines
2.3 KiB
Nix
93 lines
2.3 KiB
Nix
{pkgs, ...}: {
|
|
plugins = {
|
|
conform-nvim.settings = {
|
|
formatters_by_ft = {
|
|
cpp = ["clang-format"];
|
|
};
|
|
|
|
formatters = {
|
|
clang-format = {
|
|
command = "${pkgs.clang-tools}/bin/clang-format";
|
|
};
|
|
};
|
|
};
|
|
|
|
lsp.servers = {
|
|
cmake.enable = true;
|
|
clangd = {
|
|
enable = true;
|
|
cmd = [
|
|
"clangd"
|
|
"--offset-encoding=utf-16"
|
|
"--header-insertion=iwyu"
|
|
"--background-index"
|
|
"--clang-tidy"
|
|
"--all-scopes-completion"
|
|
"--completion-style=detailed"
|
|
"--function-arg-placeholders"
|
|
"--fallback-style=llvm"
|
|
"-j=6"
|
|
];
|
|
onAttach.function = ''
|
|
vim.keymap.set('n', 'gh', "<cmd>ClangdSwitchSourceHeader<cr>", { desc = "Switch Source/Header (C/C++)", buffer = bufnr })
|
|
|
|
require("clangd_extensions.inlay_hints").setup_autocmd()
|
|
require("clangd_extensions.inlay_hints").set_inlay_hints()
|
|
'';
|
|
extraOptions = {
|
|
init_options = {
|
|
usePlaceholders = true;
|
|
completeUnimported = true;
|
|
clangdFileStatus = true;
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
clangd-extensions = {
|
|
enable = true;
|
|
settings = {
|
|
inlay_hints.inline = false;
|
|
codelens.enable = true;
|
|
ast = {
|
|
role_icons = {
|
|
type = "";
|
|
declaration = "";
|
|
expression = "";
|
|
specifier = "";
|
|
statement = "";
|
|
templateArgument = "";
|
|
};
|
|
kind_icons = {
|
|
compound = "";
|
|
recovery = "";
|
|
translationUnit = "";
|
|
packExpansion = "";
|
|
templateTypeParm = "";
|
|
templateTemplateParm = "";
|
|
templateParamObject = "";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
dap = {
|
|
adapters.executables.lldb.command = "${pkgs.lldb}/bin/lldb-vscode";
|
|
|
|
configurations.cpp = [
|
|
{
|
|
name = "C++";
|
|
type = "lldb";
|
|
request = "launch";
|
|
cwd = "\${workspaceFolder}";
|
|
program.__raw = ''
|
|
function()
|
|
return vim.fn.input('Executable path: ', vim.fn.getcwd() .. '/', 'file')
|
|
end
|
|
'';
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|