aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/nvim/lua/plugins/bufferline.lua
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2022-03-17 13:09:00 -0500
committerToby Vincent <tobyv13@gmail.com>2022-03-17 13:09:00 -0500
commitea8f210bd97b48d2ffd664f966872a8e51f1e306 (patch)
tree18f33ee3d82cc7399e367f59a64d4067661cac35 /nvim/lua/plugins/bufferline.lua
parenta3d6669ce88b8690e53429773d7e30056d86e135 (diff)
feat: initial working nvim
Diffstat (limited to 'nvim/lua/plugins/bufferline.lua')
-rw-r--r--nvim/lua/plugins/bufferline.lua182
1 files changed, 182 insertions, 0 deletions
diff --git a/nvim/lua/plugins/bufferline.lua b/nvim/lua/plugins/bufferline.lua
new file mode 100644
index 0000000..bd3192d
--- /dev/null
+++ b/nvim/lua/plugins/bufferline.lua
@@ -0,0 +1,182 @@
+local diagnostics_signs = {
+ ['error'] = '',
+ warning = '',
+ default = '',
+}
+
+require('bufferline').setup{
+ options = {
+ 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',
+ indicator_icon = ' ',
+ buffer_close_icon = '',
+ modified_icon = '●',
+ close_icon = '',
+ close_command = "Bdelete %d",
+ right_mouse_command = "Bdelete! %d",
+ left_trunc_marker = '',
+ right_trunc_marker = '',
+ 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"}
+ },
+
+ }
+}
+
+-- local map = require('utils').map
+-- local bufferline = require 'bufferline'
+
+-- local bar_bg = '#1f1f1f'
+-- local bar_fg = '#c9c9c9'
+-- local elem_bg = '#2d2d2d'
+-- local elem_fg = '#8c8c8c'
+-- local selected_bg = '#444444'
+-- local selected_fg = '#efefef'
+-- local error_fg = '#ca241a'
+-- local warning_fg = '#fabd2f'
+-- local info_fg = '#83a5cb'
+-- local pick_fg = '#870000'
+
+-- local colors = {
+-- bar = { guifg = bar_fg, guibg = bar_bg },
+-- elem = { guifg = elem_fg, guibg = elem_bg },
+-- elem_inactive = { guifg = elem_fg, guibg = elem_bg },
+-- elem_selected = { guifg = selected_fg, guibg = selected_bg },
+-- separator = { guifg = bar_bg, guibg = elem_bg },
+-- separator_selected = { guifg = bar_bg, guibg = selected_bg },
+-- error = { guifg = error_fg, guibg = elem_bg, guisp = error_fg },
+-- error_selected = { guifg = error_fg, guibg = selected_bg, gui = '' },
+-- warning = { guifg = warning_fg, guibg = elem_bg, guisp = warning_fg },
+-- warning_selected = { guifg = warning_fg, guibg = selected_bg, gui = '' },
+-- info = { guifg = info_fg, guibg = elem_bg, guisp = info_fg },
+-- info_selected = { guifg = info_fg, guibg = selected_bg, gui = '' },
+-- pick = { guifg = pick_fg, guibg = elem_bg },
+-- pick_selected = { guifg = pick_fg, guibg = selected_bg },
+-- }
+
+-- local diagnostics_signs = {
+-- ['error'] = '',
+-- warning = '',
+-- default = '',
+-- }
+
+-- require('bufferline').setup{
+-- options = {
+-- 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',
+-- },
+-- highlights = {
+-- background = colors.elem_inactive,
+-- buffer_selected = colors.elem_selected,
+-- buffer_visible = colors.elem_inactive,
+-- close_button = colors.elem,
+-- close_button_selected = colors.elem_selected,
+-- close_button_visible = colors.elem,
+-- diagnostic = colors.info,
+-- diagnostic_selected = colors.info_selected,
+-- diagnostic_visible = colors.info,
+-- duplicate = colors.elem,
+-- duplicate_selected = colors.elem_selected,
+-- duplicate_visible = colors.elem,
+-- error = colors.error,
+-- error_diagnostic = colors.error,
+-- error_diagnostic_selected = colors.error_selected,
+-- error_selected = colors.error_selected,
+-- fill = colors.bar,
+-- hint = colors.info,
+-- hint_diagnostic = colors.info,
+-- hint_diagnostic_selected = colors.info_selected,
+-- hint_diagnostic_visible = colors.info,
+-- hint_selected = colors.info_selected,
+-- hint_visible = colors.info,
+-- info = colors.info,
+-- info_diagnostic = colors.info,
+-- info_diagnostic_selected = colors.info_selected,
+-- info_diagnostic_visible = colors.info,
+-- info_selected = colors.info_selected,
+-- info_visible = colors.info,
+-- modified = colors.elem,
+-- modified_selected = colors.elem_selected,
+-- modified_visible = colors.elem,
+-- pick = colors.pick,
+-- pick_selected = colors.pick_selected,
+-- separator = colors.separator,
+-- separator_selected = colors.separator_selected,
+-- separator_visible = colors.separator,
+-- tab = colors.elem,
+-- tab_close = colors.bar,
+-- tab_selected = colors.elem_selected,
+-- warning = colors.warning,
+-- warning_diagnostic = colors.warning,
+-- warning_diagnostic_selected = colors.warning_selected,
+-- warning_diagnostic_visible = colors.warning,
+-- warning_selected = colors.warning_selected,
+-- warning_visible = colors.warning,
+-- },
+-- }
+
+-- local opts = { silent = true, nowait = true }
+-- map('n', 'gb', '<cmd>BufferLinePick<cr>', opts)
+-- map('n', '<leader>d', '<cmd>bdelete!<cr>', opts)