From 65fe71d4c2cc4fa7b09a83671dccb5d4483f0524 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 9 Apr 2026 15:57:22 +0200 Subject: ide: update neovim configuration --- .nvim.lua | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to '.nvim.lua') diff --git a/.nvim.lua b/.nvim.lua index e8205cb..ad007bb 100644 --- a/.nvim.lua +++ b/.nvim.lua @@ -1,5 +1,7 @@ vim.opt.exrc = false vim.g.autoformat = true +vim.g.load_doxygen_syntax = true +vim.opt.fixeol = false local workspace_folder = vim.fn.getcwd() @@ -23,6 +25,16 @@ default_clangd_config.cmd = { vim.lsp.config("clangd", default_clangd_config) +vim.filetype.add({ + pattern = { + [".*/include/kstd/.*"] = function(path, _) + if not path:match("%.[^/]+$") then + return "cpp" + end + end + } +}) + -- Debugging local dap = require("dap") local qemu_job_id = nil @@ -76,8 +88,8 @@ dap.adapters.teachos_qemu_mi = function(callback, config) local paths = resolve_build_paths(artifact_path) config.setupCommands = { { description = "Enable pretty-printing for gdb", text = "-enable-pretty-printing" }, - { description = "Load code", text = string.format("-file-exec-file %s", paths.elf) }, - { description = "Load symbols", text = string.format("-file-exec-and-symbols %s", paths.sym) }, + { description = "Load code", text = string.format("-file-exec-file %s", paths.elf) }, + { description = "Load symbols", text = string.format("-file-exec-and-symbols %s", paths.sym) }, } config.program = paths.sym @@ -108,7 +120,7 @@ dap.listeners.after.disconnect["teachos_qemu_teardown"] = teardown_qemu require("cmake-tools").setup({ cmake_compile_commands_options = { - action = "soft_link", + action = "copy", target = string.format("%s/build", workspace_folder), }, cmake_dap_configuration = { @@ -126,7 +138,6 @@ require("cmake-tools").setup({ vim.api.nvim_create_user_command("TeachOSRun", function() local cmake = safe_require("cmake-tools") if not cmake then return end - local is_ready, target = pcall(cmake.get_launch_target_path) if is_ready and target then launch_qemu(target, false) -- cgit v1.2.3