From b3b19c488dfd8688fb3813f553b509cd87ad8462 Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Wed, 18 Jan 2023 12:09:21 +0100 Subject: feat: improve lazy configuration on how loading plugins --- lua/alpha/plugins/dap.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lua/alpha/plugins/dap.lua') diff --git a/lua/alpha/plugins/dap.lua b/lua/alpha/plugins/dap.lua index 6f33484..f8a7b17 100644 --- a/lua/alpha/plugins/dap.lua +++ b/lua/alpha/plugins/dap.lua @@ -6,9 +6,26 @@ return { "leoluz/nvim-dap-go", "mxsdev/nvim-dap-vscode-js", "anuvyklack/hydra.nvim", + "nvim-telescope/telescope-dap.nvim", + "rcarriga/cmp-dap", }, keys = { { "d" } }, config = function() require("alpha.dap") + local ok_telescope, telescope = pcall(require, "telescope") + if ok_telescope then + telescope.load_extension("dap") + end + + local ok_cmp, cmp = pcall(require, "cmp") + if ok_cmp then + cmp.setup.filetype({ "dap-repl", "dapui_watches" }, { + sources = cmp.config.sources({ + { name = "dap" }, + }, { + { name = "buffer" }, + }), + }) + end end } -- cgit v1.2.3