Improved Python handling

This commit is contained in:
Leonora Tindall 2025-11-25 15:46:50 -06:00
parent c3f4bc16de
commit b7f8f3c424
3 changed files with 10 additions and 9 deletions

View File

@ -5,13 +5,9 @@
(python3.withPackages (ps: with ps; [ (python3.withPackages (ps: with ps; [
python-lsp-server python-lsp-server
python-lsp-jsonrpc python-lsp-jsonrpc
python-lsp-black
python-lsp-ruff python-lsp-ruff
pyls-isort jedi-language-server
pyls-flake8 ruff
flake8
isort
black
])) ]))
]; ];
} }

View File

@ -37,7 +37,6 @@ vim.keymap.set('n', '<leader>fh', tbuiltin.help_tags, {})
vim.keymap.set('n', '<leader>fs', tbuiltin.spell_suggest, {}) vim.keymap.set('n', '<leader>fs', tbuiltin.spell_suggest, {})
-- General LSP settings -- General LSP settings
vim.lsp.enable('pylsp')
-- LSP diagnostic signs -- LSP diagnostic signs
vim.diagnostic.config({ vim.diagnostic.config({
@ -62,13 +61,20 @@ vim.diagnostic.config({
} }
}) })
vim.keymap.set('n', '<leader><leader>d', '<cmd>lua vim.diagnostic.open_float()<CR>', { noremap = true, silent = true }) vim.keymap.set('n', '<leader><leader>d', '<cmd>lua vim.diagnostic.open_float()<CR>',
{ noremap = true, silent = true })
vim.keymap.set('n', '<leader><leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>',
{ noremap = true, silent = true })
vim.cmd([[ vim.cmd([[
set signcolumn=yes set signcolumn=yes
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false }) autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
]]) ]])
-- Python-specific lspconfig
vim.lsp.enable('pylsp')
vim.lsp.enable('jedi_language_server')
-- Rust tools for Rust-specific LSP -- Rust tools for Rust-specific LSP
local rt = require("rust-tools") local rt = require("rust-tools")
rt.setup({ rt.setup({

View File

@ -16,7 +16,6 @@
nvim-treesitter-parsers.lua nvim-treesitter-parsers.lua
nvim-treesitter-parsers.toml nvim-treesitter-parsers.toml
nvim-treesitter-parsers.python nvim-treesitter-parsers.python
jedi-vim
nvim-lspconfig nvim-lspconfig
nvim-lsputils nvim-lsputils
fzf-vim fzf-vim