mirror of
https://github.com/Dichgrem/DCGOS.git
synced 2025-12-17 03:31:59 -05:00
feat:add_nixvim
This commit is contained in:
92
home/nixvim/plugins/lang/cpp.nix
Normal file
92
home/nixvim/plugins/lang/cpp.nix
Normal file
@@ -0,0 +1,92 @@
|
||||
{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
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user