diff options
| -rw-r--r-- | .lazy.lua | 13 | ||||
| -rw-r--r-- | .nvim.lua | 36 |
2 files changed, 49 insertions, 0 deletions
diff --git a/.lazy.lua b/.lazy.lua new file mode 100644 index 0000000..1c2df6e --- /dev/null +++ b/.lazy.lua @@ -0,0 +1,13 @@ +return { + { + "nvim-neo-tree/neo-tree.nvim", + opts = { + filesystem = { + filtered_items = { + visible = false, + hide_gitignored = true, + }, + }, + } + } +} 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 + |
