From 011a40ce7c226ea56543988ae252d78c2b9bdd93 Mon Sep 17 00:00:00 2001 From: mateen bagheri Date: Sat, 21 Feb 2026 12:47:08 +0330 Subject: [PATCH] feat: add python formatter and debugger to config --- init.lua | 13 ++++++++++--- lua/kickstart/plugins/debug.lua | 21 +++++++++++---------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/init.lua b/init.lua index c38f2fb2..c7baee60 100644 --- a/init.lua +++ b/init.lua @@ -531,7 +531,7 @@ require('lazy').setup({ local servers = { -- clangd = {}, gopls = {}, - -- pyright = {}, + pyright = {}, -- rust_analyzer = {}, -- -- Some languages (like typescript) have entire language plugins that can be useful: @@ -560,6 +560,12 @@ require('lazy').setup({ 'golines', 'gomodifytags', 'gotests', + 'delve', + 'debugpy', + 'python', + 'pyright', + 'isort', + 'black', -- You can add other tools here that you want Mason to install }) @@ -632,7 +638,7 @@ require('lazy').setup({ return nil else return { - timeout_ms = 500, + timeout_ms = 2500, lsp_format = 'fallback', } end @@ -640,8 +646,9 @@ require('lazy').setup({ formatters_by_ft = { lua = { 'stylua' }, -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, + python = { 'isort', 'black' }, -- + go = { 'gofumpt' }, -- You can use 'stop_after_first' to run the first available formatter from the list -- javascript = { "prettierd", "prettier", stop_after_first = true }, }, diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index 1e3570f9..90ba3b5a 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -23,6 +23,7 @@ return { -- Add your own debuggers here 'leoluz/nvim-dap-go', + 'mfussenegger/nvim-dap-python', }, keys = { -- Basic debugging keymaps, feel free to change to your liking! @@ -107,16 +108,16 @@ return { } -- Change breakpoint icons - -- vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' }) - -- vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' }) - -- local breakpoint_icons = vim.g.have_nerd_font - -- and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' } - -- or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' } - -- for type, icon in pairs(breakpoint_icons) do - -- local tp = 'Dap' .. type - -- local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak' - -- vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl }) - -- end + vim.api.nvim_set_hl(0, 'DapBreak', { fg = '#e51400' }) + vim.api.nvim_set_hl(0, 'DapStop', { fg = '#ffcc00' }) + local breakpoint_icons = vim.g.have_nerd_font + and { Breakpoint = '', BreakpointCondition = '', BreakpointRejected = '', LogPoint = '', Stopped = '' } + or { Breakpoint = '●', BreakpointCondition = '⊜', BreakpointRejected = '⊘', LogPoint = '◆', Stopped = '⭔' } + for type, icon in pairs(breakpoint_icons) do + local tp = 'Dap' .. type + local hl = (type == 'Stopped') and 'DapStop' or 'DapBreak' + vim.fn.sign_define(tp, { text = icon, texthl = hl, numhl = hl }) + end dap.listeners.after.event_initialized['dapui_config'] = dapui.open dap.listeners.before.event_terminated['dapui_config'] = dapui.close