diff --git a/.wezterm.lua b/.wezterm.lua index c00de49..4a935b2 100644 --- a/.wezterm.lua +++ b/.wezterm.lua @@ -9,6 +9,8 @@ local default_prog = { "& { . ~/.profile.ps1; $host.EnterNestedPrompt() }", } +default_prog = {"ubuntu"} + return { default_prog = default_prog, check_for_updates = true, diff --git a/AppData/Local/nvim/init.lua b/AppData/Local/nvim/init.lua index cbeb183..e88010e 100644 --- a/AppData/Local/nvim/init.lua +++ b/AppData/Local/nvim/init.lua @@ -1,26 +1,25 @@ -- SECTION: Options -vim.o.number = true -- Show line numbers -vim.o.wrap = true -- Soft-wrap lines -vim.o.tabstop = 2 -- 2 space tab width -vim.o.shiftwidth = 2 -- 2 space tab width -vim.o.swapfile = false -- Disable swap files (annoying) -vim.o.undofile = true -- Enable undo between sessions -vim.o.mouse = "a" -- Enable mouse support -vim.o.showmode = false -- Don't show mode in status bar -vim.o.inccommand = "split" -- Preview replace commands inline -vim.o.scrolloff = 20 -- Scroll if cursor is X lines to edge -vim.o.confirm = true -- Add confirmation on some destructive actions -vim.o.ignorecase = true -- Case insensitive search -vim.o.smartcase = true -- Case sensitive when caps is used -vim.o.cursorline = true -- Highlight current line -vim.o.winborder = "single" -- Borders around popups like when you press leader for keybinds -vim.opt.signcolumn = -"yes" -- TEST: Prohibit layout shifting by always showing the sign column (left of line numbers), you should see an icon there on this row. -vim.o.updatetime = 250 -- Speed up the CursorHold autocmd event -vim.o.timeoutlen = 300 -- Speed up completion of key event +vim.o.number = true -- Show line numbers +vim.o.wrap = true -- Soft-wrap lines +vim.o.tabstop = 2 -- 2 space tab width +vim.o.shiftwidth = 2 -- 2 space tab width +vim.o.swapfile = false -- Disable swap files (annoying) +vim.o.undofile = true -- Enable undo between sessions +vim.o.mouse = "a" -- Enable mouse support +vim.o.showmode = false -- Don't show mode in status bar +vim.o.inccommand = "split" -- Preview replace commands inline +vim.o.scrolloff = 20 -- Scroll if cursor is X lines to edge +vim.o.confirm = true -- Add confirmation on some destructive actions +vim.o.ignorecase = true -- Case insensitive search +vim.o.smartcase = true -- Case sensitive when caps is used +vim.o.cursorline = true -- Highlight current line +vim.o.winborder = "single" -- Borders around popups like when you press leader for keybinds +vim.opt.signcolumn = "yes" -- TEST: Prohibit layout shifting by always showing the sign column (left of line numbers), you should see an icon there on this row. +vim.o.updatetime = 250 -- Speed up the CursorHold autocmd event +vim.o.timeoutlen = 300 -- Speed up completion of key event -- SECTION: Globals -vim.g.mapleader = " " -- Mapping leader to space. -vim.g.maplocalleader = " " -- Mapping leader to space. +vim.g.mapleader = " " -- Mapping leader to space. +vim.g.maplocalleader = " " -- Mapping leader to space. vim.g.have_nerd_font = true -- Enable nerd font -- SECTION: Lazy settings -- INFO: Lines in this function will be executed after main event loop is free, prohibiting startup lag. @@ -58,47 +57,53 @@ vim.keymap.set("n", "?", ":WhichKey", { desc = "Show keybinds" }) vim.keymap.set("n", "\\", ":Oil --float", { desc = "File explorer" }) -- Ai -vim.keymap.set("n", "ac", "ClaudeCode", { desc = "Toggle Claude" }) -vim.keymap.set("n", "af", "ClaudeCodeFocus", { desc = "Focus Claude" }) -vim.keymap.set("n", "ar", "ClaudeCode --resume", { desc = "Resume Claude" }) +vim.keymap.set("n", "ac", "ClaudeCode", { desc = "Toggle Claude" }) +vim.keymap.set("n", "af", "ClaudeCodeFocus", { desc = "Focus Claude" }) +vim.keymap.set("n", "ar", "ClaudeCode --resume", { desc = "Resume Claude" }) vim.keymap.set("n", "aC", "ClaudeCode --continue", { desc = "Continue Claude" }) vim.keymap.set("n", "am", "ClaudeCodeSelectModel", { desc = "Select Claude model" }) -vim.keymap.set("n", "ab", "ClaudeCodeAdd %", { desc = "Add current buffer" }) -vim.keymap.set("v", "as", "ClaudeCodeSend", { desc = "Send to Claude" }) +vim.keymap.set("n", "ab", "ClaudeCodeAdd %", { desc = "Add current buffer" }) +vim.keymap.set("v", "as", "ClaudeCodeSend", { desc = "Send to Claude" }) vim.keymap.set("n", "aa", "ClaudeCodeDiffAccept", { desc = "Accept diff" }) -vim.keymap.set("n", "ad", "ClaudeCodeDiffDeny", { desc = "Deny diff" }) +vim.keymap.set("n", "ad", "ClaudeCodeDiffDeny", { desc = "Deny diff" }) -- File tree keymap (conditional on filetype) vim.api.nvim_create_autocmd("FileType", { - pattern = { "NvimTree", "neo-tree", "oil", "minifiles", "netrw" }, - callback = function(ev) - vim.keymap.set("n", "as", "ClaudeCodeTreeAdd", - { desc = "Add file", buffer = ev.buf }) - end, + pattern = { "NvimTree", "neo-tree", "oil", "minifiles", "netrw" }, + callback = function(ev) + vim.keymap.set("n", "as", "ClaudeCodeTreeAdd", { desc = "Add file", buffer = ev.buf }) + end, }) -- SECTION: Install packages vim.pack.add({ - "https://github.com/catppuccin/nvim", -- color scheme - "https://github.com/nvim-mini/mini.pick", -- File picker, grep - "https://github.com/nvim-mini/mini.pairs", -- Auto create {}, (), [] - pairs etc. - "https://github.com/nvim-mini/mini.notify", -- Popup notifications - "https://github.com/nvim-mini/mini.completion", -- Autocomplete, needs snippets and icons - "https://github.com/nvim-mini/mini.snippets", -- Snippets - "https://github.com/nvim-mini/mini.icons", -- Icons - "https://github.com/nvim-mini/mini.cursorword", -- Highlight word under cursor - "https://github.com/nvim-mini/mini.hipatterns", -- Highlight todos and rgb colors - "https://github.com/nvim-mini/mini.statusline", -- Statusline at the bottom - "https://github.com/neovim/nvim-lspconfig", -- Language servers - "https://github.com/mason-org/mason.nvim", -- LSP deps installer - "https://github.com/mason-org/mason-lspconfig.nvim", -- Lets you install mason tooling using lsp names + "https://github.com/catppuccin/nvim", -- color scheme + "https://github.com/nvim-mini/mini.pick", -- File picker, grep + "https://github.com/nvim-mini/mini.pairs", -- Auto create {}, (), [] - pairs etc. + "https://github.com/nvim-mini/mini.notify", -- Popup notifications + "https://github.com/nvim-mini/mini.completion", -- Autocomplete, needs snippets and icons + "https://github.com/nvim-mini/mini.snippets", -- Snippets + "https://github.com/nvim-mini/mini.icons", -- Icons + "https://github.com/nvim-mini/mini.cursorword", -- Highlight word under cursor + "https://github.com/nvim-mini/mini.hipatterns", -- Highlight todos and rgb colors + "https://github.com/nvim-mini/mini.statusline", -- Statusline at the bottom + "https://github.com/neovim/nvim-lspconfig", -- Language servers + "https://github.com/mason-org/mason.nvim", -- LSP deps installer + "https://github.com/mason-org/mason-lspconfig.nvim", -- Lets you install mason tooling using lsp names "https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim", -- Automatically install mason tooling - "https://github.com/folke/lazydev.nvim", -- Automatically resolve vim api paths. - "https://github.com/folke/which-key.nvim", -- Shortcut hints (bar at the bottom when pressing space) - "https://github.com/nvim-lua/plenary.nvim", -- Helper lua functions, dep of todo-comments. - "https://github.com/nvim-treesitter/nvim-treesitter", -- Syntax highlighting - "https://github.com/stevearc/oil.nvim", -- File explorer - "https://github.com/folke/snacks.nvim", -- Dep for claudecode - "https://github.com/coder/claudecode.nvim", -- Claude code + "https://github.com/folke/lazydev.nvim", -- Automatically resolve vim api paths. + "https://github.com/folke/which-key.nvim", -- Shortcut hints (bar at the bottom when pressing space) + "https://github.com/nvim-lua/plenary.nvim", -- Helper lua functions, dep of todo-comments. + "https://github.com/nvim-treesitter/nvim-treesitter", -- Syntax highlighting + "https://github.com/stevearc/oil.nvim", -- File explorer + "https://github.com/folke/snacks.nvim", -- Dep for claudecode + "https://github.com/coder/claudecode.nvim", -- Claude code + "https://github.com/MeanderingProgrammer/render-markdown.nvim", -- Rendering markdown + "https://github.com/mfussenegger/nvim-dap", -- DAP support + "https://github.com/rcarriga/nvim-dap-ui", -- DAP UI + "https://github.com/nvim-neotest/nvim-nio", -- Asynchronous io + "https://github.com/jay-babu/mason-nvim-dap.nvim", -- Automatically install DAP adapters + "https://github.com/thehamsta/nvim-dap-virtual-text", -- Virtual text for nvim dap + "https://github.com/mfussenegger/nvim-dap-python", -- Python support for nvim-dap }) -- SECTION: Colorscheme @@ -107,7 +112,9 @@ vim.cmd("colorscheme catppuccin-mocha") -- SECTION: General plugin setup -- Folke -require("lazydev").setup() +require("lazydev").setup({ + library = { "nvim-dap-ui" }, -- Add type checking for nvim-dap-ui +}) local wk = require("which-key") wk.setup() @@ -115,6 +122,104 @@ wk.add({ { "s", group = "[S]earch" }, { "o", group = "Source current file", mode = { "n" } }, { "a", group = "AI/Claude Code" }, + { + "d", + group = "Debugger", + nowait = true, + remap = false, + }, + { + "dt", + function() + require("dap").toggle_breakpoint() + end, + desc = "Toggle Breakpoint", + nowait = true, + remap = false, + }, + { + "dc", + function() + require("dap").continue() + end, + desc = "Continue", + nowait = true, + remap = false, + }, + { + "di", + function() + require("dap").step_into() + end, + desc = "Step Into", + nowait = true, + remap = false, + }, + { + "do", + function() + require("dap").step_over() + end, + desc = "Step Over", + nowait = true, + remap = false, + }, + { + "du", + function() + require("dap").step_out() + end, + desc = "Step Out", + nowait = true, + remap = false, + }, + { + "dr", + function() + require("dap").repl.open() + end, + desc = "Open REPL", + nowait = true, + remap = false, + }, + { + "dl", + function() + require("dap").run_last() + end, + desc = "Run Last", + nowait = true, + remap = false, + }, + { + "dq", + function() + require("dap").terminate() + require("dapui").close() + require("nvim-dap-virtual-text").toggle() + end, + desc = "Terminate", + nowait = true, + remap = false, + }, + { + "db", + function() + require("dap").list_breakpoints() + end, + desc = "List Breakpoints", + nowait = true, + remap = false, + }, + { + "de", + function() + require("dap").set_exception_breakpoints({ "all" }) + end, + desc = "Set Exception Breakpoints", + nowait = true, + remap = false, + }, }) -- Mini @@ -148,7 +253,7 @@ require("nvim-treesitter").setup({ auto_install = true, }) local vue_language_server_path = vim.fn.stdpath("data") - .. "/mason/packages/vue-language-server/node_modules/@vue/language-server" + .. "/mason/packages/vue-language-server/node_modules/@vue/language-server" local tsserver_filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" } local vue_plugin = { name = "@vue/typescript-plugin", @@ -209,6 +314,69 @@ require("mason-tool-installer").setup({ }) vim.lsp.enable({ "ts_ls", "vue_ls" }) +-- SECTION: DAP + +local mason_dap = require("mason-nvim-dap") +local dap = require("dap") +local ui = require("dapui") +local dap_virtual_text = require("nvim-dap-virtual-text") +require('dap-python').setup("debugpy-adapter") + +dap_virtual_text.setup({}) +mason_dap.setup({ + ensure_installed = { "cppdbg", "debugpy" }, + automatic_installation = true, + handlers = { + function(config) + require("mason-nvim-dap").default_setup(config) + end, + }, +}) +dap.configurations = { + c = { + { + name = "Launch file", + type = "cppdbg", + request = "launch", + program = function() + return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "\\", "file") + end, + cwd = "${workspaceFolder}", + stopAtEntry = false, + MIMode = "lldb", + }, + { + name = "Attach to lldbserver :1234", + type = "cppdbg", + request = "launch", + MIMode = "lldb", + miDebuggerServerAddress = "localhost:1234", + miDebuggerPath = "/usr/bin/lldb", + cwd = "${workspaceFolder}", + program = function() + return vim.fn.input("Path to executable: ", vim.fn.getcwd() .. "\\", "file") + end, + }, + }, +} + +ui.setup() + +vim.fn.sign_define("DapBreakpoint", { text = "🐞" }) + +dap.listeners.before.attach.dapui_config = function() + ui.open() +end +dap.listeners.before.launch.dapui_config = function() + ui.open() +end +dap.listeners.before.event_terminated.dapui_config = function() + ui.close() +end +dap.listeners.before.event_exited.dapui_config = function() + ui.close() +end + -- SECTION: Helpers local function client_supports_method(client, method, bufnr) if vim.fn.has("nvim-0.11") == 1 then