From 1ca48e3790e69e63c3789a32d541e4086e849030 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 4 Jun 2026 20:03:00 +0200 Subject: ide: add configuration --- .nvim.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .nvim.lua (limited to '.nvim.lua') diff --git a/.nvim.lua b/.nvim.lua new file mode 100644 index 0000000..761bed0 --- /dev/null +++ b/.nvim.lua @@ -0,0 +1,36 @@ +-- Formatting +vim.g.autoformat = true +vim.opt.fixeol = false +local function safe_require(module) + local ok, mod = pcall(require, module) + if not ok then return nil end + return mod +end + +-- C++ +local default_clangd_config = vim.deepcopy(vim.lsp.config["clangd"]) or {} +default_clangd_config.cmd = { + "clangd", + "--background-index", + "--clang-tidy", + "--header-insertion=iwyu", + "--completion-style=detailed", +} + +vim.lsp.config("clangd", default_clangd_config) + +-- File Browser +local neo_tree = safe_require("neo-tree") +if neo_tree then + local current_config = neo_tree.config or {} + local project_config = vim.tbl_deep_extend("force", current_config, { + nesting_rules = { + ['*.hpp'] = { + pattern = "(.*).hpp", + files = { "%1.cpp", "%1.tests.cpp" } + } + } + }) + neo_tree.setup(project_config) +end + -- cgit v1.2.3