Archived
0
0
Fork 0

added neovim debugging support

Signed-off-by: Daryl Ronningen <relms@relms.dev>
This commit is contained in:
Daryl Ronningen 2022-06-29 14:21:21 +08:00
parent 26b36f6200
commit b347422333
Signed by: Daryl Ronningen
GPG key ID: FD23F0C934A5EC6B
7 changed files with 98 additions and 0 deletions

View file

@ -21,3 +21,5 @@ require("user.whichkey")
require("user.trouble") require("user.trouble")
require("user.colorizer") require("user.colorizer")
require("user.discord") require("user.discord")
require("user.spectre")
require("user.dap")

View file

@ -0,0 +1,12 @@
local dapui_status_ok, dapui = pcall(require, "dapui")
if not dapui_status_ok then
return
end
local vtest_status_ok, vtest = pcall(require, "nvim-dap-virtual-text")
if not vtest_status_ok then
return
end
dapui.setup()
vtest.setup()

View file

@ -41,6 +41,7 @@ keymap("n", "<leader>fg", ":Telescope live_grep<CR>", opts)
keymap("n", "<leader>fb", ":Telescope buffers<CR>", opts) keymap("n", "<leader>fb", ":Telescope buffers<CR>", opts)
keymap("n", "<leader>fe", ":Telescope emoji<CR>", opts) keymap("n", "<leader>fe", ":Telescope emoji<CR>", opts)
keymap("n", "<leader>fp", ":Telescope project<CR>", opts) keymap("n", "<leader>fp", ":Telescope project<CR>", opts)
keymap("n", "<leader>fd", ":Telescope dap commands<CR>", opts)
-- Comment -- Comment
keymap("n", "<leader>/", ":lua require('Comment').toggle()<CR>", opts) keymap("n", "<leader>/", ":lua require('Comment').toggle()<CR>", opts)
@ -55,6 +56,45 @@ keymap("n", "<leader>xd", ":Trouble document_diagnostics<CR>", opts)
keymap("n", "<leader>xl", ":Trouble loclist<CR>", opts) keymap("n", "<leader>xl", ":Trouble loclist<CR>", opts)
keymap("n", "<leader>xq", ":Trouble quickfix<CR>", opts) keymap("n", "<leader>xq", ":Trouble quickfix<CR>", opts)
-- DAP
keymap("n", "<F4>", ":lua require('dapui').toggle()<CR>", opts)
keymap("n", "<F5>", ":lua require('dap').toggle_breakpoint()<CR>", opts)
keymap("n", "<F9>", ":lua require('dap').continue()<CR>", opts)
keymap("n", "<F1>", ":lua require('dap').step_over()<CR>", opts)
keymap("n", "<F2>", ":lua require('dap').step_into()<CR>", opts)
keymap("n", "<F3>", ":lua require('dap').step_out()<CR>", opts)
keymap("n", "<leader>dsc", ":lua require('dap').continue()<CR>", opts)
keymap("n", "<leader>dsv", ":lua require('dap').step_over()<CR>", opts)
keymap("n", "<leader>dsi", ":lua require('dap').step_into()<CR>", opts)
keymap("n", "<leader>dso", ":lua require('dap').step_out()<CR>", opts)
keymap("n", "<leader>dhh", ":lua require('dap.ui.variables').hover()<CR>", opts)
keymap("v", "<leader>dhv", ":lua require('dap.ui.variables').visual_hover()<CR>", opts)
keymap("n", "<leader>duh", ":lua require('dap.ui.widgets').hover()<CR>", opts)
keymap(
"n",
"<leader>duf",
":lua local widgets=require('dap.ui.widgets');widgets.centered_float(widgets.scopes)<CR>",
opts
)
keymap("n", "<leader>dro", ":lua require('dap').repl.open()<CR>", opts)
keymap("n", "<leader>drl", ":lua require('dap').repl.run_last()<CR>", opts)
keymap("n", "<leader>dbc", ":lua require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: '))<CR>", opts)
keymap(
"n",
"<leader>dbm",
":lua require('dap').set_breakpoint({ nil, nil, vim.fn.input('Log point message: ') })<CR>",
opts
)
keymap("n", "<leader>dbt", ":lua require('dap').toggle_breakpoint()<CR>", opts)
keymap("n", "<leader>dc", ":lua require('dap.ui.variables').scopes()<CR>", opts)
keymap("n", "<leader>di", ":lua require('dapui').toggle()<CR>", opts)
-- Spectre
keymap("n", "<leader>S", ":lua require('spectre').open()<CR>", opts)
keymap("n", "<leader>sw", ":lua require('spectre').open_visual({select_word=true})<CR>", opts)
keymap("n", "<leader>s", ":lua require('spectre').open_visual()<CR>", opts)
keymap("n", "<leader>sp", ":lua require('spectre').open_file_search()<CR>", opts)
-- Insert -- -- Insert --
-- Visual -- -- Visual --

