chore(nvim): plugin tweaks, config tweaks

This commit is contained in:
2025-01-22 19:47:54 +02:00
parent b6d933d018
commit 56ccb7c136
4 changed files with 83 additions and 100 deletions

View File

@@ -93,11 +93,12 @@ autocmd({ 'FileType' }, {
-- Set filetype for SSH config directory
-- Pattern handles directories with files like:
-- .dotfiles/ssh/config.d/*, .ssh/config.local, .ssh/config.work
-- .dotfiles/ssh/config.d/*, .ssh/config.local, .ssh/config.work,
-- .ssh/shared.d/*, .ssh/local.d/*
autocmd({ 'BufRead', 'BufNewFile' }, {
desc = 'Set filetype for SSH config directory',
pattern = {
'*/?.ssh/{config|shared}.d/*',
'*/?.ssh/{config|shared|local}.d/*',
'*/?.ssh/config.local',
'*/?.ssh/config.work',
},

View File

@@ -18,11 +18,14 @@ return {
},
},
{ 'L3MON4D3/LuaSnip', version = 'v2.*' },
{ 'L3MON4D3/LuaSnip', version = 'v2.*', build = 'make install_jsregexp' },
-- Set of preconfigured snippets for different languages.
-- https://github.com/rafamadriz/friendly-snippets
{ 'rafamadriz/friendly-snippets' },
{
'rafamadriz/friendly-snippets',
config = function() require('luasnip.loaders.from_vscode').lazy_load() end,
},
-- Lua plugin to turn github copilot into a cmp source
-- https://github.com/giuxtaposition/blink-cmp-copilot

View File

@@ -148,70 +148,61 @@ return {
-- https://github.com/Bilal2453/luvit-meta
{ 'Bilal2453/luvit-meta', lazy = true },
-- Quickstart configs for Nvim LSP
-- https://github.com/neovim/nvim-lspconfig
{ 'neovim/nvim-lspconfig' },
-- Portable package manager for Neovim that runs everywhere Neovim runs.
-- Easily install and manage LSP servers, DAP servers, linters, and formatters.
-- https://github.com/williamboman/mason.nvim
{
'williamboman/mason.nvim',
version = '*',
cmd = 'Mason',
run = ':MasonUpdate',
opts = {},
},
-- Extensible UI for Neovim notifications and LSP progress messages.
-- https://github.com/j-hui/fidget.nvim
{
'j-hui/fidget.nvim',
version = '*',
opts = {},
},
-- Extension to mason.nvim that makes it easier to use lspconfig with mason.nvim.
-- https://github.com/williamboman/mason-lspconfig.nvim
{ 'williamboman/mason-lspconfig.nvim' },
-- Install and upgrade third party tools automatically
-- https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim
{
'WhoIsSethDaniel/mason-tool-installer.nvim',
version = '*',
opts = {
auto_install = true,
auto_update = true,
ensure_installed = mason_tools,
},
},
-- JSON schemas for Neovim
-- https://github.com/b0o/SchemaStore.nvim
{ 'b0o/schemastore.nvim' },
-- Performant, batteries-included completion plugin for Neovim
-- https://github.com/saghen/blink.cmp
-- See lua/plugins/blink.lua for configs
{ 'saghen/blink.cmp' },
-- A simple wrapper for nvim-lspconfig and mason-lspconfig
-- to easily setup LSP servers.
-- https://github.com/junnplus/lsp-setup.nvim
{
'junnplus/lsp-setup.nvim',
dependencies = {
-- Quickstart configs for Nvim LSP
-- https://github.com/neovim/nvim-lspconfig
{ 'neovim/nvim-lspconfig' },
-- Portable package manager for Neovim that runs everywhere Neovim runs.
-- Easily install and manage LSP servers, DAP servers, linters, and formatters.
-- https://github.com/williamboman/mason.nvim
{
'williamboman/mason.nvim',
version = '*',
cmd = 'Mason',
run = ':MasonUpdate',
opts = {},
},
-- Extensible UI for Neovim notifications and LSP progress messages.
-- https://github.com/j-hui/fidget.nvim
{
'j-hui/fidget.nvim',
version = '*',
opts = {},
},
-- Extension to mason.nvim that makes it easier to use lspconfig with mason.nvim.
-- https://github.com/williamboman/mason-lspconfig.nvim
{ 'williamboman/mason-lspconfig.nvim' },
-- Install and upgrade third party tools automatically
-- https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim
{
'WhoIsSethDaniel/mason-tool-installer.nvim',
version = '*',
opts = {
auto_install = true,
auto_update = true,
ensure_installed = mason_tools,
},
},
-- JSON schemas for Neovim
-- https://github.com/b0o/SchemaStore.nvim
{ 'b0o/schemastore.nvim' },
-- Performant, batteries-included completion plugin for Neovim
-- https://github.com/saghen/blink.cmp
-- See lua/plugins/blink.lua for configs
{ 'saghen/blink.cmp' },
},
opts = {
default_mappings = false,
mappings = {
gd = 'lua require"telescope.builtin".lsp_definitions()',
gi = 'lua require"telescope.builtin".lsp_implementations()',
gr = 'lua require"telescope.builtin".lsp_references()',
},
inlay_hints = {
enabled = true,
},
servers = lsp_servers,
},
config = function(_, opts)
@@ -315,16 +306,6 @@ return {
'stevearc/conform.nvim',
event = { 'BufWritePre' },
cmd = { 'ConformInfo' },
keys = {
{
'<leader>cf',
function()
require('conform').format { async = true, lsp_format = 'fallback' }
end,
mode = '',
desc = 'Format buffer',
},
},
opts = {
notify_on_error = false,
---@type nil|conform.FormatOpts|fun(bufnr: integer): nil|conform.FormatOpts
@@ -340,9 +321,9 @@ return {
lsp_format_opt = 'fallback'
end
-- Disable autoformat for files in a certain path
-- Disable autoformat for files in a certain paths
local bufname = vim.api.nvim_buf_get_name(bufnr)
if bufname:match '/node_modules/' then return end
if bufname:match '/node_modules|vendor/' then return end
return {
timeout_ms = 500,