You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NvChad/lua/top-bufferline.lua

78 lines
1.9 KiB
Lua

-- colors
local bar_fg = "#565c64"
local activeBuffer_fg = "#c8ccd4"
4 years ago
require "bufferline".setup {
options = {
buffer_close_icon = "",
modified_icon = "",
close_icon = "",
4 years ago
left_trunc_marker = "",
right_trunc_marker = "",
max_name_length = 14,
max_prefix_length = 13,
tab_size = 20,
4 years ago
enforce_regular_tabs = true,
view = "multiwindow",
show_buffer_close_icons = true,
separator_style = "thin"
4 years ago
},
4 years ago
highlights = {
4 years ago
background = {
guifg = bar_fg,
guibg = "#282c34"
4 years ago
},
fill = {
guifg = bar_fg,
guibg = "#282c34"
4 years ago
},
-- focused window
4 years ago
buffer_selected = {
guifg = activeBuffer_fg,
guibg = "#1e222a",
4 years ago
gui = "bold"
},
separator_selected = {
guifg = "#1e222a",
guibg = "#1e222a"
},
-- unfocused opened window
buffer_visible = {
guifg = "#9298a0",
guibg = "#282c34"
},
4 years ago
separator_visible = {
guifg = "#282c34",
guibg = "#282c34"
4 years ago
},
separator = {
guifg = "#282c34",
guibg = "#282c34"
4 years ago
},
indicator_selected = {
guifg = "#282c34",
guibg = "#282c34"
4 years ago
},
4 years ago
modified_selected = {
guifg = "#A3BE8C",
guibg = "#1e222a"
4 years ago
}
}
4 years ago
}
local opt = {silent = true}
local map = vim.api.nvim_set_keymap
vim.g.mapleader = " "
--command that adds new buffer and moves to it
map("n", "<S-t>", [[<Cmd>tabnew<CR>]], opt)
4 years ago
--removing a buffer
map("n", "<S-x>", [[<Cmd>bdelete<CR>]], opt)
4 years ago
-- tabnew and tabprev
map("n", "<TAB>", [[<Cmd>BufferLineCycleNext<CR>]], opt)
map("n", "<S-TAB>", [[<Cmd>BufferLineCyclePrev<CR>]], opt)