added catpuccin

This commit is contained in:
Oliver Hartmann 2023-05-26 00:00:52 +02:00
parent b1c2599b9e
commit 82b12e599c
3 changed files with 123 additions and 12 deletions

View File

@ -0,0 +1,95 @@
return
{
'catppuccin/nvim',
name = 'catppuccin',
config = function()
require('catppuccin').setup({
flavour = 'macchiato', -- latte, frappe, macchiato, mocha
no_italic = true,
integrations = {
cmp = true,
gitsigns = true,
nvimtree = true,
telescope = true,
aerial = true,
indent_blankline = {
enabled = true,
colored_indent_levels = false,
},
dap = {
enabled = true,
enable_ui = true, -- enable nvim-dap-ui
},
neotest = true,
neotree = true,
notify = false,
mini = false,
which_key = true,
leap = true,
native_lsp = {
enabled = true,
virtual_text = {
errors = { 'italic' },
hints = { 'italic' },
warnings = { 'italic' },
information = { 'italic' },
},
underlines = {
errors = { 'underline' },
hints = { 'underline' },
warnings = { 'underline' },
information = { 'underline' },
},
},
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
},
highlight_overrides = {
all = function(colors)
return {
-- ['@lsp.mod.readonly'] = { style = { 'bold' } },
CmpBorder = { fg = '#fe4145' },
}
end,
macchiato = function(macchiato)
return {
['@lsp.mod.readonly'] = { style = { 'bold' } },
['@type.qualifier'] = { fg = macchiato.sky },
['@namespace'] = { fg = macchiato.red },
Macro = { fg = macchiato.rosewater}
}
end,
},
custom_highlights = function(C)
return {
CmpItemKindSnippet = { fg = C.base, bg = C.mauve },
CmpItemKindKeyword = { fg = C.base, bg = C.red },
CmpItemKindText = { fg = C.base, bg = C.teal },
CmpItemKindMethod = { fg = C.base, bg = C.blue },
CmpItemKindConstructor = { fg = C.base, bg = C.blue },
CmpItemKindFunction = { fg = C.base, bg = C.blue },
CmpItemKindFolder = { fg = C.base, bg = C.blue },
CmpItemKindModule = { fg = C.base, bg = C.blue },
CmpItemKindConstant = { fg = C.base, bg = C.peach },
CmpItemKindField = { fg = C.base, bg = C.green },
CmpItemKindProperty = { fg = C.base, bg = C.green },
CmpItemKindEnum = { fg = C.base, bg = C.green },
CmpItemKindUnit = { fg = C.base, bg = C.green },
CmpItemKindClass = { fg = C.base, bg = C.yellow },
CmpItemKindVariable = { fg = C.base, bg = C.flamingo },
CmpItemKindFile = { fg = C.base, bg = C.blue },
CmpItemKindInterface = { fg = C.base, bg = C.yellow },
CmpItemKindColor = { fg = C.base, bg = C.red },
CmpItemKindReference = { fg = C.base, bg = C.red },
CmpItemKindEnumMember = { fg = C.base, bg = C.red },
CmpItemKindStruct = { fg = C.base, bg = C.blue },
CmpItemKindValue = { fg = C.base, bg = C.peach },
CmpItemKindEvent = { fg = C.base, bg = C.blue },
CmpItemKindOperator = { fg = C.base, bg = C.blue },
CmpItemKindTypeParameter = { fg = C.base, bg = C.blue },
CmpItemKindCopilot = { fg = C.base, bg = C.teal },
}
end,
})
vim.cmd('colorscheme catppuccin')
end
}

View File

@ -31,13 +31,6 @@ return {
end
cmp.setup({
formatting = {
format = require('lspkind').cmp_format({
mode = 'symbol_text', -- show only symbol annotations
maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
})
},
mapping = {
['<Up>'] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 'c', 's' }),
['<Down>'] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 'c', 's' }),
@ -94,7 +87,7 @@ return {
{ name = 'luasnip', priority = 8 },
{ name = 'nvim_lsp', priority = 7 },
{ name = 'nvim_lsp_signature_help', priority = 7 },
{ name = 'treesitter', priority = 6 },
-- { name = 'treesitter', priority = 6 },
{
name = 'buffer',
priority = 5,
@ -122,10 +115,33 @@ return {
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_watches'
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_hover'
end,
completion = { completeopt = 'menu,menuone,noinsert, noselect' },
-- completion = {
-- completeopt = 'menu,menuone,noinsert, noselect',
-- border = 'rounded',
-- },
window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
completion = cmp.config.window.bordered({
col_offset = -3,
side_padding = 0,
winhighlight = 'Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None',
}),
documentation = cmp.config.window.bordered({
winhighlight = 'Normal:Normal,FloatBorder:FloatBorder,CursorLine:Visual,Search:None',
}),
},
formatting = {
fields = { 'kind', 'abbr', 'menu' },
format = function(entry, vim_item)
local kind = require('lspkind').cmp_format({
mode = 'symbol_text',
maxwidth = 50,
})(entry, vim_item)
local strings = vim.split(kind.kind, '%s', { trimempty = true })
kind.kind = ' ' .. strings[1] .. ' '
-- kind.menu = ' (' .. strings[2] .. ')'
return kind
end,
},
sorting = {
comparators = {

View File

@ -15,7 +15,7 @@ return {
require('lualine').setup {
options = {
-- theme = custom_gruvbox,
theme = 'gruvbox_dark',
theme = 'catppuccin',
disabled_filetypes = {
statusline = {},
winbar = { 'dap-repl', 'dapui_console' },