Compare commits

...

3 Commits

3 changed files with 35 additions and 39 deletions

View File

@ -2,5 +2,16 @@
{
home.packages = with pkgs; [
uv
(python3.withPackages (ps: with ps; [
python-lsp-server
python-lsp-jsonrpc
python-lsp-black
python-lsp-ruff
pyls-isort
pyls-flake8
flake8
isort
black
]))
];
}

View File

@ -36,51 +36,37 @@ vim.keymap.set('n', '<leader>fb', tbuiltin.buffers, {})
vim.keymap.set('n', '<leader>fh', tbuiltin.help_tags, {})
vim.keymap.set('n', '<leader>fs', tbuiltin.spell_suggest, {})
-- Mason (tool manager) setup
-- we want rust-analyzer and codelldb
require("mason").setup({
ui = {
icons = {
package_installed = "✔️",
package_pending = "🔄",
package_uninstalled = "🌐"
}
}
})
require("mason-lspconfig").setup()
-- General LSP settings
-- from https://rsdlt.github.io/posts/rust-nvim-ide-guide-walkthrough-development-debug/
local sign = function(opts)
vim.fn.sign_define(opts.name, {
texthl = opts.name,
text = opts.text,
numhl = ''
})
end
sign({name = 'DiagnosticSignError', text = '🛑'})
sign({name = 'DiagnosticSignWarn', text = '⚠️'})
sign({name = 'DiagnosticSignHint', text = '💭'})
sign({name = 'DiagnosticSignInfo', text = '🗒️'})
vim.lsp.enable('pylsp')
-- LSP diagnostic signs
vim.diagnostic.config({
virtual_text = false,
virtual_text = true,
signs = true,
update_in_insert = true,
underline = true,
severity_sort = false,
float = {
border = 'rounded',
source = 'always',
header = '',
prefix = '',
severity_sort = true,
signs = {
text = {
[vim.diagnostic.severity.ERROR] = "E",
[vim.diagnostic.severity.WARN] = "W",
[vim.diagnostic.severity.INFO] = "I",
[vim.diagnostic.severity.HINT] = "?"
},
numhl = {
[vim.diagnostic.severity.ERROR] = "ErrorMsg",
[vim.diagnostic.severity.WARN] = "WarningMsg",
[vim.diagnostic.severity.INFO] = "DiagnosticInfo",
[vim.diagnostic.severity.HINT] = "DiagnosticHint"
}
}
})
vim.keymap.set('n', '<leader><leader>d', '<cmd>lua vim.diagnostic.open_float()<CR>', { noremap = true, silent = true })
vim.cmd([[
set signcolumn=yes
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
set signcolumn=yes
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
]])
-- Rust tools for Rust-specific LSP

View File

@ -17,9 +17,8 @@
nvim-treesitter-parsers.toml
nvim-treesitter-parsers.python
jedi-vim
mason-nvim
mason-tool-installer-nvim
mason-lspconfig-nvim
nvim-lspconfig
nvim-lsputils
fzf-vim
sleuth
whitespace-nvim # ,t to trim whitespace