persistent-breakpoints is a lua plugin for Neovim to save the nvim-dap's checkpoints to file and automatically load them when you open neovim. It is based on the code in here, but has better performance and some bugs are fixed.
:star: Your stars are my biggest motivation.
packer.nvim
use {'Weissle/persistent-breakpoints.nvim'}
vim-plug
Plug 'Weissle/persistent-breakpoints.nvim'
require('persistent-breakpoints').setup{} -- use default config
Below is the default config, you can change it according to your need.
require('persistent-breakpoints').setup{
save_dir = vim.fn.stdpath('data') .. '/nvim_checkpoints',
-- record the performance of different function. run :lua require('persistent-breakpoints.api').print_perf_data() to see the result.
perf_record = false,
}
-- automatically load breakpoints when a file is loaded into the buffer.
vim.api.nvim_create_autocmd({"BufReadPost"},{ callback = require('persistent-breakpoints.api').load_breakpoints })
local opts = { noremap = true, silent = true }
local keymap = vim.api.nvim_set_keymap
-- Save breakpoints to file automatically.
keymap("n", "<YourKey1>", "<cmd>lua require('persistent-breakpoints.api').toggle_breakpoint()<cr>", opts)
keymap("n", "<YourKey2>", "<cmd>lua require('persistent-breakpoints.api').set_conditional_breakpoint()<cr>", opts)
keymap("n", "<YourKey3>", "<cmd>lua require('persistent-breakpoints.api').clear_all_breakpoints()<cr>", opts)
Like :lua require('dap').toggle_breakpoint()
Like :lua require('dap').set_breakpoint(vim.fn.input('[Condition] > '))
Like :lua require('dap').clear_breakpoints()
/a/b/
and you add breakpoints to file /a/b/c.xx
, file /a/b/c.xx
's breakpoints are not loaded when your pwd is not /a/b/
.PR and ISSUE are welcome: