diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2022-08-19 19:14:53 +0200 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2022-08-19 19:18:19 +0200 |
| commit | 168be4afb2ee51f8b7532a3374237b9f87b70b44 (patch) | |
| tree | b042781ad9e7d08a2fbbebdf794a84f5e6b4443c | |
| parent | 609852c739ef90f090f7084f029e6bb82f4c9501 (diff) | |
| download | nvim-conf-168be4afb2ee51f8b7532a3374237b9f87b70b44.tar.gz nvim-conf-168be4afb2ee51f8b7532a3374237b9f87b70b44.zip | |
config cmp dap
| -rw-r--r-- | after/plugin/cmp.lua | 8 | ||||
| -rw-r--r-- | lua/alpha/dap.lua | 186 | ||||
| -rw-r--r-- | lua/alpha/plugins.lua | 1 | ||||
| -rw-r--r-- | plugin/packer_compiled.lua | 13 |
4 files changed, 111 insertions, 97 deletions
diff --git a/after/plugin/cmp.lua b/after/plugin/cmp.lua index 91de0cd..0065502 100644 --- a/after/plugin/cmp.lua +++ b/after/plugin/cmp.lua @@ -120,6 +120,14 @@ cmp.setup.filetype({ "sql", "mysql", "plsql" }, { }), }) +cmp.setup.filetype({ "dap-repl", "dapui_watches" }, { + sources = cmp.config.sources({ + { name = "dap" }, + }, { + { name = "buffer" }, + }), +}) + -- Setup lspconfig. local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) -- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled. diff --git a/lua/alpha/dap.lua b/lua/alpha/dap.lua index 09824bd..1f62481 100644 --- a/lua/alpha/dap.lua +++ b/lua/alpha/dap.lua @@ -4,62 +4,62 @@ require("nvim-dap-virtual-text").setup({}) -- dap.set_log_level('TRACE') dapui.setup({ - icons = { expanded = "▾", collapsed = "▸" }, - layouts = { - { - elements = { - "scopes", - "breakpoints", - "stacks", - "watches", - }, - size = 80, - position = "left", - }, - { - elements = { - "repl", - -- 'console', - }, - size = 10, - position = "bottom", - }, - }, + icons = { expanded = "▾", collapsed = "▸" }, + layouts = { + { + elements = { + "scopes", + "breakpoints", + "stacks", + "watches", + }, + size = 80, + position = "left", + }, + { + elements = { + "repl", + "console", + }, + size = 10, + position = "bottom", + }, + }, }) dap_go.setup() vim.fn.sign_define("DapBreakpoint", { text = "🛑", texthl = "", linehl = "", numhl = "" }) -vim.fn.sign_define("DapStopped", { text = "⏯️", texthl = "", linehl = "", numhl = "" }) +vim.fn.sign_define("DapStopped", { text = "➡️", texthl = "", linehl = "", numhl = "" }) vim.fn.sign_define("DapBreakpointRejected", { text = "🚫", texthl = "", linehl = "", numhl = "" }) vim.fn.sign_define("DapBreakpointCondition", { text = "❓", texthl = "", linehl = "", numhl = "" }) vim.fn.sign_define("DapLogPoint", { text = "💬", texthl = "", linehl = "", numhl = "" }) -vim.cmd("au FileType dap-repl lua require('dap.ext.autocompl').attach()") +-- vim.cmd("au FileType dap-repl lua require('dap.ext.autocompl').attach()") -- TODO replace with mason for check if installed and get the path -- the binary does not work local php_debug_adapter = vim.fn.stdpath("data") .. "/mason/packages/php-debug-adapter/extension/out/phpDebug.js" dap.adapters.php = { - type = "executable", - command = "node", - args = { php_debug_adapter }, + type = "executable", + command = "node", + args = { php_debug_adapter }, } dap.configurations.php = { - { - type = "php", - request = "launch", - name = "Listen for Xdebug", - port = 9003, - pathMappings = function() - local sail = vim.call("composer#query", "require-dev.laravel/sail") - if sail == "" then - return { ["/app"] = vim.fn.getcwd() } - end - return { ["/var/www/html"] = vim.fn.getcwd() } - end, - }, + { + type = "php", + request = "launch", + name = "Listen for Xdebug", + port = 9003, + pathMappings = function() + local sail = vim.call("composer#query", "require-dev.laravel/sail") + if sail == "" then + return { ["/app"] = vim.fn.getcwd() } + end + return { ["/var/www/html"] = vim.fn.getcwd() } + end, + }, } -- Events Listeners @@ -78,59 +78,59 @@ local hint = [[ ^^ _<Esc>_ ]] hydra({ - name = "dap", - hint = hint, - mode = "n", - config = { - color = "blue", - invoke_on_body = true, - hint = { - border = "rounded", - position = "bottom", - }, - }, - body = "<leader>d", - heads = { - { "d", dap.continue }, - { - "s", - function() - dap.continue() - dapui.open({}) - end, - }, - { "bp", dap.toggle_breakpoint }, - { "l", dap.step_into }, - { "j", dap.step_over }, - { "k", dap.step_out }, - { "h", dapui.eval }, - { "c", dap.run_to_cursor }, - { "tt", dap_go.debug_test }, - { - "bc", - function() - vim.ui.input({ prompt = "Condition: " }, function(condition) - dap.set_breakpoint(condition) - end) - end, - }, - { - "?", - function () - vim.ui.input({ prompt = "Log: " }, function(log) - dap.set_breakpoint(nil, nil, log) - end) - end - }, - { - "x", - function() - dap.terminate() - dapui.close({}) - dap.clear_breakpoints() - end, - }, + name = "dap", + hint = hint, + mode = "n", + config = { + color = "blue", + invoke_on_body = true, + hint = { + border = "rounded", + position = "bottom", + }, + }, + body = "<leader>d", + heads = { + { "d", dap.continue }, + { + "s", + function() + dap.continue() + dapui.open({}) + end, + }, + { "bp", dap.toggle_breakpoint }, + { "l", dap.step_into }, + { "j", dap.step_over }, + { "k", dap.step_out }, + { "h", dapui.eval }, + { "c", dap.run_to_cursor }, + { "tt", dap_go.debug_test }, + { + "bc", + function() + vim.ui.input({ prompt = "Condition: " }, function(condition) + dap.set_breakpoint(condition) + end) + end, + }, + { + "?", + function() + vim.ui.input({ prompt = "Log: " }, function(log) + dap.set_breakpoint(nil, nil, log) + end) + end, + }, + { + "x", + function() + dap.terminate() + dapui.close({}) + dap.clear_breakpoints() + end, + }, - { "<Esc>", nil, { exit = true } }, - }, + { "<Esc>", nil, { exit = true } }, + }, }) diff --git a/lua/alpha/plugins.lua b/lua/alpha/plugins.lua index a66cfeb..e5cc4e9 100644 --- a/lua/alpha/plugins.lua +++ b/lua/alpha/plugins.lua @@ -78,6 +78,7 @@ return require("packer").startup(function(use) "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-cmdline", "hrsh7th/cmp-git", + "rcarriga/cmp-dap", "saadparwaiz1/cmp_luasnip", "onsails/lspkind-nvim", "L3MON4D3/LuaSnip", diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua index bee9ad1..ee2ee51 100644 --- a/plugin/packer_compiled.lua +++ b/plugin/packer_compiled.lua @@ -89,6 +89,11 @@ _G.packer_plugins = { path = "/home/alpha/.local/share/nvim/site/pack/packer/start/cmp-cmdline", url = "https://github.com/hrsh7th/cmp-cmdline" }, + ["cmp-dap"] = { + loaded = true, + path = "/home/alpha/.local/share/nvim/site/pack/packer/start/cmp-dap", + url = "https://github.com/rcarriga/cmp-dap" + }, ["cmp-git"] = { loaded = true, path = "/home/alpha/.local/share/nvim/site/pack/packer/start/cmp-git", @@ -473,6 +478,10 @@ _G.packer_plugins = { } time([[Defining packer_plugins]], false) +-- Config for: nvim-projectconfig +time([[Config for nvim-projectconfig]], true) +try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\23nvim-projectconfig\frequire\0", "config", "nvim-projectconfig") +time([[Config for nvim-projectconfig]], false) -- Config for: git-worktree.nvim time([[Config for git-worktree.nvim]], true) try_loadstring("\27LJ\2\n>\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\17git-worktree\frequire\0", "config", "git-worktree.nvim") @@ -481,10 +490,6 @@ time([[Config for git-worktree.nvim]], false) time([[Config for nvim-colorizer.lua]], true) try_loadstring("\27LJ\2\n;\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\14colorizer\frequire\0", "config", "nvim-colorizer.lua") time([[Config for nvim-colorizer.lua]], false) --- Config for: nvim-projectconfig -time([[Config for nvim-projectconfig]], true) -try_loadstring("\27LJ\2\n@\0\0\3\0\3\0\0066\0\0\0'\2\1\0B\0\2\0029\0\2\0B\0\1\1K\0\1\0\nsetup\23nvim-projectconfig\frequire\0", "config", "nvim-projectconfig") -time([[Config for nvim-projectconfig]], false) -- Command lazy-loads time([[Defining lazy-load commands]], true) |