summaryrefslogtreecommitdiff
path: root/.nvim.lua
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2026-06-04 20:03:00 +0200
committerFelix Morgner <felix.morgner@gmail.com>2026-06-04 20:03:00 +0200
commit1ca48e3790e69e63c3789a32d541e4086e849030 (patch)
treec907ae1ca2ef3c799d9489b1f62a9bcd1852a40f /.nvim.lua
parent7832816c0d239c1cd7a91daef3f15c8f94197e28 (diff)
downloadcabinet-1ca48e3790e69e63c3789a32d541e4086e849030.tar.xz
cabinet-1ca48e3790e69e63c3789a32d541e4086e849030.zip
ide: add configuration
Diffstat (limited to '.nvim.lua')
-rw-r--r--.nvim.lua36
1 files changed, 36 insertions, 0 deletions
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
+