This commit is contained in:
iofq 2024-08-21 00:30:13 -05:00
parent b0cd1f6bb8
commit 4ceceff9bf
7 changed files with 22 additions and 30 deletions

View file

@ -19,22 +19,21 @@ return {
require('luasnip').lsp_expand(args.body)
end,
},
experimental = {
native_menu = false,
ghost_text = true,
},
mapping = cmp.mapping.preset.insert {
['<C-j>'] = cmp.mapping.scroll_docs(-4),
['<C-k>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<esc>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm { select = true }, -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
['<C-u>'] = cmp.mapping.scroll_docs(-4),
['<C-d>'] = cmp.mapping.scroll_docs(4),
['<C-n>'] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert },
['<C-p>'] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert },
['<C-Space>'] = cmp.mapping.confirm {
select = true,
behavior = cmp.SelectBehavior.Insert
},
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'nvim_lsp', keyword_length = 1 },
{ name = 'luasnip' },
}, {
{ name = 'buffer' },
{ name = 'path' },
}),
}
@ -68,13 +67,13 @@ return {
}
require('luasnip.loaders.from_vscode').lazy_load()
vim.keymap.set({ 'i', 's' }, '<C-K>', function()
vim.keymap.set({ 'i', 's' }, '<C-J>', function()
if ls.expand_or_jumpable() then
ls.expand_or_jump()
end
end, { silent = true })
vim.keymap.set({ 'i', 's' }, '<C-J>', function()
vim.keymap.set({ 'i', 's' }, '<C-K>', function()
if ls.jumpable(-1) then
ls.jump(-1)
end
@ -85,14 +84,6 @@ return {
ls.change_choice(1)
end
end, { silent = true })
--------------------
-- Snippets --
--------------------
local fmta = require('luasnip.extras.fmt').fmta
ls.add_snippets('go', {
ls.snippet('ie', fmta('if err != nil {\n\treturn <err>\n}', { err = ls.insert_node(1, 'err') })),
})
end,
},
}

View file

@ -68,7 +68,6 @@ return {
}
lspconfig.jedi_language_server.setup {}
lspconfig.nil_ls.setup {}
lspconfig.phpactor.setup {}
lspconfig.lua_ls.setup {
on_init = function(client)
local path = client.workspace_folders[1].name

View file

@ -1,7 +1,7 @@
return {
{
'echasnovski/mini.nvim',
event = "VeryLazy",
lazy = false,
config = function()
require('mini.ai').setup()
require('mini.comment').setup()
@ -28,6 +28,7 @@ return {
return summary
end
local diagnostics = MiniStatusline.section_diagnostics { trunc_width = 75 }
local lsp = MiniStatusline.section_lsp { trunc_width = 75 }
local filename = MiniStatusline.section_filename { trunc_width = 140 }
local search = MiniStatusline.section_searchcount { trunc_width = 75 }
@ -36,7 +37,7 @@ return {
'%<', -- Mark general truncate point
{ hl = 'MiniStatuslineFilename', strings = { filename } },
'%=', -- End left alignment
{ hl = 'MiniStatusDevinfo', strings = { git(), diff(), diagnostics } },
{ hl = 'MiniStatusDevinfo', strings = { git(), diff(), diagnostics, lsp} },
{ hl = mode_hl, strings = { search } },
}
end,

View file

@ -24,7 +24,7 @@ return {
},
{
'OXY2DEV/markview.nvim',
lazy = false,
event = 'VeryLazy',
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons"

View file

@ -1,7 +1,7 @@
return {
{
'nvim-treesitter/nvim-treesitter',
event = 'VeryLazy',
lazy = false,
dependencies = {
'nvim-treesitter/nvim-treesitter-context',
'nvim-treesitter/nvim-treesitter-textobjects',