Skip to content

Commit

Permalink
Update plugins. reenable copliot
Browse files Browse the repository at this point in the history
  • Loading branch information
wiccy46 committed Nov 6, 2024
1 parent 33362e6 commit 1e6c23d
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 17 deletions.
4 changes: 4 additions & 0 deletions lazy-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"noice.nvim": { "branch": "main", "commit": "df448c649ef6bc5a6a633a44f2ad0ed8d4442499" },
"nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" },
"nvim-cmp": { "branch": "main", "commit": "2c93d5e7e2eb20c4faf88ddf3d421684e8549b35" },
"nvim-dap": { "branch": "master", "commit": "7ff6936010b7222fea2caea0f67ed77f1b7c60dd" },
"nvim-dap-python": { "branch": "master", "commit": "3e3dd98d4d83715c9e0e429b4a5da7bd706e6ceb" },
"nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "52638640ae309cacdaff785fdbb854437bd1ee5c" },
"nvim-lint": { "branch": "master", "commit": "16b21a7d04d06661f92f273a0744fd81fb19e09e" },
"nvim-lspconfig": { "branch": "master", "commit": "84f867753f659bfd9319f75bd5eb273a315f2da5" },
"nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" },
Expand Down
34 changes: 17 additions & 17 deletions lua/plugins/copilot.lua
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
return {
{
"nvim-cmp",
opts = function(_, opts)
-- local cmp = require("cmp")
opts.sources = vim.tbl_filter(function(v)
return not vim.tbl_contains({ "copilot" }, v.name)
end, opts.sources)
end,
},
{
"zbirenbaum/copilot.lua",
opts = {
suggestion = { enabled = true },
},
}
}
-- return {
-- {
-- "nvim-cmp",
-- opts = function(_, opts)
-- -- local cmp = require("cmp")
-- opts.sources = vim.tbl_filter(function(v)
-- return not vim.tbl_contains({ "copilot" }, v.name)
-- end, opts.sources)
-- end,
-- },
-- {
-- "zbirenbaum/copilot.lua",
-- opts = {
-- suggestion = { enabled = true },
-- },
-- }
-- }
92 changes: 92 additions & 0 deletions lua/plugins/example.lua
Original file line number Diff line number Diff line change
Expand Up @@ -248,5 +248,97 @@ return {
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
{ "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
},
},
{
"mfussenegger/nvim-dap",
recommended = true,
desc = "Debugging support. Requires language specific adapters to be configured. (see lang extras)",

dependencies = {
"rcarriga/nvim-dap-ui",
-- virtual text for the debugger
{
"theHamsta/nvim-dap-virtual-text",
opts = {},
},
{
"mfussenegger/nvim-dap-python",
},
},

-- stylua: ignore
keys = {
{ "<leader>d", "", desc = "+debug", mode = {"n", "v"} },
{ "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end, desc = "Breakpoint Condition" },
{ "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle Breakpoint" },
{ "<leader>dc", function() require("dap").continue() end, desc = "Continue" },
{ "<leader>da", function() require("dap").continue({ before = get_args }) end, desc = "Run with Args" },
{ "<leader>di", function() require("dap").step_into() end, desc = "Step Into" },
{ "<leader>dj", function() require("dap").down() end, desc = "Down" },
{ "<leader>dk", function() require("dap").up() end, desc = "Up" },
{ "<leader>do", function() require("dap").step_out() end, desc = "Step Out" },
{ "<leader>dO", function() require("dap").step_over() end, desc = "Step Over" },
{ "<leader>dp", function() require("dap").pause() end, desc = "Pause" },
{ "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" },
{ "<leader>ds", function() require("dap").session() end, desc = "Session" },
-- { "<leader>dt", function() require("dap").terminate() end, desc = "Terminate" },
{ "<leader>dt", function() require("dap-python").test_method() end, desc = "Test Method" },
{ "<leader>dw", function() require("dap.ui.widgets").hover() end, desc = "Widgets" },
},

config = function()
-- load mason-nvim-dap here, after all adapters have been setup
if LazyVim.has("mason-nvim-dap.nvim") then
require("mason-nvim-dap").setup(LazyVim.opts("mason-nvim-dap.nvim"))
end

vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" })

for name, sign in pairs(LazyVim.config.icons.dap) do
sign = type(sign) == "table" and sign or { sign }
vim.fn.sign_define(
"Dap" .. name,
{ text = sign[1], texthl = sign[2] or "DiagnosticInfo", linehl = sign[3], numhl = sign[3] }
)
end

-- Configure DAP for Python
local dap = require("dap")
dap.adapters.python = {
type = "executable",
command = "python",
args = { "-m", "debugpy.adapter" },
}
dap.configurations.python = {
{
type = "python",
request = "launch",
name = "Launch file",
program = "${file}",
console = "integratedTerminal",
},
{
type = "python",
request = "launch",
name = "Run pytest",
program = "${workspaceFolder}",
args = { "-m", "pytest", "${file}" },
console = "integratedTerminal",
},
}

-- setup dap-python for easier pytest integration
-- require("dap-python").setup("python")
require("dap-python").setup("python", { test_runner = "pytest" })

-- setup dap config by VsCode launch.json file
local vscode = require("dap.ext.vscode")
local json = require("plenary.json")
vscode.json_decode = function(str)
return vim.json.decode(json.json_strip_comments(str))
end


end,
}
}

0 comments on commit 1e6c23d

Please sign in to comment.