36cb57ecce
* tree-wide: Format files ugh why do people don't push formatted stuff * mappings|init: Move init mappings to a function, only call when required | Show err message for init because mappings.lua is called from multiple places, so there should't be any code that executes without calling a specific function show error message when something fails in init.lua makes no sense to not rearrange plugin functions alphabetically, but keep misc at top * feat: Do not depend on user config | Fix merging of configs because it is a user config, so our config shoudn't break even we if dont have it use our own table merge function move loading config to a function use a global variable to store the config, so no need to call the table function everytime * Add NvChadUpdate command and shortcut for it map leader+uu to it summary of what it does: first ask the user for confirmation and tell that the updater is gonna run git reset --hard in config repo and chadrc will be restored take backup of chadrc in a lua string and locally in a file with chadrc.bak.(random numbers) git reset on config dir and git pull whether success or error, restore the chadrc file if restore fails, then print backup file path for more deep understanding, read the comments in utils.lua * NvChadUpdater: Make update repo and url configurable | Improvr logging
124 lines
3.0 KiB
Lua
124 lines
3.0 KiB
Lua
local global_theme = "themes/" .. vim.g.nvchad_theme
|
|
local colors = require(global_theme)
|
|
|
|
local present, bufferline = pcall(require, "bufferline")
|
|
if not present then
|
|
return
|
|
end
|
|
|
|
bufferline.setup {
|
|
options = {
|
|
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
|
|
buffer_close_icon = "",
|
|
modified_icon = "",
|
|
close_icon = "",
|
|
left_trunc_marker = "",
|
|
right_trunc_marker = "",
|
|
max_name_length = 14,
|
|
max_prefix_length = 13,
|
|
tab_size = 20,
|
|
show_tab_indicators = true,
|
|
enforce_regular_tabs = false,
|
|
view = "multiwindow",
|
|
show_buffer_close_icons = true,
|
|
separator_style = "thin",
|
|
mappings = true,
|
|
always_show_bufferline = true,
|
|
custom_filter = function(buf_number)
|
|
-- Func to filter out our managed/persistent split terms
|
|
local present_type, type = pcall(function()
|
|
return vim.api.nvim_buf_get_var(buf_number, "term_type")
|
|
end)
|
|
|
|
if present_type then
|
|
if type == "vert" then
|
|
return false
|
|
elseif type == "hori" then
|
|
return false
|
|
else
|
|
return true
|
|
end
|
|
else
|
|
return true
|
|
end
|
|
end,
|
|
},
|
|
highlights = {
|
|
fill = {
|
|
guifg = colors.grey_fg,
|
|
guibg = colors.black2,
|
|
},
|
|
background = {
|
|
guifg = colors.grey_fg,
|
|
guibg = colors.black2,
|
|
},
|
|
-- buffers
|
|
buffer_visible = {
|
|
guifg = colors.light_grey,
|
|
guibg = colors.black2,
|
|
},
|
|
buffer_selected = {
|
|
guifg = colors.white,
|
|
guibg = colors.black,
|
|
gui = "bold",
|
|
},
|
|
-- tabs
|
|
tab = {
|
|
guifg = colors.light_grey,
|
|
guibg = colors.one_bg3,
|
|
},
|
|
tab_selected = {
|
|
guifg = colors.black2,
|
|
guibg = colors.nord_blue,
|
|
},
|
|
tab_close = {
|
|
guifg = colors.red,
|
|
guibg = colors.black,
|
|
},
|
|
indicator_selected = {
|
|
guifg = colors.black,
|
|
guibg = colors.black,
|
|
},
|
|
-- separators
|
|
separator = {
|
|
guifg = colors.black2,
|
|
guibg = colors.black2,
|
|
},
|
|
separator_visible = {
|
|
guifg = colors.black2,
|
|
guibg = colors.black2,
|
|
},
|
|
separator_selected = {
|
|
guifg = colors.black2,
|
|
guibg = colors.black2,
|
|
},
|
|
-- modified
|
|
modified = {
|
|
guifg = colors.red,
|
|
guibg = colors.black2,
|
|
},
|
|
modified_visible = {
|
|
guifg = colors.red,
|
|
guibg = colors.black2,
|
|
},
|
|
modified_selected = {
|
|
guifg = colors.green,
|
|
guibg = colors.black,
|
|
},
|
|
-- close buttons
|
|
|
|
close_button = {
|
|
guifg = colors.light_grey,
|
|
guibg = colors.black2,
|
|
},
|
|
close_button_visible = {
|
|
guifg = colors.light_grey,
|
|
guibg = colors.black2,
|
|
},
|
|
close_button_selected = {
|
|
guifg = colors.red,
|
|
guibg = colors.black,
|
|
},
|
|
},
|
|
}
|