View file

@ -81,6 +81,7 @@ return packer.startup(function(use)
use("nvim-telescope/telescope-project.nvim") use("nvim-telescope/telescope-project.nvim")
use("nvim-telescope/telescope-frecency.nvim") use("nvim-telescope/telescope-frecency.nvim")
use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" }) use({ "nvim-telescope/telescope-fzf-native.nvim", run = "make" })
use("nvim-telescope/telescope-dap.nvim")
-- Treesitter -- Treesitter
use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" }) use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" })
@ -140,6 +141,14 @@ return packer.startup(function(use)
-- Discord -- Discord
use("andweeb/presence.nvim") use("andweeb/presence.nvim")
-- DAP
use("mfussenegger/nvim-dap")
use("rcarriga/nvim-dap-ui")
use("theHamsta/nvim-dap-virtual-text")
-- Spectre
use("windwp/nvim-spectre")
if PACKER_BOOTSTRAP then if PACKER_BOOTSTRAP then
require("packer").sync() require("packer").sync()
end end

View file

@ -0,0 +1,9 @@
local status_ok, spectre = pcall(require, "spectre")
if not status_ok then
return
end
spectre.setup({
live_update = false,
is_insert_mode = false,
})

View file

@ -10,6 +10,7 @@ telescope.load_extension("repo")
telescope.load_extension("emoji") telescope.load_extension("emoji")
telescope.load_extension("project") telescope.load_extension("project")
telescope.load_extension("frecency") telescope.load_extension("frecency")
telescope.load_extension("dap")
local actions = require("telescope.actions") local actions = require("telescope.actions")

View file

@ -194,6 +194,21 @@ _G.packer_plugins = {
path = "/home/relms/.local/share/nvim/site/pack/packer/start/nvim-colorizer.lua", path = "/home/relms/.local/share/nvim/site/pack/packer/start/nvim-colorizer.lua",
url = "https://github.com/norcalli/nvim-colorizer.lua" url = "https://github.com/norcalli/nvim-colorizer.lua"
}, },
["nvim-dap"] = {
loaded = true,
path = "/home/relms/.local/share/nvim/site/pack/packer/start/nvim-dap",
url = "https://github.com/mfussenegger/nvim-dap"
},
["nvim-dap-ui"] = {
loaded = true,
path = "/home/relms/.local/share/nvim/site/pack/packer/start/nvim-dap-ui",
url = "https://github.com/rcarriga/nvim-dap-ui"
},
["nvim-dap-virtual-text"] = {
loaded = true,
path = "/home/relms/.local/share/nvim/site/pack/packer/start/nvim-dap-virtual-text",
url = "https://github.com/theHamsta/nvim-dap-virtual-text"
},
["nvim-lsp-installer"] = { ["nvim-lsp-installer"] = {
loaded = true, loaded = true,
path = "/home/relms/.local/share/nvim/site/pack/packer/start/nvim-lsp-installer", path = "/home/relms/.local/share/nvim/site/pack/packer/start/nvim-lsp-installer",
@ -209,6 +224,11 @@ _G.packer_plugins = {
path = "/home/relms/.local/share/nvim/site/pack/packer/start/nvim-navic", path = "/home/relms/.local/share/nvim/site/pack/packer/start/nvim-navic",
url = "https://github.com/SmiteshP/nvim-navic" url = "https://github.com/SmiteshP/nvim-navic"
}, },
["nvim-spectre"] = {
loaded = true,
path = "/home/relms/.local/share/nvim/site/pack/packer/start/nvim-spectre",
url = "https://github.com/windwp/nvim-spectre"
},
["nvim-tree.lua"] = { ["nvim-tree.lua"] = {
loaded = true, loaded = true,
path = "/home/relms/.local/share/nvim/site/pack/packer/start/nvim-tree.lua", path = "/home/relms/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
@ -264,6 +284,11 @@ _G.packer_plugins = {
path = "/home/relms/.local/share/nvim/site/pack/packer/start/sqlite.lua", path = "/home/relms/.local/share/nvim/site/pack/packer/start/sqlite.lua",
url = "https://github.com/tami5/sqlite.lua" url = "https://github.com/tami5/sqlite.lua"
}, },
["telescope-dap.nvim"] = {
loaded = true,
path = "/home/relms/.local/share/nvim/site/pack/packer/start/telescope-dap.nvim",
url = "https://github.com/nvim-telescope/telescope-dap.nvim"
},
["telescope-emoji.nvim"] = { ["telescope-emoji.nvim"] = {
loaded = true, loaded = true,
path = "/home/relms/.local/share/nvim/site/pack/packer/start/telescope-emoji.nvim", path = "/home/relms/.local/share/nvim/site/pack/packer/start/telescope-emoji.nvim",