Skip to content

Commit

Permalink
fix(colorscheme): almost correct barbar highlights
Browse files Browse the repository at this point in the history
  • Loading branch information
ecosse3 committed May 8, 2023
1 parent d8b7e0d commit 00645d6
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 66 deletions.
7 changes: 6 additions & 1 deletion lua/config/colorscheme.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ tokyonight.setup({
--- You can override specific highlights to use other groups or a hex color
--- function will be called with a Highlights and ColorScheme table
-- on_highlights = function(highlights, colors) end,
on_highlights = function(hl, c)
on_highlights = function(hl, _color)
local prompt = "#FFA630"
local text = "#488dff"
local none = "NONE"
Expand Down Expand Up @@ -104,6 +104,11 @@ if EcoVim.colorscheme == "tokyonight" then
vim.api.nvim_set_hl(0, "Boolean", { fg = "#F7768E" })
vim.api.nvim_set_hl(0, "BufferOffset", { link = "EcovimSecondary" })

-- Bufferline
vim.api.nvim_set_hl(0, "BufferCurrentSign", { fg = c.cyan0 })
vim.api.nvim_set_hl(0, "BufferInactiveSign", { bg = "#202331", fg = c.dark3 })
vim.api.nvim_set_hl(0, "BufferInactiveMod", { bg = "NONE", fg = c.yellow })

-- Completion Menu Colors
local highlights = {
CmpItemAbbr = { fg = c.dark3, bg = "NONE" },
Expand Down
3 changes: 3 additions & 0 deletions lua/config/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ return {
dependencies = { "nvim-tree/nvim-web-devicons" },
event = "BufAdd",
version = "^1.0.0",
init = function()
vim.g.barbar_auto_setup = false
end,
config = function()
require("plugins.barbar")
end,
Expand Down
104 changes: 39 additions & 65 deletions lua/plugins/barbar.lua
Original file line number Diff line number Diff line change
@@ -1,66 +1,40 @@
-- Set barbar's options
require'bufferline'.setup {
-- Enable/disable animations
animation = true,

-- Enable/disable auto-hiding the tab bar when there is a single buffer
auto_hide = false,

-- Enable/disable current/total tabpages indicator (top right corner)
tabpages = true,

-- Enable/disable close button
closable = false,

-- Enables/disable clickable tabs
-- - left-click: go to buffer
-- - middle-click: delete buffer
clickable = true,

-- Excludes buffers from the tabline
exclude_ft = {'qf'},
-- exclude_name = ['package.json'],

-- Enable/disable icons
-- if set to 'numbers', will show buffer index in the tabline
-- if set to 'both', will show buffer index and icons in the tabline
icons = 'both',

-- If set, the icon color will follow its corresponding buffer
-- highlight group. By default, the Buffer*Icon group is linked to the
-- Buffer* group (see Highlighting below). Otherwise, it will take its
-- default value as defined by devicons.
icon_custom_colors = false,

-- Configure icons on the bufferline.
icon_separator_active = '',
icon_separator_inactive = '',
icon_close_tab = '',
icon_close_tab_modified = '',
icon_pinned = '',

-- If true, new buffers will be inserted at the end of the list.
-- Default is to insert after current buffer.
insert_at_end = false,

-- Sets the maximum padding width with which to surround each tab
maximum_padding = 2,

-- Sets the maximum buffer name length.
maximum_length = 30,

-- If set, the letters for each buffer in buffer-pick mode will be
-- assigned based on their name. Otherwise or in case all letters are
-- already assigned, the behavior is to assign letters in order of
-- usability (see order below)
semantic_letters = true,

-- New buffer letters are assigned in this order. This order is
-- optimal for the qwerty keyboard layout but might need adjustement
-- for other layouts.
letters = 'asdfjkl;ghnmxcvbziowerutyqpASDFJKLGHNMXCVBZIOWERUTYQP',

-- Sets the name of unnamed buffers. By default format is "[Buffer X]"
-- where X is the buffer number. But only a static string is accepted here.
no_name_title = nil,
}
require("barbar").setup({
-- Excludes buffers from the tabline
exclude_ft = { "qf" },
icons = {
buffer_index = true,
buffer_number = false,
button = "",
-- Enables / disables diagnostic symbols
diagnostics = {
[vim.diagnostic.severity.ERROR] = { enabled = false, icon = "" },
[vim.diagnostic.severity.WARN] = { enabled = false },
[vim.diagnostic.severity.INFO] = { enabled = false },
[vim.diagnostic.severity.HINT] = { enabled = false },
},
gitsigns = {
added = { enabled = false, icon = "+" },
changed = { enabled = false, icon = "~" },
deleted = { enabled = false, icon = "-" },
},
separator = { left = "", right = "" },
modified = { button = "" },
pinned = { button = "", filename = true, separator = { right = "" } },
alternate = { filetype = { enabled = false } },
current = { buffer_index = true },
inactive = { button = nil },
visible = { modified = { buffer_number = false } },
},
-- Set the filetypes which barbar will offset itself for
sidebar_filetypes = {
-- Use the default values: {event = 'BufWinLeave', text = nil}
-- NvimTree = { text = "File Explorer" },
-- Or, specify the text used for the offset:
-- undotree = { text = "undotree" },
-- Or, specify the event which the sidebar executes when leaving:
-- ["neo-tree"] = { event = "BufWipeout" },
-- Or, specify both
-- Outline = { event = "BufWinLeave", text = "symbols-outline" },
},
})

0 comments on commit 00645d6

Please sign in to comment.