diff --git a/lazy-lock.json b/lazy-lock.json index 9363aba..a297ec9 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,32 +1,38 @@ { "LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" }, "blink.cmp": { "branch": "main", "commit": "bae4bae0eedd1fa55f34b685862e94a222d5c6f8" }, - "catppuccin": { "branch": "main", "commit": "30fa4d122d9b22ad8b2e0ab1b533c8c26c4dde86" }, + "brightburn.vim": { "branch": "master", "commit": "fc0d2fafc51e86d6065acd54b5e82e686019ff2f" }, "conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" }, - "everforest-nvim": { "branch": "main", "commit": "d2936185a6d266def29fd7b523d296384580ef08" }, "fidget.nvim": { "branch": "main", "commit": "4d5858bd4c471c895060e1b9f3575f1551184dc5" }, "gitsigns.nvim": { "branch": "main", "commit": "6e3c66548035e50db7bd8e360a29aec6620c3641" }, + "gruvbox": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" }, "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, - "kanso.nvim": { "branch": "main", "commit": "151dbc23fe890d09c26df11b1208dd8129dca012" }, + "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "5e085efe67fccb13372d54331d849219662a7e93" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "86389a3dd687cfaa647b6f44731e492970034baa" }, "mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" }, "mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" }, "mini.nvim": { "branch": "main", "commit": "6bf9eccaf2a5395b254bc031f9812cf163ca4187" }, "neo-tree.nvim": { "branch": "main", "commit": "f1deac7ecec88c28a250d890ba7bb35843e69cbd" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-dap": { "branch": "master", "commit": "7523676a4be17644587aa47e4d42f6f7646d4727" }, + "nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" }, "nvim-lspconfig": { "branch": "master", "commit": "c8b90ae5cbe21d547b342b05c9266dcb8ca0de8f" }, + "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "rose-pine": { "branch": "main", "commit": "293de9285831e06abda2e532cea70370ee027821" }, + "rose-pine": { "branch": "main", "commit": "72a04c4065345b51b56aed4859ea1d884f734097" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, - "themery.nvim": { "branch": "main", "commit": "bfa58f4b279d21cb515b28023e1b68ec908584b2" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "tokyonight.nvim": { "branch": "main", "commit": "057ef5d260c1931f1dffd0f052c685dcd14100a3" }, + "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, + "undotree": { "branch": "master", "commit": "fe9a9d0645f0f5532360b5e5f5c550d7bb4f1869" }, + "vim-be-good": { "branch": "master", "commit": "0ae3de14eb8efc6effe7704b5e46495e91931cc5" }, "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, "zen-mode.nvim": { "branch": "main", "commit": "863f150ca321b3dd8aa1a2b69b5f411a220e144f" } } diff --git a/lua/custom/plugins/colors.lua b/lua/custom/plugins/colors.lua new file mode 100644 index 0000000..0a832dd --- /dev/null +++ b/lua/custom/plugins/colors.lua @@ -0,0 +1,89 @@ +function ColorMyPencils(color) + color = color or 'rose-pine-moon' + vim.cmd.colorscheme(color) + + vim.api.nvim_set_hl(0, 'Normal', { bg = 'none' }) + vim.api.nvim_set_hl(0, 'NormalFloat', { bg = 'none' }) +end + +return { + + { + 'erikbackman/brightburn.vim', + }, + + { + 'folke/tokyonight.nvim', + lazy = false, + opts = {}, + config = function() + ColorMyPencils() + end, + }, + { + 'ellisonleao/gruvbox.nvim', + name = 'gruvbox', + config = function() + require('gruvbox').setup { + terminal_colors = true, -- add neovim terminal colors + undercurl = true, + underline = false, + bold = true, + italic = { + strings = false, + emphasis = false, + comments = false, + operators = false, + folds = false, + }, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + invert_intend_guides = false, + inverse = true, -- invert background for search, diffs, statuslines and errors + contrast = '', -- can be "hard", "soft" or empty string + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = false, + } + end, + }, + { + 'folke/tokyonight.nvim', + config = function() + require('tokyonight').setup { + -- your configuration comes here + -- or leave it empty to use the default settings + style = 'storm', -- The theme comes in three styles, `storm`, `moon`, a darker variant `night` and `day` + transparent = true, -- Enable this to disable setting the background color + terminal_colors = true, -- Configure the colors used when opening a `:terminal` in Neovim + styles = { + -- Style to be applied to different syntax groups + -- Value is any valid attr-list value for `:help nvim_set_hl` + comments = { italic = false }, + keywords = { italic = false }, + -- Background styles. Can be "dark", "transparent" or "normal" + sidebars = 'dark', -- style for sidebars, see below + floats = 'dark', -- style for floating windows + }, + } + end, + }, + + { + 'rose-pine/neovim', + name = 'rose-pine', + config = function() + require('rose-pine').setup { + disable_background = true, + styles = { + italic = false, + }, + } + + ColorMyPencils() + end, + }, +} diff --git a/lua/custom/plugins/colorscheme.lua b/lua/custom/plugins/colorscheme.lua deleted file mode 100644 index afbbfc0..0000000 --- a/lua/custom/plugins/colorscheme.lua +++ /dev/null @@ -1,175 +0,0 @@ -return { - { - 'zaldih/themery.nvim', - lazy = false, - config = function() - require('themery').setup { - themes = { - { name = 'Rose pine', colorscheme = 'rose-pine' }, - { name = 'Tokyonight-night', colorscheme = 'tokyonight-night' }, - { name = 'Catppuccin Mocha', colorscheme = 'catppuccin-mocha' }, - { name = 'Everforest', colorscheme = 'everforest' }, - { name = 'Kanso', colorscheme = 'kanso-ink' }, - }, - livePreview = true, - makePersist = true, - } - end, - keys = { - { 'ut', 'Themery', mode = 'n', desc = 'Colorschemes' }, - }, - }, - { - 'asilvam133/rose-pine.nvim', - name = 'rose-pine', - lazy = false, - opts = { - styles = { - bold = true, - italic = false, - transparency = false, - }, - highlight_groups = { - ['@function.builtin.lua'] = { italic = false }, - ['@lsp.type.comment'] = { italic = true }, - ['@lsp.typemod.function.defaultLibrary.lua'] = { italic = false }, - Comment = { italic = true }, - DiagnosticUnnecessary = { italic = false }, - TabLine = { bg = 'none' }, - TabLineSel = { bg = 'none' }, - TabLineFill = { bg = 'none' }, - ZenBg = { bg = 'none' }, - }, - }, - config = function(_, opts) - require('rose-pine').setup(opts) - end, - }, - { - 'catppuccin/nvim', - name = 'catppuccin', - lazy = false, - priority = 1000, - opts = { - flavour = 'mocha', - transparent_background = false, - integrations = { - fidget = true, - harpoon = true, - noice = true, - native_lsp = { - enabled = true, - virtual_text = { - errors = { 'italic' }, - hints = { 'italic' }, - warnings = { 'italic' }, - information = { 'italic' }, - }, - underlines = { - errors = { 'underline' }, - hints = { 'underline' }, - warnings = { 'underline' }, - information = { 'underline' }, - }, - inlay_hints = { - background = true, - }, - }, - notify = true, - treesitter_context = true, - telescope = { - enabled = true, - style = 'nvchad', - }, - lsp_trouble = true, - }, - custom_highlights = function(_) - return { - ['@module'] = { style = {} }, - Conditional = { style = {} }, - TabLine = { bg = 'none' }, - TabLineSel = { bg = 'none' }, - TabLineFill = { bg = 'none' }, - ZenBg = { bg = 'none' }, - } - end, - }, - config = function(_, opts) - require('catppuccin').setup(opts) - end, - }, - { - 'folke/tokyonight.nvim', - lazy = false, - priority = 1000, - opts = { - transparent = false, - styles = { - keywords = { italic = false }, - }, - on_highlights = function(hl, c) - local prompt = '#2d3149' - hl.TelescopeNormal = { - bg = c.bg_dark, - fg = c.fg_dark, - } - hl.TelescopeBorder = { - bg = c.bg_dark, - fg = c.bg_dark, - } - hl.TelescopePromptNormal = { - bg = prompt, - } - hl.TelescopePromptBorder = { - bg = prompt, - fg = prompt, - } - hl.TelescopePromptTitle = { - bg = prompt, - fg = prompt, - } - hl.TelescopePreviewTitle = { - bg = c.bg_dark, - fg = c.bg_dark, - } - hl.TelescopeResultsTitle = { - bg = c.bg_dark, - fg = c.bg_dark, - } - hl.CursorLineSign = { - fg = hl.Constant.fg, - } - hl.LineNr = { - fg = hl.Constant.fg, - } - hl.LineNrAbove = { - fg = '#737aa2', - } - hl.LineNrBelow = { - fg = '#737aa2', - } - end, - }, - }, - { - 'neanias/everforest-nvim', - version = false, - lazy = false, - priority = 1000, - opts = { - background = 'hard', - transparent_background_level = 0, - }, - config = function(_, opts) - require('everforest').setup(opts) - end, - }, - { - 'webhooked/kanso.nvim', - lazy = false, - priority = 1000, - opts = { - keywordStyle = { italic = false }, - }, - }, -} diff --git a/lua/custom/plugins/dap.lua b/lua/custom/plugins/dap.lua new file mode 100644 index 0000000..1086e71 --- /dev/null +++ b/lua/custom/plugins/dap.lua @@ -0,0 +1,194 @@ +vim.api.nvim_create_augroup('DapGroup', { clear = true }) + +local function navigate(args) + local buffer = args.buf + + local wid = nil + local win_ids = vim.api.nvim_list_wins() -- Get all window IDs + for _, win_id in ipairs(win_ids) do + local win_bufnr = vim.api.nvim_win_get_buf(win_id) + if win_bufnr == buffer then + wid = win_id + end + end + + if wid == nil then + return + end + + vim.schedule(function() + if vim.api.nvim_win_is_valid(wid) then + vim.api.nvim_set_current_win(wid) + end + end) +end + +local function create_nav_options(name) + return { + group = 'DapGroup', + pattern = string.format('*%s*', name), + callback = navigate, + } +end + +return { + { + 'mfussenegger/nvim-dap', + lazy = false, + config = function() + local dap = require 'dap' + dap.set_log_level 'DEBUG' + + vim.keymap.set('n', '', dap.continue, { desc = 'Debug: Continue' }) + vim.keymap.set('n', '', dap.step_over, { desc = 'Debug: Step Over' }) + vim.keymap.set('n', '', dap.step_into, { desc = 'Debug: Step Into' }) + vim.keymap.set('n', '', dap.step_out, { desc = 'Debug: Step Out' }) + vim.keymap.set('n', 'b', dap.toggle_breakpoint, { desc = 'Debug: Toggle Breakpoint' }) + vim.keymap.set('n', 'B', function() + dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') + end, { desc = 'Debug: Set Conditional Breakpoint' }) + end, + }, + + { + 'rcarriga/nvim-dap-ui', + dependencies = { 'mfussenegger/nvim-dap', 'nvim-neotest/nvim-nio' }, + config = function() + local dap = require 'dap' + local dapui = require 'dapui' + local function layout(name) + return { + elements = { + { id = name }, + }, + enter = true, + size = 40, + position = 'right', + } + end + local name_to_layout = { + repl = { layout = layout 'repl', index = 0 }, + stacks = { layout = layout 'stacks', index = 0 }, + scopes = { layout = layout 'scopes', index = 0 }, + console = { layout = layout 'console', index = 0 }, + watches = { layout = layout 'watches', index = 0 }, + breakpoints = { layout = layout 'breakpoints', index = 0 }, + } + local layouts = {} + + for name, config in pairs(name_to_layout) do + table.insert(layouts, config.layout) + name_to_layout[name].index = #layouts + end + + local function toggle_debug_ui(name) + dapui.close() + local layout_config = name_to_layout[name] + + if layout_config == nil then + error(string.format('bad name: %s', name)) + end + + local uis = vim.api.nvim_list_uis()[1] + if uis ~= nil then + layout_config.size = uis.width + end + + pcall(dapui.toggle, layout_config.index) + end + + vim.keymap.set('n', 'dr', function() + toggle_debug_ui 'repl' + end, { desc = 'Debug: toggle repl ui' }) + vim.keymap.set('n', 'ds', function() + toggle_debug_ui 'stacks' + end, { desc = 'Debug: toggle stacks ui' }) + vim.keymap.set('n', 'dw', function() + toggle_debug_ui 'watches' + end, { desc = 'Debug: toggle watches ui' }) + vim.keymap.set('n', 'db', function() + toggle_debug_ui 'breakpoints' + end, { desc = 'Debug: toggle breakpoints ui' }) + vim.keymap.set('n', 'dS', function() + toggle_debug_ui 'scopes' + end, { desc = 'Debug: toggle scopes ui' }) + vim.keymap.set('n', 'dc', function() + toggle_debug_ui 'console' + end, { desc = 'Debug: toggle console ui' }) + + vim.api.nvim_create_autocmd('BufEnter', { + group = 'DapGroup', + pattern = '*dap-repl*', + callback = function() + vim.wo.wrap = true + end, + }) + + vim.api.nvim_create_autocmd('BufWinEnter', create_nav_options 'dap-repl') + vim.api.nvim_create_autocmd('BufWinEnter', create_nav_options 'DAP Watches') + + dapui.setup { + layouts = layouts, + enter = true, + } + + dap.listeners.before.event_terminated.dapui_config = function() + dapui.close() + end + dap.listeners.before.event_exited.dapui_config = function() + dapui.close() + end + + dap.listeners.after.event_output.dapui_config = function(_, body) + if body.category == 'console' then + dapui.eval(body.output) -- Sends stdout/stderr to Console + end + end + end, + }, + + { + 'jay-babu/mason-nvim-dap.nvim', + dependencies = { + 'williamboman/mason.nvim', + 'mfussenegger/nvim-dap', + 'neovim/nvim-lspconfig', + }, + config = function() + require('mason-nvim-dap').setup { + ensure_installed = { + 'delve', + }, + automatic_installation = true, + handlers = { + function(config) + require('mason-nvim-dap').default_setup(config) + end, + delve = function(config) + table.insert(config.configurations, 1, { + args = function() + return vim.split(vim.fn.input 'args> ', ' ') + end, + type = 'delve', + name = 'file', + request = 'launch', + program = '${file}', + outputMode = 'remote', + }) + table.insert(config.configurations, 1, { + args = function() + return vim.split(vim.fn.input 'args> ', ' ') + end, + type = 'delve', + name = 'file args', + request = 'launch', + program = '${file}', + outputMode = 'remote', + }) + require('mason-nvim-dap').default_setup(config) + end, + }, + } + end, + }, +} diff --git a/lua/custom/plugins/harpoon.lua b/lua/custom/plugins/harpoon.lua new file mode 100644 index 0000000..f8ed6e6 --- /dev/null +++ b/lua/custom/plugins/harpoon.lua @@ -0,0 +1,102 @@ +return { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + dependencies = { 'nvim-lua/plenary.nvim' }, + config = function() + require('harpoon'):setup() + end, + keys = function() + local harpoon = require 'harpoon' + + local keybinds = { + { + '', + function() + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, + mode = 'n', + desc = 'Harpoon: Show marks', + }, + { + 'a', + function() + harpoon:list():add() + end, + mode = 'n', + desc = 'Harpoon: Mark file', + }, + } + + for k, v in pairs { '+', '[', '{', '(', '&', '=', ')', '}', ']', '*' } do + table.insert(keybinds, { + '' .. v, + function() + harpoon:list():select(k) + end, + mode = 'n', + desc = 'Harpoon: Go to mark ' .. k, + }) + end + + return keybinds + end, + -- return { + -- { + -- '', + -- function() + -- harpoon.ui:toggle_quick_menu(harpoon:list()) + -- end, + -- mode = 'n', + -- desc = 'Harpoon: Show marks', + -- }, + -- { + -- 'a', + -- function() + -- harpoon:list():add() + -- end, + -- mode = 'n', + -- desc = 'Harpoon: Mark file', + -- }, + -- { + -- '+', + -- function() + -- harpoon:list():select(1) + -- end, + -- mode = 'n', + -- desc = 'Harpoon: Go to mark 1', + -- }, + -- { + -- '[', + -- function() + -- harpoon:list():select(2) + -- end, + -- mode = 'n', + -- desc = 'Harpoon: Go to mark 2', + -- }, + -- { + -- '{', + -- function() + -- harpoon:list():select(3) + -- end, + -- mode = 'n', + -- desc = 'Harpoon: Go to mark 3', + -- }, + -- { + -- '(', + -- function() + -- harpoon:list():select(4) + -- end, + -- mode = 'n', + -- desc = 'Harpoon: Go to mark 4', + -- }, + -- { + -- '&', + -- function() + -- harpoon:list():select(5) + -- end, + -- mode = 'n', + -- desc = 'Harpoon: Go to mark 5', + -- }, + -- } + -- end, +} diff --git a/lua/custom/plugins/trouble.lua b/lua/custom/plugins/trouble.lua new file mode 100644 index 0000000..e8124ac --- /dev/null +++ b/lua/custom/plugins/trouble.lua @@ -0,0 +1,22 @@ +return { + { + 'folke/trouble.nvim', + config = function() + require('trouble').setup { + icons = false, + } + + vim.keymap.set('n', 'tt', function() + require('trouble').toggle() + end) + + vim.keymap.set('n', '[t', function() + require('trouble').next { skip_groups = true, jump = true } + end) + + vim.keymap.set('n', ']t', function() + require('trouble').previous { skip_groups = true, jump = true } + end) + end, + }, +} diff --git a/lua/custom/plugins/undotree.lua b/lua/custom/plugins/undotree.lua new file mode 100644 index 0000000..a5ce180 --- /dev/null +++ b/lua/custom/plugins/undotree.lua @@ -0,0 +1,7 @@ +return { + 'mbbill/undotree', + + config = function() + vim.keymap.set('n', 'u', vim.cmd.UndotreeToggle) + end, +} diff --git a/lua/custom/plugins/vimbegood.lua b/lua/custom/plugins/vimbegood.lua new file mode 100644 index 0000000..6602601 --- /dev/null +++ b/lua/custom/plugins/vimbegood.lua @@ -0,0 +1,9 @@ +return { + 'theprimeagen/vim-be-good', + + dependencies = { + 'nvim-lua/plenary.nvim', + }, + + config = function() end, +}