feat(nvim): plugins, cleanup, ign lazy-lock.json

This commit is contained in:
2024-09-22 04:26:02 +03:00
parent 6f1e1a0416
commit 9b6e39b4af
7 changed files with 54 additions and 98 deletions

View File

@@ -8,13 +8,37 @@ return {
'hrsh7th/cmp-nvim-lsp',
'L3MON4D3/LuaSnip',
'saadparwaiz1/cmp_luasnip',
-- Adds other completion capabilities.
-- nvim-cmp does not ship with all sources by default. They are split
-- into multiple repos for maintenance purposes.
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-path',
'onsails/lspkind.nvim',
{
'zbirenbaum/copilot-cmp',
dependencies = {
'zbirenbaum/copilot.lua',
},
config = function()
require('copilot_cmp').setup()
end,
},
},
config = function()
-- nvim-cmp setup
local cmp = require 'cmp'
local luasnip = require 'luasnip'
local lspkind = require 'lspkind'
luasnip.config.setup {}
cmp.setup {
formatting = {
format = lspkind.cmp_format {
mode = 'symbol',
max_width = 50,
symbol_map = { Copilot = '' },
},
},
view = {
entries = 'native',
},
@@ -26,6 +50,9 @@ return {
mapping = cmp.mapping.preset.insert {
['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- Manually trigger a completion from nvim-cmp.
-- Generally you don't need this, because nvim-cmp will display
-- completions whenever it has completion options available.
['<C-Space>'] = cmp.mapping.complete(),
['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
@@ -51,8 +78,12 @@ return {
end, { 'i', 's' }),
},
sources = {
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
-- Copilot Source
{ name = 'copilot', group_index = 2 },
-- Other Sources
{ name = 'nvim_lsp', group_index = 2 },
{ name = 'path', group_index = 2 },
{ name = 'luasnip', group_index = 2 },
},
}
end,

View File

@@ -4,7 +4,8 @@ return {
'zbirenbaum/copilot.lua',
cmd = 'Copilot',
build = ':Copilot setup',
event = 'InsertEnter',
event = { 'InsertEnter', 'LspAttach' },
fix_pairs = true,
opts = {
suggestion = { enabled = false },
panel = { enabled = false },

View File

@@ -26,19 +26,6 @@ return {
},
-- LSP Configuration & Plugins
{
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
'folke/lazydev.nvim',
ft = 'lua',
opts = {
library = {
-- Load luvit types when the `vim.uv` word is found
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
},
},
},
-- Meta type definitions for the Lua platform Luvit.
-- https://github.com/Bilal2453/luvit-meta
{ 'Bilal2453/luvit-meta', lazy = true },

View File

@@ -20,6 +20,18 @@ return {
},
},
'b0o/schemastore.nvim',
{
-- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
'folke/lazydev.nvim',
ft = 'lua',
opts = {
library = {
-- Load luvit types when the `vim.uv` word is found
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
},
},
},
},
config = function()
-- Diagnostic keymaps
@@ -151,8 +163,6 @@ return {
'ansible-lint',
'bash-language-server',
'blade-formatter',
'cfn-lint',
'codeql',
'codespell',
'commitlint',
'diagnostic-languageserver',
@@ -165,7 +175,6 @@ return {
'jq',
'jsonlint',
'luacheck',
'nginx-language-server',
'php-cs-fixer',
'phpcs',
'phpmd',