summaryrefslogtreecommitdiffstatshomepage
path: root/nvim/lua/plugins/bufferline.lua
blob: 105df66aac5552c202fe159aa0f08cc45aa6f87c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
local status_ok, bufferline = pcall(require, "bufferline")
if not status_ok then
	return
end

-- https://github.com/Mofiqul/vscode.nvim#-usage

local diagnostics_signs = {
  ['error'] = '',
  warning = '',
  default = '',
}

require('bufferline').setup{
  options = {
		indicator_icon = ' ',
    buffer_close_icon = '',
    modified_icon = '●',
    close_icon = '',
		close_command = "Bdelete! %d",
		right_mouse_command = "Bdelete! %d",
    always_show_bufferline = false,
    diagnostics = 'nvim_lsp',
    diagnostics_indicator = function(count, level, diagnostics_dict, context)
      local s = ' '
      for e, n in pairs(diagnostics_dict) do
        local sym = diagnostics_signs[e] or diagnostics_signs.default
        s = s .. (#s > 1 and ' ' or '') .. sym .. ' ' .. n
      end
      return s
    end,
    -- separator_style = 'slant',
		offsets = {{filetype = "NvimTree", text = "EXPLORER", text_align = "center"}},
		show_tab_indicators = true,
		show_close_icon = false
  },
	highlights = {
		fill = {
			guifg = {attribute = "fg", highlight = "Normal"},
			guibg = {attribute = "bg", highlight = "StatusLineNC"},
		},
		background = {
			guifg = {attribute = "fg", highlight = "Normal"},
			guibg = {attribute = "bg", highlight = "StatusLine"}
		},
		buffer_visible = {
			gui = "",
      guifg = {attribute = "fg", highlight="Normal"},
      guibg = {attribute = "bg", highlight = "Normal"}
		},
		buffer_selected = {
			gui = "",
      guifg = {attribute = "fg", highlight="Normal"},
      guibg = {attribute = "bg", highlight = "Normal"}
		},
		separator = {
			guifg = {attribute = "bg", highlight = "Normal"},
			guibg = {attribute = "bg", highlight = "StatusLine"},
		},
		separator_selected = {
      guifg = {attribute = "fg", highlight="Special"},
      guibg = {attribute = "bg", highlight = "Normal"}
		},
		separator_visible = {
			guifg = {attribute = "fg", highlight = "Normal"},
			guibg = {attribute = "bg", highlight = "StatusLineNC"},
		},
		close_button = {
			guifg = {attribute = "fg", highlight = "Normal"},
			guibg = {attribute = "bg", highlight = "StatusLine"}
		},
		close_button_selected = {
      guifg = {attribute = "fg", highlight="normal"},
      guibg = {attribute = "bg", highlight = "normal"}
		},
		close_button_visible = {
      guifg = {attribute = "fg", highlight="normal"},
      guibg = {attribute = "bg", highlight = "normal"}
		},

	}
}