remove luarc.json

This commit is contained in:
Afonso Franco 2023-01-06 09:19:46 +00:00
commit 0fb6fa99f7
Signed by: afonso
GPG key ID: C459E0BB3DCEE899
2 changed files with 36 additions and 10 deletions

View file

@ -104,6 +104,8 @@ cmp.setup {
nvim_lsp = "(LSP)", nvim_lsp = "(LSP)",
luasnip = "(Snippet)", luasnip = "(Snippet)",
buffer = "(Text)", buffer = "(Text)",
nvim_lsp_signature_help = "(Signature)",
nvim_lua = "(Nvim LSP)",
path = "(Path)", path = "(Path)",
})[entry.source.name] })[entry.source.name]
return vim_item return vim_item
@ -118,8 +120,32 @@ cmp.setup {
}, },
sources = cmp.config.sources( sources = cmp.config.sources(
{ {
{ name = "nvim_lsp" }, { name = "nvim_lsp",
{ name = "luasnip" }, entry_filter = function(entry, context)
local kind = entry:get_kind()
local line = context.cursor_line
local col = context.cursor.col
local char_before_cursor = string.sub(line, col - 1, col)
if char_before_cursor == "." then
if kind == 2 or kind == 5 then
return true
else return false end
elseif string.match(line, "^%s*%w*$") then
if kind == 3 or kind == 6 then
return true
else
return false
end
end
return true
end
},
{ name = 'nvim_lua' },
{ name = 'luasnip'},
{ name = 'nvim_lsp_signature_help' },
{ name = "path" }, { name = "path" },
}, },
{ {

View file

@ -53,6 +53,8 @@ local plugins = packer.startup({ function(use)
use { "hrsh7th/nvim-cmp", use { "hrsh7th/nvim-cmp",
requires = { requires = {
"hrsh7th/cmp-nvim-lsp", -- lsp "hrsh7th/cmp-nvim-lsp", -- lsp
"hrsh7th/cmp-nvim-lua", -- Nvim API completions
"hrsh7th/cmp-nvim-lsp-signature-help", -- Show function signatures
"hrsh7th/cmp-buffer", --buffer completions "hrsh7th/cmp-buffer", --buffer completions
"hrsh7th/cmp-path", --path completions "hrsh7th/cmp-path", --path completions
"hrsh7th/cmp-cmdline" --cmdline completions "hrsh7th/cmp-cmdline" --cmdline completions
@ -61,6 +63,12 @@ local plugins = packer.startup({ function(use)
require "plugins.cmp" require "plugins.cmp"
end end
} }
use { "L3MON4D3/LuaSnip",
requires = {
"saadparwaiz1/cmp_luasnip"
},
}
-------------------------------------------------------LSP---------------------------------------------- -------------------------------------------------------LSP----------------------------------------------
use { "williamboman/mason.nvim", use { "williamboman/mason.nvim",
@ -71,8 +79,6 @@ local plugins = packer.startup({ function(use)
use { "williamboman/mason-lspconfig.nvim" } use { "williamboman/mason-lspconfig.nvim" }
use { "hrsh7th/cmp-nvim-lsp"}
use { "neovim/nvim-lspconfig", use { "neovim/nvim-lspconfig",
config = function() config = function()
require "plugins.lspconfig" require "plugins.lspconfig"
@ -85,12 +91,6 @@ local plugins = packer.startup({ function(use)
end end
} }
use { "L3MON4D3/LuaSnip",
requires = {
"rafamadriz/friendly-snippets",
"saadparwaiz1/cmp_luasnip"
},
}
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------