enc: update config dashboard

This commit is contained in:
Pojok Code 2024-10-23 16:07:07 +07:00
parent c09e320633
commit 05d51faadf
34 changed files with 72 additions and 1520 deletions

View file

@ -33,9 +33,9 @@ return {
-- border = "none",
border = icons.Border,
icons = {
package_pending = icons.DotCircle,
package_pending = icons.Pending,
package_installed = icons.CheckCircle,
package_uninstalled = icons.BlankCircle,
package_uninstalled = icons.DotCircle,
},
keymaps = {
-- Keymap to expand a server in the UI

View file

@ -2,187 +2,11 @@ return {
"akinsho/bufferline.nvim",
branch = "main",
event = { "BufRead", "InsertEnter", "BufNewFile" },
dependencies = "pojokcodeid/auto-bufferline.nvim",
config = function()
local status_ok, bufferline = pcall(require, "bufferline")
if not status_ok then
return
end
local icons = pcode.icons
local use_icons = true
-- get folder name from current directory
local _get_folder_name = function()
local str = vim.fn.fnamemodify(vim.fn.getcwd(), ":t")
return " " .. icons.ui.ProjekFolder .. " " .. str:lower():gsub("^%l", string.upper) .. " "
end
local function diagnostics_indicator(num, _, diagnostics, _)
local result
local symbols = {
error = icons.diagnostics.Error,
warning = icons.diagnostics.Warning,
info = icons.diagnostics.Information,
}
if not use_icons then
return "(" .. num .. ")"
end
for name, count in pairs(diagnostics) do
if symbols[name] and count > 0 then
table.insert(result, symbols[name] .. " " .. count)
end
end
result = table.concat(result, " ")
return #result > 0 and result or ""
end
vim.opt.termguicolors = true
bufferline.setup({
options = {
color_icons = true,
numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
close_command = function(bufnum)
require("user.utils.bufferline").bufremove(bufnum)
end,
right_mouse_command = function(bufnum)
require("user.utils.bufferline").bufremove(bufnum)
end,
-- close_command = "bdelete! %d",
-- right_mouse_command = "bdelete! %d",
left_mouse_command = "buffer %d",
middle_mouse_command = nil,
indicator_icon = nil,
indicator = { style = "icon", icon = icons.ui.BoldLineLeft },
buffer_close_icon = icons.ui.Close,
modified_icon = icons.ui.Circle,
close_icon = icons.ui.BoldClose,
left_trunc_marker = icons.ui.ArrowCircleLeft,
right_trunc_marker = icons.ui.ArrowCircleRight,
max_name_length = 30,
max_prefix_length = 30,
tab_size = 21,
diagnostics = false, -- | "nvim_lsp" | "coc",
diagnostics_update_in_insert = false,
diagnostics_indicator = diagnostics_indicator,
offsets = {
{
filetype = "NvimTree",
text = _get_folder_name(),
highlight = "Directory",
text_align = "left",
padding = 1,
},
{
filetype = "neo-tree",
text = _get_folder_name(),
highlight = "Directory",
text_align = "left",
padding = 1,
},
{
filetype = "dbui",
text = "",
highlight = "Directory",
text_align = "left",
padding = 1,
},
},
show_buffer_icons = true,
show_buffer_close_icons = true,
show_close_icon = true,
show_tab_indicators = true,
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
separator_style = { "", "" }, -- | "thick" | "thin" | { 'any', 'any' },
enforce_regular_tabs = true,
always_show_bufferline = true,
},
highlights = {
fill = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "none", highlight = "TabLine" },
},
background = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "none", highlight = "TabLine" },
},
buffer_visible = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "none", highlight = "TabLine" },
},
close_button = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "none", highlight = "TabLine" },
},
close_button_visible = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "none", highlight = "TabLine" },
},
tab_selected = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
tab = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
tab_close = {
-- fg = {attribute='fg',highlight='LspDiagnosticsDefaultError'},
fg = { attribute = "fg", highlight = "TabLineSel" },
bg = { attribute = "bg", highlight = "Normal" },
},
duplicate_selected = {
fg = { attribute = "fg", highlight = "TabLineSel" },
bg = { attribute = "bg", highlight = "TabLineSel" },
underline = true,
},
duplicate_visible = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
underline = true,
},
duplicate = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
underline = true,
},
modified = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
modified_selected = {
fg = { attribute = "fg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
modified_visible = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
separator = {
fg = { attribute = "bg", highlight = "TabLine" },
bg = { attribute = "bg", highlight = "TabLine" },
},
trunc_marker = {
fg = { attribute = "fg", highlight = "TabLine" },
bg = { attribute = "none", highlight = "TabLine" },
},
separator_selected = {
fg = { attribute = "bg", highlight = "Normal" },
bg = { attribute = "bg", highlight = "Normal" },
},
indicator_selected = {
fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" },
bg = { attribute = "bg", highlight = "Normal" },
},
indicator_visible = {
fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" },
bg = { attribute = "bg", highlight = "Normal" },
},
},
})
local config = require("auto-bufferline").config()
require("bufferline").setup(config)
end,
keys = {
{ "<leader>b", "", desc = "  Buffers", mode = "n" },
@ -197,7 +21,7 @@ return {
{
"<leader>bc",
function()
require("user.utils.bufferline").bufremove()
require("auto-bufferline.configs.utils").bufremove()
end,
desc = "Close current buffer",
mode = "n",

View file

@ -51,7 +51,7 @@ if pcode.database then
{ "<leader>D", "", desc = " 󰆼 DBUI" },
{ "<leader>Dd", "<cmd>Alpha<cr><cmd>NvimTreeClose<cr><cmd>DBUI<cr>", desc = "󰆼 DBUI Open" },
{ "<leader>Dq",
"<cmd>DBUIClose<cr><cmd>BufferLineCloseOthers<cr><cmd>bd!<cr><cmd>lua require('user.utils.bufferline').bufremove()<cr><cmd>Alpha<cr>",
"<cmd>DBUIClose<cr><cmd>BufferLineCloseOthers<cr><cmd>bd!<cr><cmd>lua require('auto-bufferline.configs.utils').bufremove()<cr><cmd>Alpha<cr>",
desc = "󰅙 DBUI Close",
},
},

View file

@ -1,102 +1,44 @@
return {
{
"nvim-lualine/lualine.nvim",
"pojokcodeid/auto-lualine.nvim",
event = { "InsertEnter", "BufRead", "BufNewFile" },
dependencies = { "nvim-lualine/lualine.nvim" },
config = function()
local component = require("user.utils.lualine_component")
local colors = component.colors
-- check config for theme
local set_theme = "auto"
local bubbles_theme
local color = pcode.colorscheme
switch(color, {
["tokyonight"] = function()
set_theme = "auto"
end,
["tokyonight-night"] = function()
set_theme = "auto"
end,
["tokyonight-storm"] = function()
set_theme = "auto"
end,
["tokyonight-day"] = function()
set_theme = "auto"
end,
["tokyonight-moon"] = function()
set_theme = "auto"
end,
["dracula"] = function()
local clr = require("dracula").colors()
colors.blue = clr.green
colors.black = clr.black
colors.cyan = clr.yellow
set_theme = "bubbles_theme"
end,
["Eva-Dark"] = function()
colors.skyblue_1 = "#56B7C3"
colors.grey = "#3b4261"
colors.blue = "#98C379"
colors.cyan = "#B0B7C3"
colors.yellow = "#EF973A"
colors.green1 = "#6495EE"
colors.red = "#E06C75"
set_theme = "bubbles_theme"
end,
["Eva-Dark-Italic"] = function()
colors.skyblue_1 = "#598DEF"
colors.grey = "#3b4261"
colors.blue = "#98C379"
colors.cyan = "#B0B7C3"
colors.yellow = "#EF973A"
colors.green1 = "#56B7C3"
colors.red = "#E06C75"
set_theme = "bubbles_theme"
end,
["Eva-Dark-Bold"] = function()
colors.skyblue_1 = "#598DEF"
colors.grey = "#3b4261"
colors.blue = "#98C379"
colors.cyan = "#B0B7C3"
colors.yellow = "#EF973A"
colors.green1 = "#56B7C3"
colors.red = "#E06C75"
set_theme = "bubbles_theme"
end,
default = function()
set_theme = "auto"
end,
})
bubbles_theme = component.bubbles_theme(colors)
if set_theme == "auto" then
bubbles_theme = vim.fn.fnamemodify("auto", ":t")
end
local gettheme = require("user.utils.lualine_template")
local theme_option = pcode.lualinetheme or "rounded"
local theme = gettheme.rounded(bubbles_theme)
if theme_option == "rounded" then
theme = gettheme.rounded(bubbles_theme)
elseif theme_option == "roundedall" then
theme = gettheme.roundedall(bubbles_theme)
elseif theme_option == "square" then
theme = gettheme.square(bubbles_theme)
elseif theme_option == "transparent" then
theme = gettheme.square(component.transparent(colors))
elseif theme_option == "triangle" then
theme = gettheme.triangle(bubbles_theme)
elseif theme_option == "parallelogram" then
theme = gettheme.parallelogram(bubbles_theme)
elseif theme_option == "default" then
theme = {}
end
require("lualine").setup({
options = theme.options,
sections = theme.sections,
inactive_sections = theme.inactive_sections,
tabline = theme.tabline,
extensions = theme.extensions,
local lualine = require("auto-lualine")
-- tokyonight, tokyonight-night, tokyonight-storm, tokyonight-day, tokyonight-moon
-- gruvbox-baby (default)
-- sonokai, sonokai_atlantis,
-- sonokai_andromeda,sonokai_shusia,sonokai_maia,sonokai_espresso
-- material, material_deepocean, material_palenight, material_lighter, material_darker
-- onedark, onedark_vivid, onedark_dark
-- nord
-- catppuccin, catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha
-- dracula
-- nightfox, dayfox, dawnfox, duskfox, nordfox, terafox, carbonfox
-- github_dark, github_dark_default, github_dark_colorblind, github_dark_dimmed
-- solarized-osaka
-- darcula-dark
-- juliana
-- Eva-Dark, Eva-Dark-Italic, Eva-Dark-Bold
local color = pcode.colorscheme or "auto"
-- rounded
-- roundedall
-- square
-- triangle
-- parallelogram
-- transparent
-- default
local options = pcode.lualinetheme or "roundedall"
-- 0 = on full text mode info,
-- 1 = on initial mode + logo
-- 2 = logo only
-- 3 = initial only
-- 4 = off
local show_mode = pcode.show_mode or 0
lualine.setup({
setColor = color,
setOption = options,
setMode = show_mode,
})
end,
},