diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index c917e13..92d61cd 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -18,6 +18,12 @@ vim.cmd("set splitright") vim.cmd("set spl=en_us spell") vim.opt.guifont = "JetBrainsMonoNerdFontMono:14" +-- Customize window border +vim.diagnostic.config({ + float = { + border = "single", + },}) + -- Custom Key Binds vim.g.mapleader = " " @@ -27,6 +33,7 @@ require("config.lazy") -- Configure nvim Keymaps vim.keymap.set("n", "r", ":source %", { desc = "Reload Config" }) vim.keymap.set("n", "bs", ":vsplit", { desc = "Vertical Split" }) +vim.keymap.set("n", "vm", ":lua vim.diagnostic.open_float()", { desc = "Show Diagnostic Message" }) -- remap yank to system clipboard vim.keymap.set("n", "y", '"+y', { desc = "Yank to Clipboard" }) diff --git a/.config/nvim/lua/plugins/debugging.lua b/.config/nvim/lua/plugins/debugging.lua new file mode 100644 index 0000000..8edac7d --- /dev/null +++ b/.config/nvim/lua/plugins/debugging.lua @@ -0,0 +1,85 @@ +return { + { + "mfussenegger/nvim-dap", + config = function() + local dap = require("dap") + + vim.keymap.set("n", "db", dap.toggle_breakpoint, { desc = "Toggle Breakpoint" }) + vim.keymap.set("n", "dc", dap.continue, { desc = "Start/Continue" }) + vim.keymap.set("n", "do", dap.step_over, { desc = "Step Over" }) + vim.keymap.set("n", "di", dap.step_into, { desc = "Step Into" }) + vim.keymap.set("n", "dt", dap.terminate, { desc = "Terminate Session" }) + end, + }, + { + "rcarriga/nvim-dap-ui", + dependencies = { + "mfussenegger/nvim-dap", + "mfussenegger/nvim-dap-python", + "nvim-neotest/nvim-nio", + }, + config = function() + require("dapui").setup({ + layouts = { + { + elements = { + { id = "scopes", size = 0.5 }, + { id = "breakpoints", size = 0.25 }, + --{ id = "stacks", size = 0.25 }, + { id = "watches", size = 0.25 }, + }, + size = 0.3, + position = "left", + }, + { + elements = { + { id = "console", size = 0.6 }, + { id = "repl", size = 0.4 }, + }, + size = 10, + position = "bottom", + }, + }, + }) + require("dap-python").setup("uv") + local dap = require("dap") + + dap.listeners.after.event_initialized["dapui_config"] = function() + require("dapui").open() + end + + dap.listeners.before.event_terminated["dapui_config"] = function() + require("dapui").close() + end + + dap.listeners.before.event_exited["dapui_config"] = function() + require("dapui").close() + end + end, + }, + { + "linux-cultist/venv-selector.nvim", + branch = "regexp", + lazy = false, + dependencies = { + "neovim/nvim-lspconfig", + "mfussenegger/nvim-dap", + "mfussenegger/nvim-dap-python", + { "nvim-telescope/telescope.nvim", branch = "0.1.x", dependencies = { "nvim-lua/plenary.nvim" } }, + }, + keys = { + { "ea", "VenvSelect", desc = "Activate Virtual Environment" }, + { "es", "lua print(require('venv-selector').venv())", desc = "Show Active Virtual Environment" }, + }, + opts = { + search = { + vscode_venvs = { + command = "fdfind -p '.*/bin/python$' ~/VSCode/.venvs", + }, + code_venvs = { + command = "fdfind -p '.*/bin/python$' ~/Code/.venvs", + }, + }, + }, + }, +} diff --git a/.config/nvim/lua/plugins/language-server.lua b/.config/nvim/lua/plugins/language-server.lua index cb77b2a..45eb12e 100644 --- a/.config/nvim/lua/plugins/language-server.lua +++ b/.config/nvim/lua/plugins/language-server.lua @@ -1,65 +1,75 @@ return { - { - "mason-org/mason.nvim", - tag = "v1.11.0", - config = function() - require("mason").setup({}) - end, - }, - { - "mason-org/mason-lspconfig.nvim", - tag = "v1.32.0", - config = function() - require("mason-lspconfig").setup({ - ensure_installed = { - "lua_ls", - "bashls", - "dockerls", - --"gh-actions-language-server", - "helm_ls", - "jsonls", - "marksman", - "nginx_language_server", - "ruff", - "yamlls", - }, - }) - end, - }, - { - "nvimtools/none-ls.nvim", - config = function() - local null_ls = require("null-ls") - null_ls.setup({ - sources = { - null_ls.builtins.formatting.stylua, - null_ls.builtins.formatting.mdformat, - }, - }) - vim.keymap.set("n", "af", vim.lsp.buf.format, { desc = "Auto-Format File" }) - end, - }, - { - "neovim/nvim-lspconfig", - tag = "v1.8.0", - config = function() - local capabilities = require("cmp_nvim_lsp").default_capabilities() - local lspconfig = require("lspconfig") - lspconfig.ts_ls.setup({ - capabilities = capabilities, - }) - lspconfig.lua_ls.setup({ capabilities = capabilities }) - lspconfig.bashls.setup({ capabilities = capabilities }) - lspconfig.dockerls.setup({ capabilities = capabilities }) - lspconfig.helm_ls.setup({ capabilities = capabilities }) - lspconfig.jsonls.setup({ capabilities = capabilities }) - lspconfig.nginx_language_server.setup({ capabilities = capabilities }) - lspconfig.marksman.setup({ capabilities = capabilities }) - lspconfig.ruff.setup({ capabilities = capabilities }) - lspconfig.yamlls.setup({ capabilities = capabilities }) - vim.keymap.set("n", "d", vim.lsp.buf.hover, { desc = "Show Docstring" }) - vim.keymap.set("n", "gt", vim.lsp.buf.definition, { desc = "Go To Definition" }) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "Show Code Actions" }) - end, - }, + { + "mason-org/mason.nvim", + tag = "v1.11.0", + config = function() + require("mason").setup({}) + end, + }, + { + "mason-org/mason-lspconfig.nvim", + tag = "v1.32.0", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { + "lua_ls", + "bashls", + "dockerls", + --"gh-actions-language-server", + "helm_ls", + "jsonls", + "marksman", + "nginx_language_server", + "pyright", + "ruff", + "yamlls", + }, + }) + end, + }, + { + "nvimtools/none-ls.nvim", + config = function() + local null_ls = require("null-ls") + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + null_ls.builtins.formatting.mdformat, + }, + }) + vim.keymap.set("n", "af", vim.lsp.buf.format, { desc = "Auto-Format File" }) + end, + }, + { + "neovim/nvim-lspconfig", + tag = "v1.8.0", + lazy = true, + event = { "BufReadPost", "BufNewFile" }, + dependencies = { + "mason-org/mason.nvim", + "mason-org/mason-lspconfig.nvim", + }, + config = function() + local capabilities = require("cmp_nvim_lsp").default_capabilities() + local lspconfig = require("lspconfig") + lspconfig.ts_ls.setup({ + capabilities = capabilities, + }) + lspconfig.lua_ls.setup({ capabilities = capabilities }) + lspconfig.bashls.setup({ capabilities = capabilities }) + lspconfig.dockerls.setup({ capabilities = capabilities }) + lspconfig.helm_ls.setup({ capabilities = capabilities }) + lspconfig.jsonls.setup({ capabilities = capabilities }) + lspconfig.nginx_language_server.setup({ capabilities = capabilities }) + lspconfig.marksman.setup({ capabilities = capabilities }) + lspconfig.pyright.setup({ capabilities = capabilities }) + lspconfig.ruff.setup({ + capabilities = capabilities, + }) + lspconfig.yamlls.setup({ capabilities = capabilities }) + vim.keymap.set("n", "vd", vim.lsp.buf.hover, { desc = "View Docstring" }) + vim.keymap.set("n", "gt", vim.lsp.buf.definition, { desc = "Go To Definition" }) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { desc = "Show Code Actions" }) + end, + }, } diff --git a/.config/nvim/lua/plugins/theme.lua b/.config/nvim/lua/plugins/theme.lua index 313d60f..244c967 100644 --- a/.config/nvim/lua/plugins/theme.lua +++ b/.config/nvim/lua/plugins/theme.lua @@ -10,6 +10,6 @@ return { }, }) vim.cmd("colorscheme github_dark_default") - vim.api.nvim_set_hl(0, "NormalFloat", { bg = "#0d1117" }) + vim.api.nvim_set_hl(0, "NormalFloat", { bg = "#222222" }) end, }