2021-04-25 02:27:24 -04:00
|
|
|
-- colors
|
|
|
|
|
|
|
|
local bar_fg = "#565c64"
|
|
|
|
local activeBuffer_fg = "#c8ccd4"
|
|
|
|
|
2021-03-12 20:23:02 -05:00
|
|
|
require "bufferline".setup {
|
|
|
|
options = {
|
|
|
|
buffer_close_icon = "",
|
2021-04-26 04:14:51 -04:00
|
|
|
modified_icon = "",
|
2021-03-18 09:49:45 -04:00
|
|
|
close_icon = "",
|
2021-03-12 20:23:02 -05:00
|
|
|
left_trunc_marker = "",
|
|
|
|
right_trunc_marker = "",
|
|
|
|
max_name_length = 14,
|
|
|
|
max_prefix_length = 13,
|
2021-05-06 10:19:02 -04:00
|
|
|
tab_size = 20,
|
2021-03-12 20:23:02 -05:00
|
|
|
enforce_regular_tabs = true,
|
|
|
|
view = "multiwindow",
|
|
|
|
show_buffer_close_icons = true,
|
|
|
|
separator_style = "thin"
|
2021-03-07 09:22:30 -05:00
|
|
|
},
|
2021-03-12 20:23:02 -05:00
|
|
|
highlights = {
|
2021-03-07 09:22:30 -05:00
|
|
|
background = {
|
2021-04-25 02:27:24 -04:00
|
|
|
guifg = bar_fg,
|
2021-05-06 10:19:02 -04:00
|
|
|
guibg = "#282c34"
|
2021-03-12 20:23:02 -05:00
|
|
|
},
|
|
|
|
fill = {
|
2021-04-25 02:27:24 -04:00
|
|
|
guifg = bar_fg,
|
2021-05-06 10:19:02 -04:00
|
|
|
guibg = "#282c34"
|
2021-03-12 20:23:02 -05:00
|
|
|
},
|
2021-04-25 02:27:24 -04:00
|
|
|
-- focused window
|
2021-03-07 09:22:30 -05:00
|
|
|
buffer_selected = {
|
2021-04-25 02:27:24 -04:00
|
|
|
guifg = activeBuffer_fg,
|
2021-05-06 10:19:02 -04:00
|
|
|
guibg = "#1e222a",
|
2021-03-12 20:23:02 -05:00
|
|
|
gui = "bold"
|
|
|
|
},
|
2021-04-25 02:27:24 -04:00
|
|
|
separator_selected = {
|
2021-05-06 10:19:02 -04:00
|
|
|
guifg = "#1e222a",
|
|
|
|
guibg = "#1e222a"
|
2021-04-25 02:27:24 -04:00
|
|
|
},
|
|
|
|
-- unfocused opened window
|
2021-04-05 22:59:37 -04:00
|
|
|
buffer_visible = {
|
2021-04-25 02:27:24 -04:00
|
|
|
guifg = "#9298a0",
|
|
|
|
guibg = "#282c34"
|
2021-04-05 22:59:37 -04:00
|
|
|
},
|
2021-03-12 20:23:02 -05:00
|
|
|
separator_visible = {
|
2021-04-25 02:27:24 -04:00
|
|
|
guifg = "#282c34",
|
|
|
|
guibg = "#282c34"
|
2021-03-12 20:23:02 -05:00
|
|
|
},
|
|
|
|
separator = {
|
2021-05-06 10:19:02 -04:00
|
|
|
guifg = "#282c34",
|
|
|
|
guibg = "#282c34"
|
2021-03-12 20:23:02 -05:00
|
|
|
},
|
|
|
|
indicator_selected = {
|
2021-05-06 10:19:02 -04:00
|
|
|
guifg = "#282c34",
|
|
|
|
guibg = "#282c34"
|
2021-03-12 20:23:02 -05:00
|
|
|
},
|
2021-03-07 09:22:30 -05:00
|
|
|
modified_selected = {
|
2021-05-06 10:19:02 -04:00
|
|
|
guifg = "#A3BE8C",
|
|
|
|
guibg = "#1e222a"
|
2021-03-12 20:23:02 -05:00
|
|
|
}
|
|
|
|
}
|
2021-03-07 09:22:30 -05:00
|
|
|
}
|
2021-03-18 09:49:45 -04:00
|
|
|
|
|
|
|
local opt = {silent = true}
|
|
|
|
|
2021-04-25 02:27:24 -04:00
|
|
|
local map = vim.api.nvim_set_keymap
|
2021-03-18 09:49:45 -04:00
|
|
|
vim.g.mapleader = " "
|
|
|
|
|
2021-03-31 05:47:11 -04:00
|
|
|
--command that adds new buffer and moves to it
|
2021-04-25 11:12:24 -04:00
|
|
|
map("n", "<S-t>", [[<Cmd>tabnew<CR>]], opt)
|
2021-04-01 14:53:12 -04:00
|
|
|
|
2021-03-31 05:47:11 -04:00
|
|
|
--removing a buffer
|
2021-04-27 05:57:07 -04:00
|
|
|
map("n", "<S-x>", [[<Cmd>bdelete<CR>]], opt)
|
2021-04-01 14:53:12 -04:00
|
|
|
|
2021-03-18 09:49:45 -04:00
|
|
|
-- tabnew and tabprev
|
2021-05-09 01:21:29 -04:00
|
|
|
map("n", "<S-l>", [[<Cmd>BufferLineCycleNext<CR>]], opt) -- Another alternate is TAB/S-TAB or C-,/C-.
|
|
|
|
map("n", "<S-p>", [[<Cmd>BufferLineCyclePrev<CR>]], opt)
|