Initial Nvim Config Commit
This commit is contained in:
91
lua/plugins/cmp.lua
Normal file
91
lua/plugins/cmp.lua
Normal file
@@ -0,0 +1,91 @@
|
||||
-- print('test')
|
||||
|
||||
local enabled_lsps = {
|
||||
"pyright",
|
||||
"tsserver",
|
||||
"clangd",
|
||||
"gopls",
|
||||
"rust_analyzer",
|
||||
"taplo",
|
||||
"graphql"
|
||||
}
|
||||
|
||||
return {
|
||||
-- "L3MON4D3/LuaSnip",
|
||||
-- {
|
||||
"hrsh7th/nvim-cmp",
|
||||
|
||||
event = 'InsertEnter',
|
||||
|
||||
dependencies = {
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'L3MON4D3/LuaSnip',
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
},
|
||||
|
||||
config = function()
|
||||
local cmp = require'cmp'
|
||||
local ls = require('luasnip')
|
||||
|
||||
cmp.setup({
|
||||
snippets = {
|
||||
expand = function(args)
|
||||
ls.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = 'luasnip' },
|
||||
},
|
||||
})
|
||||
end,
|
||||
-- },
|
||||
-- 'saadparwaiz1/cmp_luasnip',
|
||||
|
||||
|
||||
-- config = function()
|
||||
--
|
||||
-- end,
|
||||
--
|
||||
-- config = function()
|
||||
-- local cmp = require('cmp')
|
||||
--
|
||||
-- cmp.setup({
|
||||
-- snippet = {
|
||||
-- expand = function(args)
|
||||
-- vim.fn["luasnip#anonymous"](args.body)
|
||||
-- end,
|
||||
-- },
|
||||
-- window = {
|
||||
-- completion = cmp.config.window.bordered(),
|
||||
-- documentation = cmp.config.window.bordered(),
|
||||
-- },
|
||||
-- mapping = cmp.mapping.preset.insert({
|
||||
-- ['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
-- ['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
-- ['<C-Space>'] = cmp.mapping.complete(),
|
||||
-- ['<C-y>'] = cmp.config.disable,
|
||||
-- ['<C-e>'] = cmp.mapping({
|
||||
-- i = cmp.mapping.abort(),
|
||||
-- c = cmp.mapping.close(),
|
||||
-- }),
|
||||
-- ['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
-- }),
|
||||
-- sources = cmp.config.sources({
|
||||
-- { name = 'nvim_lsp' },
|
||||
-- { name = 'luasnip' },
|
||||
-- }, {
|
||||
-- { name = 'buffer' },
|
||||
-- })
|
||||
-- })
|
||||
--
|
||||
-- end,
|
||||
--
|
||||
-- build = function()
|
||||
-- local lspconfig = require('lspconfig')
|
||||
-- for i, lsp in ipairs(enabled_lsps) do
|
||||
-- lspconfig[lsp].setup({
|
||||
-- capabilities = capabilities
|
||||
-- })
|
||||
-- end
|
||||
-- end,
|
||||
}
|
||||
Reference in New Issue
Block a user