mirror of
https://github.com/mqttr/dotfiles.git
synced 2025-12-16 12:45:52 -06:00
Recreate neovim configuration
This commit is contained in:
@@ -1,108 +1,90 @@
|
||||
local servers = {
|
||||
"rust_analyzer",
|
||||
"clangd",
|
||||
"basedpyright",
|
||||
"lua_ls",
|
||||
'bashls',
|
||||
'yamlls',
|
||||
'gopls',
|
||||
'html',
|
||||
'cssls',
|
||||
}
|
||||
|
||||
return {
|
||||
"b0o/schemastore.nvim",
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
ensure_installed = servers
|
||||
},
|
||||
-- {
|
||||
-- "williamboman/mason-lspconfig.nvim",
|
||||
-- config = function ()
|
||||
-- require('mason-lspconfig').setup({
|
||||
-- ensure_installed = servers
|
||||
-- })
|
||||
--
|
||||
-- for _, lsp in pairs(servers) do
|
||||
-- require('lspconfig')[lsp].setup {
|
||||
-- on_attach = on_attach,
|
||||
-- capabilities = capabilities
|
||||
-- }
|
||||
-- end
|
||||
-- end,
|
||||
--
|
||||
-- automatic_installation = true,
|
||||
-- },
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
{ 'williamboman/mason.nvim', config = true },
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'saghen/blink.cmp',
|
||||
{
|
||||
'saghen/blink.cmp',
|
||||
-- optional: provides snippets for the snippet source
|
||||
dependencies = { 'rafamadriz/friendly-snippets' },
|
||||
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = '1.*',
|
||||
-- build = 'cargo build --release',
|
||||
-- If you use nix, you can build from source using latest nightly rust with:
|
||||
-- build = 'nix run .#build-plugin',
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
-- All presets have the following mappings:
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = 'super-tab' },
|
||||
|
||||
appearance = {
|
||||
nerd_font_variant = 'mono'
|
||||
},
|
||||
|
||||
completion = {
|
||||
menu = {
|
||||
-- min_width = 30,
|
||||
-- max_width = 50,
|
||||
-- max_height = 20,
|
||||
border = 'rounded', -- Rounded corners for a fancy look
|
||||
winblend = 10, -- Slight transparency for a modern look
|
||||
winhighlight = 'Normal:BlinkCmpMenu,FloatBorder:BlinkCmpMenuBorder,CursorLine:BlinkCmpMenuSelection,Search:None',
|
||||
scrolloff = 2,
|
||||
},
|
||||
opts = {
|
||||
servers = {
|
||||
rust_analyzer = {},
|
||||
clangd = {},
|
||||
basedpyright = {},
|
||||
lua_ls = {},
|
||||
bashls = {},
|
||||
yamlls = {},
|
||||
gopls = {
|
||||
cmd = {"gopls"},
|
||||
filetypes = {"go", "gomod", "gowork", "gotmpl"},
|
||||
},
|
||||
html = {},
|
||||
cssls = {},
|
||||
},
|
||||
|
||||
documentation = {
|
||||
auto_show = true,
|
||||
window = {
|
||||
border = 'rounded',
|
||||
winblend = 10,
|
||||
winhighlight = 'Normal:BlinkCmpDoc,FloatBorder:BlinkCmpDocBorder,CursorLine:BlinkCmpDocCursorLine,Search:None',
|
||||
},
|
||||
},
|
||||
config = function (_, opts)
|
||||
local lspconfig = require('lspconfig')
|
||||
for server, config in pairs(opts.servers) do
|
||||
-- passing config.capabilities to blink.cmp merges with the capabilities in your
|
||||
-- `opts[server].capabilities, if you've defined it
|
||||
config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
|
||||
lspconfig[server].setup(config)
|
||||
end
|
||||
end,
|
||||
ghost_text = { enabled = true },
|
||||
accept = { auto_brackets = { enabled = true } },
|
||||
-- signature = {
|
||||
-- enabled = true,
|
||||
-- }
|
||||
},
|
||||
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
},
|
||||
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" }
|
||||
},
|
||||
{
|
||||
'nvimdev/lspsaga.nvim',
|
||||
config = function()
|
||||
require('lspsaga').setup({
|
||||
diagnostic = {
|
||||
keys = {
|
||||
quit = { 'q', '<ESC>' }
|
||||
}
|
||||
},
|
||||
rename = {
|
||||
keys = {
|
||||
quit = {'<ESC>'}
|
||||
}
|
||||
},
|
||||
finder = {
|
||||
keys = {
|
||||
quit = '<ESC>',
|
||||
close = '<ESC>',
|
||||
toggle_or_open = '<CR>'
|
||||
}
|
||||
},
|
||||
outline = {
|
||||
close_after_jump = true,
|
||||
keys = {
|
||||
quit = { 'q', '<ESC>' },
|
||||
jump = { 'e', '<CR>' },
|
||||
toggle_or_jump = { 'o', '<TAB>' }
|
||||
}
|
||||
},
|
||||
lightbulb = {
|
||||
enable = false
|
||||
}
|
||||
})
|
||||
end,
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter', -- optional
|
||||
'nvim-tree/nvim-web-devicons', -- optional
|
||||
}
|
||||
}
|
||||
opts_extend = { "sources.default" }
|
||||
},
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
{ 'williamboman/mason.nvim', config = true },
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
},
|
||||
|
||||
opts = {
|
||||
servers = {
|
||||
lua_ls = {},
|
||||
clangd = {},
|
||||
rust_analyzer = {},
|
||||
yamlls = {},
|
||||
gopls = {},
|
||||
html = {}
|
||||
}
|
||||
},
|
||||
config = function(_, opts)
|
||||
local lspconfig = require('lspconfig')
|
||||
for server, config in pairs(opts.servers) do
|
||||
-- passing config.capabilities to blink.cmp merges with the capabilities in your
|
||||
-- `opts[server].capabilities, if you've defined it
|
||||
config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
|
||||
lspconfig[server].setup(config)
|
||||
end
|
||||
end
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user