Skip to content

Commit

Permalink
Merge pull request #214 from Jint-lzxy/main
Browse files Browse the repository at this point in the history
feat(catppuccin & bufferline)!: Move configs in place.
  • Loading branch information
ayamir authored Aug 29, 2022
2 parents 7e2002f + 5a55f0f commit 3b9d470
Showing 1 changed file with 46 additions and 30 deletions.
76 changes: 46 additions & 30 deletions lua/modules/ui/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,6 @@ function config.catppuccin()
vim_sneak = false,
fern = false,
barbar = false,
bufferline = {
enabled = true,
italics = true,
bolds = true,
},
markdown = true,
lightspeed = false,
ts_rainbow = true,
Expand Down Expand Up @@ -328,28 +323,6 @@ function config.catppuccin()
rainbowcol6 = { bg = cp.none },
rainbowcol7 = { bg = cp.none },

-- For bufferline
BufferLineWarning = { fg = cp.yellow },
BufferLineWarningVisible = { fg = cp.yellow },
BufferLineWarningDiagnostic = { fg = cp.yellow },
BufferLineWarningDiagnosticVisible = { fg = cp.yellow },
BufferLineWarningSelected = { fg = cp.yellow },
BufferLineWarningDiagnosticSelected = { fg = cp.yellow },

BufferLineInfo = { fg = cp.sky },
BufferLineInfoVisible = { fg = cp.sky },
BufferLineInfoDiagnostic = { fg = cp.sky },
BufferLineInfoDiagnosticVisible = { fg = cp.sky },
BufferLineInfoDiagnosticSelected = { fg = cp.sky },
BufferLineInfoSelected = { fg = cp.sky },

BufferLineHint = { fg = cp.rosewater },
BufferLineHintVisible = { fg = cp.rosewater },
BufferLineHintDiagnostic = { fg = cp.rosewater },
BufferLineHintDiagnosticVisible = { fg = cp.rosewater },
BufferLineHintSelected = { fg = cp.rosewater },
BufferLineHintDiagnosticSelected = { fg = cp.rosewater },

-- For treesitter.
TSField = { fg = cp.rosewater },
TSProperty = { fg = cp.yellow },
Expand Down Expand Up @@ -845,9 +818,9 @@ function config.nvim_tree()
end

function config.nvim_bufferline()
require("bufferline").setup({
local opts = {
options = {
number = "none",
number = nil,
modified_icon = "",
buffer_close_icon = "",
left_trunc_marker = "",
Expand All @@ -873,7 +846,50 @@ function config.nvim_bufferline()
return "(" .. count .. ")"
end,
},
})
-- Change bufferline's highlights here! See `:h bufferline-highlights` for detailed explanation.
-- Note: If you use catppuccin then modify the colors below!
highlights = {},
}

if vim.g.colors_name == "catppuccin" then
local cp = require("catppuccin.palettes").get_palette() -- Get the palette.
cp.none = "NONE" -- Special setting for complete transparent fg/bg.

local catppuccin_hl_overwrite = {
highlights = require("catppuccin.groups.integrations.bufferline").get({
styles = { "italic", "bold" },
custom = {
mocha = {
-- Warnings
warning = { fg = cp.yellow },
warning_visible = { fg = cp.yellow },
warning_selected = { fg = cp.yellow },
warning_diagnostic = { fg = cp.yellow },
warning_diagnostic_visible = { fg = cp.yellow },
warning_diagnostic_selected = { fg = cp.yellow },
-- Infos
info = { fg = cp.sky },
info_visible = { fg = cp.sky },
info_selected = { fg = cp.sky },
info_diagnostic = { fg = cp.sky },
info_diagnostic_visible = { fg = cp.sky },
info_diagnostic_selected = { fg = cp.sky },
-- Hint
hint = { fg = cp.rosewater },
hint_visible = { fg = cp.rosewater },
hint_selected = { fg = cp.rosewater },
hint_diagnostic = { fg = cp.rosewater },
hint_diagnostic_visible = { fg = cp.rosewater },
hint_diagnostic_selected = { fg = cp.rosewater },
},
},
}),
}

opts = vim.tbl_deep_extend("force", opts, catppuccin_hl_overwrite)
end

require("bufferline").setup(opts)
end

function config.gitsigns()
Expand Down

0 comments on commit 3b9d470

Please sign in to comment.