diff --git a/lua/config/lazy.lua b/lua/config/lazy.lua index 75ced55..d858fc5 100644 --- a/lua/config/lazy.lua +++ b/lua/config/lazy.lua @@ -5,18 +5,20 @@ if not vim.loop.fs_stat(lazypath) then vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) end vim.opt.rtp:prepend(vim.env.LAZY or lazypath) -vim.g.mapleader=' ' -vim.g.maplocalleader=' ' +vim.g.mapleader = " " +vim.g.maplocalleader = " " require("lazy").setup({ spec = { - { + { import = "plugins", - }, + }, }, defaults = { lazy = true, -- every plugin is lazy-loaded by default version = "*", -- try installing the latest stable version for plugins that support semver }, + ui = { border = "rounded", browser = "chrome", throttle = 40, custom_keys = { ["l"] = false } }, + change_detection = { enabled = false, notify = false }, checker = { enabled = true }, -- automatically check for plugin updates performance = { rtp = { diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index 5a05026..afb105b 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -88,6 +88,42 @@ keymap("x", "K", ":move '<-2gv-gv", opts) keymap("x", "", ":move '>+1gv-gv", opts) keymap("x", "", ":move '<-2gv-gv", opts) +local map = function(mode, lhs, rhs, desc) + if desc then + desc = desc + end + vim.keymap.set(mode, lhs, rhs, { silent = true, desc = desc, buffer = bufnr, noremap = true }) +end +-- if pcall(require, "dap") then +-- modified function keys found with `showkey -a` in the terminal to get key code +-- run `nvim -V3log +quit` and search through the "Terminal info" in the `log` file for the correct keyname +if pcall(require, "dap") then + map("n", "", function() + require("dap").continue() + end, "") + map("n", "", function() + require("dap").terminate() + end, "") -- Shift+F5 + map("n", "", function() + require("dap").restart_frame() + end, "") -- Control+F5 + map("n", "", function() + require("dap").pause() + end, "") + map("n", "", function() + require("dap").toggle_breakpoint() + end, "") + map("n", "", function() + require("dap").step_over() + end, "") + map("n", "", function() + require("dap").step_into() + end, "") + map("n", "", function() + require("dap").step_out() + end, "") -- Shift+F11 +end + -- Terminal -- -- Better terminal navigation -- keymap("t", "", "h", term_opts) diff --git a/lua/user/whichkey.lua b/lua/user/whichkey.lua index a228a06..17d5883 100644 --- a/lua/user/whichkey.lua +++ b/lua/user/whichkey.lua @@ -259,6 +259,86 @@ local mappings = { end, "Start/Continue", }, + i = { + function() + if is_dap then + require("dap").step_into() + else + vim.notify("DAP Not Support", "info") + end + end, + "Step Into (F11)", + }, + o = { + function() + if is_dap then + require("dap").step_over() + else + vim.notify("DAP Not Support", "info") + end + end, + "Step Over (F10)", + }, + O = { + function() + if is_dap then + require("dap").step_out() + else + vim.notify("DAP Not Support", "info") + end + end, + "Step Out (S-F11)", + }, + q = { + function() + if is_dap then + require("dap").close() + else + vim.notify("DAP Not Support", "info") + end + end, + "Close Session", + }, + Q = { + function() + if is_dap then + require("dap").terminate() + else + vim.notify("DAP Not Support", "info") + end + end, + "Terminate Session (S-F5)", + }, + p = { + function() + if is_dap then + require("dap").pause() + else + vim.notify("DAP Not Support", "info") + end + end, + "Pause (F6)", + }, + r = { + function() + if is_dap then + require("dap").restart_frame() + else + vim.notify("DAP Not Support", "info") + end + end, + "Restart (C-F5)", + }, + R = { + function() + if is_dap then + require("dap").repl.toggle() + else + vim.notify("DAP Not Support", "info") + end + end, + "Toggle REPL", + }, }, }