bufferline: add highlights

This commit is contained in:
siduck76 2021-04-25 11:57:24 +05:30
parent 07ab4163c6
commit 5c44978f47
2 changed files with 33 additions and 21 deletions

View File

@ -1,6 +1,10 @@
vim.o.termguicolors = true vim.o.termguicolors = true
-- colors for active , inactive uffer tabs -- colors
local bar_fg = "#565c64"
local activeBuffer_fg = "#c8ccd4"
require "bufferline".setup { require "bufferline".setup {
options = { options = {
buffer_close_icon = "", buffer_close_icon = "",
@ -18,40 +22,47 @@ require "bufferline".setup {
}, },
highlights = { highlights = {
background = { background = {
guifg = comment_fg, guifg = bar_fg,
guibg = "#1e222a" guibg = "#1e222a"
}, },
fill = { fill = {
guifg = comment_fg, guifg = bar_fg,
guibg = "#1e222a" guibg = "#1e222a"
}, },
-- focused window
buffer_selected = { buffer_selected = {
guifg = normal_fg, guifg = activeBuffer_fg,
guibg = "#282c34", guibg = "#353b45",
gui = "bold" gui = "bold"
}, },
separator_selected = {
guifg = "#353b45",
guibg = "#353b45"
},
-- unfocused opened window
buffer_visible = { buffer_visible = {
guifg = "#3e4451", guifg = "#9298a0",
guibg = "#1e222a" guibg = "#282c34"
}, },
separator_visible = { separator_visible = {
guifg = "#1e222a", guifg = "#282c34",
guibg = "#1e222a" guibg = "#282c34"
},
separator_selected = {
guifg = "#1e222a",
guibg = "#1e222a"
}, },
separator = { separator = {
guifg = "#1e222a", guifg = "#1e222a",
guibg = "#1e222a" guibg = "#1e222a"
}, },
indicator_selected = { indicator_selected = {
guifg = "#1e222a", guifg = "#1e222a",
guibg = "#1e222a" guibg = "#1e222a"
}, },
modified_selected = { modified_selected = {
guifg = string_fg, guifg = bar_fg,
guibg = "#353b45" guibg = "#353b45"
} }
} }
@ -59,15 +70,15 @@ require "bufferline".setup {
local opt = {silent = true} local opt = {silent = true}
local map = vim.api.nvim_set_keymap
vim.g.mapleader = " " vim.g.mapleader = " "
--command that adds new buffer and moves to it --command that adds new buffer and moves to it
vim.api.nvim_command "com -nargs=? -complete=file_in_path New badd <args> | blast" map("n", "<S-b>", [[<Cmd>tabnew<CR>]], opt)
vim.api.nvim_set_keymap("n", "<S-b>", [[<Cmd>tabnew<CR>]], opt)
--removing a buffer --removing a buffer
vim.api.nvim_set_keymap("n", "<S-d>", [[<Cmd>bdelete<CR>]], opt) map("n", "<S-d>", [[<Cmd>bdelete<CR>]], opt)
-- tabnew and tabprev -- tabnew and tabprev
vim.api.nvim_set_keymap("n", "<S-l>", [[<Cmd>BufferLineCycleNext<CR>]], opt) map("n", "<S-l>", [[<Cmd>BufferLineCycleNext<CR>]], opt)
vim.api.nvim_set_keymap("n", "<S-s>", [[<Cmd>BufferLineCyclePrev<CR>]], opt) map("n", "<S-s>", [[<Cmd>BufferLineCyclePrev<CR>]], opt)

View File

@ -7,11 +7,12 @@ ts_config.setup {
"css", "css",
"bash", "bash",
"lua", "lua",
"json" "json",
"python"
-- "cpp", -- "cpp",
-- "rust", -- "rust",
-- "python"
}, },
highlight = { highlight = {
enable = true, enable = true,
use_languagetree = true use_languagetree = true