diff --git a/lua/custom/chadrc.lua b/lua/custom/chadrc.lua index 074bd3e..7e7dc46 100644 --- a/lua/custom/chadrc.lua +++ b/lua/custom/chadrc.lua @@ -5,8 +5,8 @@ local M = {} local highlights = require "custom.highlights" M.ui = { - theme = "kanagawa", - theme_toggle = { "kanagawa", "chadracula" }, + theme = "oceanic-next", + theme_toggle = { "kanagawa", "oceanic-next" }, hl_override = highlights.override, hl_add = highlights.add, diff --git a/lua/custom/configs/lspconfig.lua b/lua/custom/configs/lspconfig.lua index e180978..88b5536 100644 --- a/lua/custom/configs/lspconfig.lua +++ b/lua/custom/configs/lspconfig.lua @@ -10,7 +10,7 @@ local servers = { "tsserver", "clangd", "pyright", - -- "rust_analyzer", + "rust_analyzer", -- rustaceanvim wants to do that, but the builtin thing has better integration! "bashls", "cmake", } diff --git a/lua/custom/mappings.lua b/lua/custom/mappings.lua index efbbd2b..42a15d1 100644 --- a/lua/custom/mappings.lua +++ b/lua/custom/mappings.lua @@ -219,6 +219,10 @@ M.telescope = { ["th"] = { " Telescope themes ", "Nvchad themes" }, ["ma"] = { " Telescope marks ", "telescope bookmarks" }, + + -- lsp stuff + ["cw"] = { " Telescope lsp_dynamic_workspace_symbols ", "telescope dynamic workspace symbols" }, + ["cd"] = { " Telescope lsp_document_symbols ", "telescope document symbols" }, }, } diff --git a/lua/custom/plugins.lua b/lua/custom/plugins.lua index ae61192..97f4849 100644 --- a/lua/custom/plugins.lua +++ b/lua/custom/plugins.lua @@ -348,7 +348,9 @@ local plugins = { }, messages = { enabled = true, - view_error = "messages", -- so it does not spam boxes with errors + -- NOTE: we keep it with notify, + -- change this to something else if you want + view_error = "notify", }, popupmenu = { enabled = true, @@ -734,7 +736,6 @@ local plugins = { end, config = function() local dap = require "dap" - local rustcfg = require "rustaceanvim.config" local mason_registry = require "mason-registry" local codelldb_root = mason_registry.get_package("codelldb"):get_install_path() .. "/extension/" local codelldb_path = codelldb_root .. "adapter/codelldb" @@ -743,12 +744,17 @@ local plugins = { command = "/home/plex/.local/bin/kitty", args = {}, } - dap.adapters.lldb = { + dap.adapters.gdb = { + type = "executable", + command = "gdb", + args = { "-i", "dap" }, + } + dap.adapters.codelldb = { type = "server", - port = "${port}", + port = "30333", executable = { command = codelldb_path, - args = { "--port", "${port}" }, + args = { "--port", "30333" }, detached = false, }, } @@ -761,11 +767,12 @@ local plugins = { return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "/", "file") end, cwd = "${workspaceFolder}", + -- FIXME: perhaps we can put the stdio somewhere more practical stopOnEntry = false, }, } dap.configurations.c = dap.configurations.cpp - -- dap.configurations.rust = dap.configurations.cpp + dap.configurations.rust = dap.configurations.cpp end, }, { @@ -784,16 +791,17 @@ local plugins = { dapui.open {} end dap.listeners.before.event_terminated["dapui_config"] = function() - dapui.close {} + -- dapui.close {} end dap.listeners.before.event_exited["dapui_config"] = function() - dapui.close {} + -- dapui.close {} end end, }, { "folke/neodev.nvim", opts = {} }, { "mrcjkb/rustaceanvim", + enabled = true, version = "^4", -- Recommended ft = { "rust" }, }, @@ -802,6 +810,28 @@ local plugins = { lazy = false, -- PERF: this can be done more elegant config = function() require("nvim-dap-virtual-text").setup() + local dap = require "dap" + vim.g.rustaceanvim = { + -- Plugin configuration + tools = {}, + -- LSP configuration + server = { + on_attach = function(client, bufnr) + -- you can also put keymaps in here + end, + settings = { + -- rust-analyzer language server configuration + ["rust-analyzer"] = {}, + }, + }, + -- DAP configuration + dap = { + -- FIXME: the rustaceanvim debug config does not map the stdout/stderr to the + -- opened terminal, effectively rendering debugging with it useless. Luckily, + -- we can use the regular nvim-dap and nvim-dap-ui. + adapter = dap.adapters.codelldb, + }, + } end, }, }