Bash debug adapter, adjust diffopt

main
Amanda Graven 2023-04-19 10:43:45 +02:00
parent 443d2b8b94
commit 2486dba138
No known key found for this signature in database
GPG Key ID: 79A68E63058F3BA1
1 changed files with 26 additions and 2 deletions

View File

@ -49,6 +49,7 @@ opt.fillchars = { -- Characters to fill certain types of empty space
diff = ' ',
fold = ' ',
}
opt.diffopt:append({'indent-heuristic', 'algorithm:histogram'})
o.tabstop = 4 -- A physical tab is 4 characters wide
o.shiftwidth = 4 -- A unit of indentention is 4 levels wide
@ -294,8 +295,8 @@ require'packer'.startup(function(use)
local null_ls = require'null-ls'
null_ls.setup {
sources = {
null_ls.builtins.diagnostics.zsh,
null_ls.builtins.code_actions.shellcheck,
null_ls.builtins.diagnostics.shellcheck,
}
}
end}
@ -323,6 +324,10 @@ require'packer'.startup(function(use)
args = {'--port', '${port}'},
},
}
dap.adapters.sh = {
type = 'executable',
command = vim.fn.stdpath('data') .. '/mason/packages/bash-debug-adapter/bash-debug-adapter'
}
dap.configurations.cpp = {
{
name = 'Launch file',
@ -336,7 +341,26 @@ require'packer'.startup(function(use)
},
}
dap.configurations.rust = dap.configurations.cpp
dap.configurations.c = dap.configurations.c
dap.configurations.c = dap.configurations.cpp
dap.configurations.sh = {
{
name = 'Bash debugger',
type = 'sh',
request = 'launch',
program = '${file}',
cwd = '${fileDirname}',
pathBashdb = vim.fn.stdpath('data') .. '/mason/packages/bash-debug-adapter/extension/bashdb_dir/bashdb',
pathBashdbLib = vim.fn.stdpath('data') .. '/mason/packages/bash-debug-adapter/extension/bashdb_dir',
pathBash = 'bash',
pathCat = 'cat',
pathMkfifo = 'mkfifo',
pathPkill = 'pkill',
env = {},
args = function ()
return vim.fn.split(vim.fn.input('Arguments: ', '', 'file'))
end,
},
}
local function conditional_breakpoint()
vim.ui.input({prompt = 'Breakpoint condition'}, function(condition)
if not condition then return end