feat:add_nixvim

This commit is contained in:
dichgrem
2025-09-21 15:54:31 +08:00
parent c36f91562d
commit 8016a1173d
64 changed files with 3608 additions and 30 deletions

View 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
'';
}
];
};
};
}