This commit is contained in:
Kulvir Singh
2024-09-03 22:47:32 +05:30
parent ee2602569f
commit 4b75896bde
9 changed files with 170 additions and 61 deletions

View File

@@ -20,10 +20,10 @@
"mason.nvim": { "branch": "main", "commit": "49ff59aded1047a773670651cfa40e76e63c6377" },
"mini.nvim": { "branch": "main", "commit": "eb2dd6d187e1ab5fefec66f0d37b1a3dc8633d17" },
"neodev.nvim": { "branch": "main", "commit": "ce9a2e8eaba5649b553529c5498acb43a6c317cd" },
"noice.nvim": { "branch": "main", "commit": "cade1f972ba226e7753a7a113f3f1a942908e73c" },
"nvim-cmp": { "branch": "main", "commit": "5260e5e8ecadaf13e6b82cf867a909f54e15fd07" },
"nvim-dap": { "branch": "master", "commit": "5a2f7121869394502521c52b2bc581ab22c69447" },
"nvim-dap-go": { "branch": "main", "commit": "5faf165f5062187320eaf9d177c3c1f647adc22e" },
"nvim-dap-python": { "branch": "master", "commit": "7c427e2bbc72d46ea3c9602bede6465ef61b8c19" },
"nvim-dap-ui": { "branch": "master", "commit": "71bfe9bd6b3465e169b53bea4f83775034d822dd" },
"nvim-dap-virtual-text": { "branch": "master", "commit": "3e8e207513e6ef520894950acd76b79902714103" },
"nvim-lint": { "branch": "master", "commit": "1f98d6c863f91706369d74aeb2eb3f02b2e96861" },

View File

@@ -1,5 +1,4 @@
-- debug.lua
--
-- Shows how to use the DAP plugin to debug your code.
--
-- Primarily focused on configuring the debugger for Go, but can
@@ -17,6 +16,7 @@ return {
-- GO DEBUG
"leoluz/nvim-dap-go",
"mfussenegger/nvim-dap-python",
},
config = function()
local dap = require "dap"
@@ -27,19 +27,21 @@ return {
require("nvim-dap-virtual-text").setup {
-- This just tries to mitigate the chance that I leak tokens here. Probably won't stop it from happening...
display_callback = function(variable)
local name = string.lower(variable.name)
local value = string.lower(variable.value)
if name:match "secret" or name:match "api" or value:match "secret" or value:match "api" then
return "*****"
end
if #variable.value > 15 then
return " " .. string.sub(variable.value, 1, 15) .. "... "
end
return " " .. variable.value
end,
-- But I am not a streamer, so I may not want this, or prolly change it in future, but rn its commented
--
-- display_callback = function(variable)
-- local name = string.lower(variable.name)
-- local value = string.lower(variable.value)
-- if name:match "secret" or name:match "api" or value:match "secret" or value:match "api" then
-- return "*****"
-- end
--
-- if #variable.value > 15 then
-- return " " .. string.sub(variable.value, 1, 15) .. "... "
-- end
--
-- return " " .. variable.value
-- end,
}
require("mason-nvim-dap").setup {
@@ -49,18 +51,25 @@ return {
handlers = {},
ensure_installed = {
"debugpy",
"delve",
},
}
-- Basic debugging keymaps, feel free to change to your liking!
vim.keymap.set("n", "<leader>dc", dap.continue, { desc = "Debug: Start/Continue" })
vim.keymap.set("n", "<F8>", dap.step_into, { desc = "Debug: Step Into" })
vim.keymap.set("n", "<F9>", dap.step_over, { desc = "Debug: Step Over" })
vim.keymap.set("n", "<F10>", dap.step_out, { desc = "Debug: Step Out" })
vim.keymap.set("n", "<leader>dt", dap.toggle_breakpoint, { desc = "Debug: Toggle Breakpoint" })
vim.keymap.set("n", "<Space>?", function()
require("dapui").eval(nil, { enter = true })
end)
-- Basic debugging keymaps, feel free to change to your liking!
vim.keymap.set("n", "<F5>", dap.continue, { desc = "Start/Continue" })
vim.keymap.set("n", "<F4>", dap.step_into, { desc = "Step Into" })
vim.keymap.set("n", "<F3>", dap.step_over, { desc = "Step Over" })
vim.keymap.set("n", "<F2>", dap.step_out, { desc = "Step Out" })
vim.keymap.set("n", "<F1>", dap.step_back, { desc = "Step Back" })
vim.keymap.set("n", "<F10>", dap.restart, { desc = "Restart" })
dap.listeners.before.attach.dapui_config = function()
ui.open()
end
@@ -75,5 +84,6 @@ return {
end
require("dap-go").setup()
require("dap-python").setup "~/.local/share/nvim/mason/packages/debugpy/venv/bin/python"
end,
}

View File

@@ -7,6 +7,10 @@ return {
lint.linters_by_ft = {
python = { "ruff", "mypy" },
dockerfile = { "hadolint" },
json = { "jsonlint" },
markdown = { "vale" },
text = { "vale" },
}
-- To allow other plugins to add linters to require('lint').linters_by_ft,

View File

@@ -28,14 +28,14 @@ return {
html = {
filetypes = { "html", "tmpl" },
},
-- jsonls = {
-- settings = {
-- json = {
-- schemas = require("schemastore").json.schemas(),
-- validate = { enable = true },
-- },
-- },
-- },
jsonls = {
settings = {
json = {
schemas = require("schemastore").json.schemas(),
validate = { enable = true },
},
},
},
lua_ls = {
-- cmd = {...},
-- filetypes = { ...},
@@ -50,7 +50,7 @@ return {
},
},
},
-- pyright = {},
pyright = {},
tsserver = {},
tailwindcss = {
filetypes = { "html", "css", "typescript", "typescriptreact" },
@@ -64,10 +64,13 @@ return {
"clang-format",
"gofumpt",
"goimports-reviser",
-- "mypy",
"hadolint",
"jsonlint",
"mypy",
"prettier",
-- "ruff",
"ruff",
"stylua",
"vale",
})
require("mason-tool-installer").setup { ensure_installed = ensure_installed }

View File

@@ -1,7 +0,0 @@
return {
-- "folke/noice.nvim",
-- event = "VeryLazy",
-- dependencies = {
-- "MunifTanjim/nui.nvim",
-- },
}