Updated Yazi: version, hop plugin, glow preview

This commit is contained in:
Thomas Naderer
2025-05-30 23:30:44 +02:00
parent b3cb8b7fdf
commit 85ef8dca72
11 changed files with 324 additions and 87 deletions

View File

@@ -0,0 +1,41 @@
local cmp = require('cmp')
local luasnip = require('luasnip')
require("luasnip.loaders.from_vscode").lazy_load() -- Load friendly-snippets
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/lua/snippets" }) -- Load custom Lua snippets
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body) -- Use LuaSnip for expanding snippets
end,
},
mapping = {
['<C-Space>'] = cmp.mapping.complete(), -- Trigger completion manually
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Confirm completion
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
},
sources = cmp.config.sources({
{ name = 'nvim_lsp' }, -- LSP suggestions
{ name = 'luasnip' }, -- Snippets
{ name = 'buffer' }, -- Buffer words
{ name = 'path' }, -- File paths
})
})