From 0d7e4dadab1edca76fb0e0c46e5c2b9d4e49f0aa Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Wed, 15 Feb 2023 21:01:33 -0500 Subject: [PATCH] debug works much better now --- doc/kickstart.txt | 24 ++++++ doc/tags | 3 + init.lua | 13 +-- lua/custom/plugins/init.lua | 3 + lua/kickstart/plugins/debug.lua | 139 +++++++++++++++++--------------- 5 files changed, 112 insertions(+), 70 deletions(-) create mode 100644 doc/kickstart.txt create mode 100644 doc/tags create mode 100644 lua/custom/plugins/init.lua diff --git a/doc/kickstart.txt b/doc/kickstart.txt new file mode 100644 index 0000000..cb87ac3 --- /dev/null +++ b/doc/kickstart.txt @@ -0,0 +1,24 @@ +================================================================================ +INTRODUCTION *kickstart.nvim* + +Kickstart.nvim is a project to help you get started on your neovim journey. + + *kickstart-is-not* +It is not: +- Complete framework for every plugin under the sun +- Place to add every plugin that could ever be useful + + *kickstart-is* +It is: +- Somewhere that has a good start for the most common "IDE" type features: + - autocompletion + - goto-definition + - find references + - fuzzy finding + - and hinting at what more can be done :) +- A place to _kickstart_ your journey. + - You should fork this project and use/modify it so that it matches your + style and preferences. If you don't want to do that, there are probably + other projects that would fit much better for you (and that's great!)! + + vim:tw=78:ts=8:ft=help:norl: diff --git a/doc/tags b/doc/tags new file mode 100644 index 0000000..687ae77 --- /dev/null +++ b/doc/tags @@ -0,0 +1,3 @@ +kickstart-is kickstart.txt /*kickstart-is* +kickstart-is-not kickstart.txt /*kickstart-is-not* +kickstart.nvim kickstart.txt /*kickstart.nvim* diff --git a/init.lua b/init.lua index 7d0b86f..f47d04f 100644 --- a/init.lua +++ b/init.lua @@ -77,13 +77,14 @@ require('lazy').setup({ end, }, - -- Next Step: Add additional "plugins" for kickstart - require 'kickstart.plugins.autoformat', - -- require('kickstart.plugins.debug'), + -- Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart + -- require 'kickstart.plugins.autoformat', + -- require 'kickstart.plugins.debug', - -- TODO: - -- { import = 'kickstart.plugins' }, - -- { import = 'custom.plugins' }, + -- Add your own custom plugins to `lua/custom/plugins/*.lua` + -- For more information see: + -- https://github.com/folke/lazy.nvim#-structuring-your-plugins + { import = 'custom.plugins' }, }, {}) -- [[ Setting options ]] diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua new file mode 100644 index 0000000..cdc244c --- /dev/null +++ b/lua/custom/plugins/init.lua @@ -0,0 +1,3 @@ +-- You can add your own plugins here or in other files in this directory! +-- I promise not to create any merge conflicts in this directory :) +return {} diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index a618452..33e3980 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -1,69 +1,80 @@ return { - { - enabled = true, - config = function() - -- Optional debug adapter setup - -- - -- To enable setup, change `disable = true` in the packer section - -- of the init.lua. You'll also want to copy this file into your - -- config at ~/.config/nvim/after/plugin/dap.lua + 'mfussenegger/nvim-dap', + dependencies = { + -- Creates a beautiful debugger UI + 'rcarriga/nvim-dap-ui', - local dapui = require 'dapui' + -- Installs the debug adapters for you + 'williamboman/mason.nvim', + 'jay-babu/mason-nvim-dap.nvim', - require('mason-nvim-dap').setup { - -- Makes a best effort to setup the various debuggers with - -- reasonable debug configurations - automatic_setup = true, - - -- You'll need to check that you have the required things installed - -- online, please don't ask me how to install them :) - ensure_installed = { - -- Update this to ensure that you have the debuggers for the langs you want - 'delve', - }, - } - - -- You can provide additional configuration to the handlers, - -- see mason-nvim-dap README for more information - require('mason-nvim-dap').setup_handlers() - - -- Basic debugging keymaps, feel free to change to your liking! - vim.keymap.set('n', '', require('dap').continue) - vim.keymap.set('n', '', require('dap').step_into) - vim.keymap.set('n', '', require('dap').step_over) - vim.keymap.set('n', '', require('dap').step_out) - vim.keymap.set('n', 'b', require('dap').toggle_breakpoint) - vim.keymap.set('n', 'B', function() - require('dap').set_breakpoint(vim.fn.input 'Breakpoint condition: ') - end) - - -- Dap UI setup - -- For more information, see |:help nvim-dap-ui| - dapui.setup { - -- Set icons to characters that are more likely to work in every terminal. - -- Feel free to remove or use ones that you like more! :) - -- Don't feel like these are good choices. - icons = { expanded = '▾', collapsed = '▸', current_frame = '*' }, - controls = { - icons = { - pause = '⏸', - play = '▶', - step_into = '⏎', - step_over = '⏭', - step_out = '⏮', - step_back = 'b', - run_last = '▶▶', - terminate = '⏹', - }, - }, - } - - dap.listeners.after.event_initialized['dapui_config'] = dapui.open - dap.listeners.before.event_terminated['dapui_config'] = dapui.close - dap.listeners.before.event_exited['dapui_config'] = dapui.close - - -- Install golang specific config - require('dap-go').setup() - end, + -- Add your own debuggers here + 'leoluz/nvim-dap-go', }, + + config = function() + -- Optional debug adapter setup + -- + -- To enable setup, change `disable = true` in the packer section + -- of the init.lua. You'll also want to copy this file into your + -- config at ~/.config/nvim/after/plugin/dap.lua + + local dap = require 'dap' + local dapui = require 'dapui' + + require('mason-nvim-dap').setup { + -- Makes a best effort to setup the various debuggers with + -- reasonable debug configurations + automatic_setup = true, + + -- You'll need to check that you have the required things installed + -- online, please don't ask me how to install them :) + ensure_installed = { + -- Update this to ensure that you have the debuggers for the langs you want + 'delve', + }, + } + + -- You can provide additional configuration to the handlers, + -- see mason-nvim-dap README for more information + require('mason-nvim-dap').setup_handlers() + + -- Basic debugging keymaps, feel free to change to your liking! + vim.keymap.set('n', '', dap.continue) + vim.keymap.set('n', '', dap.step_into) + vim.keymap.set('n', '', dap.step_over) + vim.keymap.set('n', '', dap.step_out) + vim.keymap.set('n', 'b', dap.toggle_breakpoint) + vim.keymap.set('n', 'B', function() + dap.set_breakpoint(vim.fn.input 'Breakpoint condition: ') + end) + + -- Dap UI setup + -- For more information, see |:help nvim-dap-ui| + dapui.setup { + -- Set icons to characters that are more likely to work in every terminal. + -- Feel free to remove or use ones that you like more! :) + -- Don't feel like these are good choices. + icons = { expanded = '▾', collapsed = '▸', current_frame = '*' }, + controls = { + icons = { + pause = '⏸', + play = '▶', + step_into = '⏎', + step_over = '⏭', + step_out = '⏮', + step_back = 'b', + run_last = '▶▶', + terminate = '⏹', + }, + }, + } + + dap.listeners.after.event_initialized['dapui_config'] = dapui.open + dap.listeners.before.event_terminated['dapui_config'] = dapui.close + dap.listeners.before.event_exited['dapui_config'] = dapui.close + + -- Install golang specific config + require('dap-go').setup() + end, }