1
Fork 0

feat: more work on the catppuccin installation

This commit is contained in:
Matei Adriel 2022-05-10 19:00:16 +03:00
parent 505fdbc65a
commit 14555c38b6
16 changed files with 189 additions and 15 deletions
dotfiles/neovim/lua/my/plugins

View file

@ -2,7 +2,10 @@ local M = {}
local function has_words_before()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match('%s') == nil
return col ~= 0 and
vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col,
col)
:match('%s') == nil
end
function M.setup()
@ -23,10 +26,16 @@ function M.setup()
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), {'i', 'c'}),
-- ['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), {'i', 'c'}),
['<C-y>'] = cmp.config.disable,
['<C-e>'] = cmp.mapping({i = cmp.mapping.abort(), c = cmp.mapping.close()}),
['<C-e>'] = cmp.mapping({
i = cmp.mapping.abort(),
c = cmp.mapping.close()
}),
['<CR>'] = cmp.mapping.confirm({select = true}),
-- https://github.com/hrsh7th/nvim-cmp/wiki/Example-mappings
['<C-Space>'] = cmp.mapping.confirm {behavior = cmp.ConfirmBehavior.Insert, select = true},
['<C-Space>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Insert,
select = true
},
-- TODO: abstract booth of those away perhaps?
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
@ -61,7 +70,9 @@ function M.setup()
cmp.setup.cmdline('/', {sources = {{name = 'buffer'}}})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {sources = cmp.config.sources({{name = 'path'}}, {{name = 'cmdline'}})})
cmp.setup.cmdline(':', {
sources = cmp.config.sources({{name = 'path'}}, {{name = 'cmdline'}})
})
end
return M