diff options
Diffstat (limited to '.config/nvim')
| -rw-r--r-- | .config/nvim/init.vim | 5 | ||||
| -rw-r--r-- | .config/nvim/lua/dap_lldb.lua | 37 |
2 files changed, 42 insertions, 0 deletions
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index cbca761..3503890 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -66,6 +66,9 @@ Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.x' } Plug 'ThePrimeagen/harpoon', { 'branch': 'harpoon2' } Plug 'neovim/nvim-lspconfig' +Plug 'mfussenegger/nvim-dap' +Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} +Plug 'theHamsta/nvim-dap-virtual-text' call plug#end() let g:coc_global_extensions = [ @@ -82,6 +85,8 @@ let g:coc_global_extensions = [ lua vim.g.coq_settings = {auto_start = 'shut-up',} +lua require("dap_lldb") + " Goyo plugin makes text more readable when writing prose: map <leader>f :Goyo \| set linebreak<CR> diff --git a/.config/nvim/lua/dap_lldb.lua b/.config/nvim/lua/dap_lldb.lua new file mode 100644 index 0000000..495fb72 --- /dev/null +++ b/.config/nvim/lua/dap_lldb.lua @@ -0,0 +1,37 @@ +local dap = require('dap') +dap.adapters.lldb = { + type = 'executable', + command = '/usr/bin/lldb-vscode', -- adjust as needed, must be absolute path + name = 'lldb' +} + +local dap = require('dap') +dap.configurations.c = { + { + name = 'Launch', + type = 'lldb', + request = 'launch', + program = function() + return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file') + end, + cwd = '${workspaceFolder}', + stopOnEntry = false, + args = {}, + + -- 💀 + -- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting: + -- + -- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope + -- + -- Otherwise you might get the following error: + -- + -- Error on launch: Failed to attach to the target process + -- + -- But you should be aware of the implications: + -- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html + -- runInTerminal = false, + }, +} + +dap.configurations.cpp = dap.configurations.c +require("nvim-dap-virtual-text").setup() |
