Skip to content

Commit 5bdc37d

Browse files
committed
add python lsp, linters and formatters
1 parent f23b3db commit 5bdc37d

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

lua/kickstart/plugins/conform.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ return {
3232
formatters_by_ft = {
3333
lua = { 'stylua' },
3434
-- Conform can also run multiple formatters sequentially
35-
-- python = { "isort", "black" },
35+
python = { 'isort', 'black' },
3636
--
3737
-- You can use 'stop_after_first' to run the first available formatter from the list
3838
-- javascript = { "prettierd", "prettier", stop_after_first = true },

lua/kickstart/plugins/lint.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ return {
77
local lint = require 'lint'
88
lint.linters_by_ft = lint.linters_by_ft or {}
99
lint.linters_by_ft['clojure'] = { 'clj-kondo' }
10+
lint.linters_by_ft['python'] = { 'mypy', 'pylint' }
1011
lint.linters_by_ft['markdown'] = nil
1112

1213
-- To allow other plugins to add linters to require('lint').linters_by_ft,

lua/kickstart/plugins/lspconfig.lua

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,35 @@ return {
235235
},
236236
},
237237
},
238+
239+
pylsp = {
240+
settings = {
241+
pylsp = {
242+
plugins = {
243+
-- Disable built-in formatters and linters (handled by conform/nvim-lint)
244+
black = { enabled = false },
245+
autopep8 = { enabled = false },
246+
yapf = { enabled = false },
247+
flake8 = { enabled = false },
248+
pylint = { enabled = false },
249+
pycodestyle = { enabled = false },
250+
pydocstyle = { enabled = false },
251+
mccabe = { enabled = false },
252+
253+
-- Keep LSP features
254+
jedi_completion = { enabled = true },
255+
jedi_hover = { enabled = true },
256+
jedi_references = { enabled = true },
257+
jedi_signature_help = { enabled = true },
258+
jedi_symbols = { enabled = true },
259+
rope_autoimport = { enabled = true },
260+
},
261+
},
262+
},
263+
flags = {
264+
debounce_text_changes = 200,
265+
},
266+
},
238267
}
239268

240269
-- Ensure the servers and tools above are installed

lua/kickstart/plugins/treesitter.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ return {
55
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
66
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
77
opts = {
8-
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
8+
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'python', 'query', 'vim', 'vimdoc' },
99
-- Autoinstall languages that are not installed
1010
auto_install = true,
1111
highlight = {

0 commit comments

Comments
 (0)