snippet to tab in nvim, better newsboat, correct alias

This commit is contained in:
2024-04-12 15:06:54 +02:00
parent a9fc5866d8
commit cf7e85d3fa
3 changed files with 43 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
#show-read-feeds no
auto-reload yes
prepopulate-query-feeds yes
confirm-mark-feed-read no
external-url-viewer "urlscan -dc -r 'linkhandler {}'"

View File

@@ -92,12 +92,48 @@ cmp.setup({
ghost_text = true,
},
mapping = cmp.mapping.preset.insert({
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
['<C-y>'] = cmp.mapping.confirm({ select = true }),
['<C-Space>'] = cmp.mapping.complete(),
}),
-- mapping = cmp.mapping.preset.insert({
-- ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
-- ['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
-- ['<C-y>'] = cmp.mapping.confirm({ select = true }),
-- ['<C-Space>'] = cmp.mapping.complete(),
-- }),
mapping = {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
if #cmp.get_entries() == 1 then
cmp.confirm({ select = true })
else
cmp.select_next_item()
end
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump()
elseif has_words_before() then
cmp.complete()
if #cmp.get_entries() == 1 then
cmp.confirm({ select = true })
end
else
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function()
if cmp.visible() then
if #cmp.get_entries() == 1 then
cmp.confirm({ select = true })
else
cmp.select_prev_item()
end
elseif luasnip.jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { "i", "s" }),
['<CR>'] = cmp.mapping.confirm({select = true }),
['<C-e>'] = cmp.mapping.abort(),
},
snippet = {
expand = function(args)

View File

@@ -50,4 +50,3 @@ alias \
ixpe="cd /home/tibeuleu/IXPE_analysis/Code && clear && ls" \
foc="cd /home/tibeuleu/FOC_reduction/Code && clear && ls" \
config='/usr/bin/git --git-dir=/home/tibeuleu/.cfg/ --work-tree=/home/tibeuleu' \