vim c++ debugging and session commands
This commit is contained in:
@@ -54,7 +54,7 @@ update_ms = 400
|
|||||||
|
|
||||||
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct",
|
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct",
|
||||||
#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly.
|
#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly.
|
||||||
proc_sorting = "cpu direct"
|
proc_sorting = "cpu lazy"
|
||||||
|
|
||||||
#* Reverse sorting order, True or False.
|
#* Reverse sorting order, True or False.
|
||||||
proc_reversed = False
|
proc_reversed = False
|
||||||
|
|||||||
@@ -1,15 +1,116 @@
|
|||||||
local lsp = require('lsp-zero')
|
local lsp = require('lsp-zero')
|
||||||
local cmp = require('cmp')
|
local cmp = require('cmp')
|
||||||
local luasnip = require('luasnip')
|
local luasnip = require('luasnip')
|
||||||
|
local dap = require('dap')
|
||||||
|
local dapui = require('dapui')
|
||||||
|
|
||||||
require('mason').setup({})
|
require('mason').setup({})
|
||||||
|
require('mason-nvim-dap').setup({
|
||||||
|
ensure_installed = {
|
||||||
|
'cpptools',
|
||||||
|
'cppdbg',
|
||||||
|
},
|
||||||
|
})
|
||||||
require('mason-lspconfig').setup({})
|
require('mason-lspconfig').setup({})
|
||||||
|
|
||||||
|
dap.configurations = {
|
||||||
|
cpp = {
|
||||||
|
{
|
||||||
|
name = "Launch",
|
||||||
|
type = "codelldb",
|
||||||
|
request = "launch",
|
||||||
|
program = function()
|
||||||
|
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build/', 'file')
|
||||||
|
end,
|
||||||
|
cwd = '${workspaceFolder}',
|
||||||
|
stopOnEntry = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
dap.adapters.codelldb = {
|
||||||
|
type = 'server',
|
||||||
|
port = '13000',
|
||||||
|
host = '127.0.0.1',
|
||||||
|
executable = {
|
||||||
|
command = vim.fn.stdpath('data') .. '/mason/bin/codelldb',
|
||||||
|
args = {"--port", "13000"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dapui.setup({
|
||||||
|
icons = { expanded = "➡️", collapsed = "⬇️" },
|
||||||
|
mappings = {
|
||||||
|
open = "o",
|
||||||
|
remove = "d",
|
||||||
|
edit = "e",
|
||||||
|
repl = "r",
|
||||||
|
toggle = "t",
|
||||||
|
},
|
||||||
|
expand_lines = vim.fn.has("nvim-0.7"),
|
||||||
|
layouts = {
|
||||||
|
{
|
||||||
|
elements = {
|
||||||
|
"scopes",
|
||||||
|
"stacks",
|
||||||
|
"watches"
|
||||||
|
},
|
||||||
|
size = 0.2,
|
||||||
|
position = "left"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
elements = {
|
||||||
|
"repl",
|
||||||
|
"console",
|
||||||
|
"breakpoints",
|
||||||
|
},
|
||||||
|
size = 0.3,
|
||||||
|
position = "bottom",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
floating = {
|
||||||
|
max_height = nil,
|
||||||
|
max_width = nil,
|
||||||
|
border = "single",
|
||||||
|
mappings = {
|
||||||
|
close = { "q", "<Esc>" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
windows = { indent = 1 },
|
||||||
|
render = {
|
||||||
|
max_type_length = nil,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
dap.listeners.after.event_initialized["dapui_config"]=function()
|
||||||
|
dapui.open()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_terminated["dapui_config"]=function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_exited["dapui_config"]=function()
|
||||||
|
dapui.close()
|
||||||
|
end
|
||||||
|
vim.keymap.set("n", "<leader>ds", function()
|
||||||
|
dap.continue()
|
||||||
|
dapui.toggle({})
|
||||||
|
end)
|
||||||
|
vim.keymap.set("n", "<leader>de", function()
|
||||||
|
dapui.toggle({})
|
||||||
|
dap.terminate()
|
||||||
|
require("notify")("Debugger session ended", "warn")
|
||||||
|
end)
|
||||||
|
vim.keymap.set("n", "<leader>dC", function()
|
||||||
|
require('dap').clear_breakpoints()
|
||||||
|
require("notify")("Cleared breakpoints", "warn")
|
||||||
|
end)
|
||||||
|
vim.fn.sign_define('DapBreakpoint',{ text ='🔴', texthl ='', linehl ='', numhl =''})
|
||||||
|
vim.fn.sign_define('DapStopped',{ text ='▶️', texthl ='', linehl ='', numhl =''})
|
||||||
|
|
||||||
lsp.preset({
|
lsp.preset({
|
||||||
name = 'recommended',
|
name = 'recommended',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
lsp.ensure_installed({
|
lsp.ensure_installed({
|
||||||
'tsserver',
|
'tsserver',
|
||||||
'clangd',
|
'clangd',
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ return {
|
|||||||
'debugloop/telescope-undo.nvim',
|
'debugloop/telescope-undo.nvim',
|
||||||
'folke/todo-comments.nvim',
|
'folke/todo-comments.nvim',
|
||||||
'kevinhwang91/nvim-bqf',
|
'kevinhwang91/nvim-bqf',
|
||||||
|
'rcarriga/nvim-notify',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require('plugin-config/telescope')
|
require('plugin-config/telescope')
|
||||||
@@ -232,6 +233,8 @@ return {
|
|||||||
-- LSP Support
|
-- LSP Support
|
||||||
{ 'neovim/nvim-lspconfig' },
|
{ 'neovim/nvim-lspconfig' },
|
||||||
{ 'williamboman/mason.nvim' },
|
{ 'williamboman/mason.nvim' },
|
||||||
|
{ 'mfussenegger/nvim-dap' },
|
||||||
|
{ 'jay-babu/mason-nvim-dap.nvim' },
|
||||||
{ 'williamboman/mason-lspconfig.nvim' },
|
{ 'williamboman/mason-lspconfig.nvim' },
|
||||||
|
|
||||||
{ 'simrat39/rust-tools.nvim' },
|
{ 'simrat39/rust-tools.nvim' },
|
||||||
@@ -264,6 +267,13 @@ return {
|
|||||||
dependencies = {
|
dependencies = {
|
||||||
'mfussenegger/nvim-dap',
|
'mfussenegger/nvim-dap',
|
||||||
},
|
},
|
||||||
|
keys = {
|
||||||
|
{ '<leader>db', '<cmd>lua require("dap").toggle_breakpoint()<cr>', desc = "Toggle DAP UI" },
|
||||||
|
{ '<leader>dc', '<cmd>lua require("dap").continue()<cr>' },
|
||||||
|
{ '<leader>dn', '<cmd>lua require("dap").step_over()<cr>' },
|
||||||
|
{ '<leader>di', '<cmd>lua require("dap").step_into()<cr>' },
|
||||||
|
{ '<leader>do', '<cmd>lua require("dap").step_out()<cr>' },
|
||||||
|
},
|
||||||
lazy = false
|
lazy = false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -103,3 +103,8 @@ nn <leader>r :Telescope registers<cr>
|
|||||||
|
|
||||||
" Paste and keep the " register
|
" Paste and keep the " register
|
||||||
nn <leader>p "_dP
|
nn <leader>p "_dP
|
||||||
|
|
||||||
|
" on leader vs, run mksession! .vims
|
||||||
|
nn <leader>vs :mksession! .vims<cr>
|
||||||
|
nn <leader>vl :source .vims<cr>
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || pr
|
|||||||
|
|
||||||
export PATH=$PATH:$HOME/.local/bin/
|
export PATH=$PATH:$HOME/.local/bin/
|
||||||
export PATH=$PATH:$HOME/.cargo/env/
|
export PATH=$PATH:$HOME/.cargo/env/
|
||||||
export MAKEFLAGS="-j$(nproc)"
|
export MAKEFLAGS="-j20"
|
||||||
|
|
||||||
source $HOME/.zshrc.local
|
source $HOME/.zshrc.local
|
||||||
|
|
||||||
|
|||||||
1
node_modules/.cache/custom-elements-language-server/custom-elements.json
generated
vendored
Normal file
1
node_modules/.cache/custom-elements-language-server/custom-elements.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{"schemaVersion":"1.0.0","readme":"","modules":[{"kind":"javascript-module","path":"add-dotfile.js","declarations":[],"exports":[]},{"kind":"javascript-module","path":"bootstrap.js","declarations":[],"exports":[]},{"kind":"javascript-module","path":"host-seperation.js","declarations":[],"exports":[]}]}
|
||||||
Reference in New Issue
Block a user