feat: add python formatter and debugger to config
This commit is contained in:
parent
d82d645757
commit
011a40ce7c
13
init.lua
13
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 },
|
||||
},
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue