mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-23 17:28:50 +02:00
add: update config
This commit is contained in:
parent
697454eecf
commit
a2b9217202
4 changed files with 541 additions and 297 deletions
|
@ -16,7 +16,7 @@
|
|||
"github-nvim-theme": { "branch": "main", "commit": "66dcec1bd3d12f8b0bf3c885069888551a650049" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "76927d14d3fbd4ba06ccb5246e79d93b5442c188" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "758bb5de98b805acc5eeed8cdc8ac7f0bc4b0b86" },
|
||||
"lsp-progress.nvim": { "branch": "main", "commit": "0d45f17f681c2e664238a1f6c02865760692609d" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "9ae570e206360e47d30b4c35a4550c165f4ea7b7" },
|
||||
|
@ -28,7 +28,7 @@
|
|||
"none-ls.nvim": { "branch": "main", "commit": "f5632db2491fbe02b54f1a321a98548a8ba2bd15" },
|
||||
"nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "14e97371b2aab6ee70054c1070a123dfaa3e217e" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "cd2cf0c124d3de577fb5449746568ee8e601afc8" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "24122371810089d390847d8ba66325c1f1aa64c0" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "85855b38011114929f4058efc97af1059ab3e41d" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "cf3dd4a290084a868fac0e2e876039321d57111c" },
|
||||
"nvim-material-icon": { "branch": "main", "commit": "7a8893417c6947925d00946d16b81b56574796a9" },
|
||||
|
@ -46,7 +46,7 @@
|
|||
"promise-async": { "branch": "main", "commit": "38a4575da9497326badd3995e768b4ccf0bb153e" },
|
||||
"smart-splits.nvim": { "branch": "master", "commit": "2179ec0d26aacd4f40c766c79f6ebc83b7001e48" },
|
||||
"statuscol.nvim": { "branch": "main", "commit": "483b9a596dfd63d541db1aa51ee6ee9a1441c4cc" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "fac83a556e7b710dc31433dec727361ca062dbe9" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "02a60a83961cf9c80e471599171982a31d1cc853" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "066cccf48a43553a80a210eb3be89a15d789d6e6" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "e522e0dd742a83506db0a72e1ced68c9c130f185" },
|
||||
"vim-startuptime": { "branch": "master", "commit": "97a88e688482a09c3c4b777d07b509b328a5ec29" },
|
||||
|
|
|
@ -8,7 +8,7 @@ return {
|
|||
lazy = false, -- make sure we load this during startup if it is your main colorscheme
|
||||
priority = 1000, -- make sure to load this before all the other start plugins
|
||||
config = function()
|
||||
local is_transparent = false
|
||||
local is_transparent = true
|
||||
local palette = require("github-theme.palette").load("github_dark_dimmed")
|
||||
require("github-theme").setup({
|
||||
options = {
|
||||
|
@ -70,8 +70,15 @@ return {
|
|||
-- ["@operator.html"] = { fg = "#faa356" },
|
||||
-- ["@tag.html"] = { fg = "#fa7970" },
|
||||
-- ["@tag.delimiter.html"] = { fg = "#faa356" },
|
||||
["@tag.javascript"] = { fg = "#faa356" },
|
||||
["@tag.tsx"] = { fg = "#faa356" },
|
||||
-- ["@tag.javascript"] = { fg = "#faa356" },
|
||||
-- ["@tag.javascript"] = { fg = "#8ddb8c" },
|
||||
-- ["@tag.tsx"] = { fg = "#8ddb8c" },
|
||||
-- ["@tag.delimiter.javascript"] = { fg = "fg1" },
|
||||
-- ["@tag.tsx"] = { fg = "#faa356" },
|
||||
["@lsp.type.parameter"] = { fg = "#faa356" },
|
||||
["@property.lua"] = { fg = "#91cbff", bg = is_transparent and "NONE" or "bg1" },
|
||||
["@lsp.type.property.lua"] = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" },
|
||||
["@lsp.type.variable.lua"] = { fg = "#91cbff", bg = is_transparent and "NONE" or "bg1" },
|
||||
},
|
||||
github_dark_high_contrast = {
|
||||
NvimTreeSpecialFile = { fg = "#faa356", style = "italic" },
|
||||
|
@ -94,9 +101,6 @@ return {
|
|||
NormalSB = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" }, -- normal text
|
||||
NormalFloat = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" },
|
||||
IblIndent = { fg = "#3E4450" },
|
||||
["@property.lua"] = { fg = "#91cbff", bg = is_transparent and "NONE" or "bg1" },
|
||||
["@lsp.type.property.lua"] = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" },
|
||||
["@lsp.type.variable.lua"] = { fg = "#91cbff", bg = is_transparent and "NONE" or "bg1" },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
@ -1,290 +1,290 @@
|
|||
return {
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
local hide_in_width = function()
|
||||
return vim.fn.winwidth(0) > 80
|
||||
end
|
||||
local icons = require("user.icons")
|
||||
|
||||
local getLeftSubstring = function(word, length)
|
||||
if #word > length then
|
||||
return string.sub(word, 1, length) .. "..."
|
||||
else
|
||||
return word
|
||||
end
|
||||
end
|
||||
|
||||
-- start for lsp
|
||||
local list_registered_providers_names = function(filetype)
|
||||
local s = require("null-ls.sources")
|
||||
local available_sources = s.get_available(filetype)
|
||||
local registered = {}
|
||||
for _, source in ipairs(available_sources) do
|
||||
for method in pairs(source.methods) do
|
||||
registered[method] = registered[method] or {}
|
||||
table.insert(registered[method], source.name)
|
||||
end
|
||||
end
|
||||
return registered
|
||||
end
|
||||
|
||||
local null_ls = require("null-ls")
|
||||
-- for formatter
|
||||
local list_registered = function(filetype)
|
||||
local method = null_ls.methods.FORMATTING
|
||||
local registered_providers = list_registered_providers_names(filetype)
|
||||
return registered_providers[method] or {}
|
||||
end
|
||||
|
||||
--- for linter
|
||||
local alternative_methods = {
|
||||
null_ls.methods.DIAGNOSTICS,
|
||||
null_ls.methods.DIAGNOSTICS_ON_OPEN,
|
||||
null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||
}
|
||||
|
||||
local linter_list_registered = function(filetype)
|
||||
local registered_providers = list_registered_providers_names(filetype)
|
||||
local providers_for_methods = vim.tbl_flatten(vim.tbl_map(function(m)
|
||||
return registered_providers[m] or {}
|
||||
end, alternative_methods))
|
||||
|
||||
return providers_for_methods
|
||||
end
|
||||
-- end for lsp
|
||||
|
||||
local lsp_info = {
|
||||
function()
|
||||
local msg = "LS Inactive"
|
||||
local buf_ft = vim.bo.filetype
|
||||
local clients = vim.lsp.get_active_clients()
|
||||
-- start register
|
||||
local buf_clients = vim.lsp.buf_get_clients()
|
||||
local buf_client_names = {}
|
||||
if next(buf_clients) == nil then
|
||||
-- TODO: clean up this if statement
|
||||
if type(msg) == "boolean" or #msg == 0 then
|
||||
return "LS Inactive"
|
||||
end
|
||||
return msg
|
||||
end
|
||||
-- add client
|
||||
for _, client in pairs(buf_clients) do
|
||||
if client.name ~= "null-ls" and client.name ~= "copilot" then
|
||||
table.insert(buf_client_names, client.name)
|
||||
end
|
||||
end
|
||||
-- add formatter
|
||||
local supported_formatters = list_registered(buf_ft)
|
||||
vim.list_extend(buf_client_names, supported_formatters)
|
||||
-- add linter
|
||||
local supported_linters = linter_list_registered(buf_ft)
|
||||
vim.list_extend(buf_client_names, supported_linters)
|
||||
-- decomple
|
||||
local unique_client_names = vim.fn.uniq(buf_client_names)
|
||||
local msg = table.concat(unique_client_names, ", ")
|
||||
return msg
|
||||
end,
|
||||
--icon = " ",
|
||||
icon = icons.ui.Gear .. "",
|
||||
padding = 1,
|
||||
}
|
||||
|
||||
local diagnostics = {
|
||||
"diagnostics",
|
||||
sources = { "nvim_diagnostic" },
|
||||
sections = { "error", "warn" },
|
||||
-- symbols = { error = " ", warn = " " },
|
||||
symbols = {
|
||||
error = icons.diagnostics.BoldError .. " ",
|
||||
warn = icons.diagnostics.BoldWarning .. " ",
|
||||
},
|
||||
colored = true,
|
||||
update_in_insert = false,
|
||||
always_visible = false,
|
||||
}
|
||||
|
||||
local diff = {
|
||||
"diff",
|
||||
colored = true,
|
||||
-- symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
|
||||
symbols = {
|
||||
added = icons.git.LineAdded .. " ",
|
||||
modified = icons.git.LineModified .. " ",
|
||||
removed = icons.git.LineRemoved .. " ",
|
||||
}, -- changes diff symbols
|
||||
cond = hide_in_width,
|
||||
}
|
||||
|
||||
local spaces = function()
|
||||
-- return " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||
return icons.ui.Tab .. " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||
end
|
||||
|
||||
local mode = {
|
||||
"mode",
|
||||
padding = 1,
|
||||
separator = { left = " " },
|
||||
-- right_padding = 3,
|
||||
fmt = function(str)
|
||||
return icons.ui.Neovim .. " " .. str
|
||||
end,
|
||||
}
|
||||
local branch = {
|
||||
"branch",
|
||||
padding = 1,
|
||||
}
|
||||
|
||||
local get_branch = function()
|
||||
if vim.b.gitsigns_head ~= nil then
|
||||
return icons.git.Branch2 .. " " .. getLeftSubstring(vim.b.gitsigns_head, 6)
|
||||
else
|
||||
return icons.git.Branch2 .. vim.fn.fnamemodify("", ":t")
|
||||
end
|
||||
end
|
||||
|
||||
local lsp_progress = {}
|
||||
local data_ok, lspprogress = pcall(require, "lsp-progress")
|
||||
if data_ok then
|
||||
lsp_progress = lspprogress.progress
|
||||
end
|
||||
-- stylua: ignore
|
||||
local colors = {
|
||||
blue = '#50fa7b',
|
||||
cyan = '#f1fa8c',
|
||||
black = '#1a1b26',
|
||||
black_transparant = 'none',
|
||||
white = '#c6c6c6',
|
||||
red = "#ff757f",
|
||||
skyblue_1 = '#bd93f9',
|
||||
grey = '#5f6a8e',
|
||||
yellow = "#ffb86c",
|
||||
fg_gutter = "#3b4261",
|
||||
green1 = "#bd93f9",
|
||||
}
|
||||
|
||||
-- check config for theme
|
||||
local set_theme
|
||||
local bubbles_theme = {}
|
||||
local data_exists, config = pcall(require, "core.config")
|
||||
if data_exists then
|
||||
if config.colorscheme ~= nil then
|
||||
local color = config.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,
|
||||
default = function()
|
||||
set_theme = "auto"
|
||||
end,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
bubbles_theme = {
|
||||
normal = {
|
||||
a = { fg = colors.black, bg = colors.skyblue_1 },
|
||||
b = { fg = colors.white, bg = colors.grey },
|
||||
c = { fg = colors.white, bg = colors.black_transparant },
|
||||
},
|
||||
|
||||
insert = {
|
||||
a = { fg = colors.black, bg = colors.blue },
|
||||
b = { fg = colors.blue, bg = colors.grey },
|
||||
},
|
||||
visual = {
|
||||
a = { fg = colors.black, bg = colors.cyan },
|
||||
b = { fg = colors.cyan, bg = colors.grey },
|
||||
},
|
||||
replace = {
|
||||
a = { bg = colors.red, fg = colors.black },
|
||||
b = { bg = colors.fg_gutter, fg = colors.red },
|
||||
},
|
||||
command = {
|
||||
a = { bg = colors.yellow, fg = colors.black },
|
||||
b = { bg = colors.fg_gutter, fg = colors.yellow },
|
||||
},
|
||||
terminal = {
|
||||
a = { bg = colors.green1, fg = colors.black },
|
||||
b = { bg = colors.fg_gutter, fg = colors.green1 },
|
||||
},
|
||||
inactive = {
|
||||
a = { fg = colors.white, bg = colors.black_transparant },
|
||||
b = { fg = colors.white, bg = colors.black_transparant },
|
||||
c = { fg = colors.black, bg = colors.black_transparant },
|
||||
},
|
||||
}
|
||||
|
||||
if set_theme == "auto" then
|
||||
bubbles_theme = vim.fn.fnamemodify("auto", ":t")
|
||||
end
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = bubbles_theme,
|
||||
-- theme = "auto",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
"TelescopePrompt",
|
||||
"packer",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"NvimTree",
|
||||
"Outline",
|
||||
"DressingInput",
|
||||
"toggleterm",
|
||||
"lazy",
|
||||
"mason",
|
||||
"neo-tree",
|
||||
"startuptime",
|
||||
},
|
||||
always_divide_middle = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {
|
||||
mode,
|
||||
},
|
||||
lualine_b = { get_branch },
|
||||
lualine_c = { lsp_info, diagnostics, lsp_progress },
|
||||
lualine_x = { diff, spaces, "filetype" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = {
|
||||
{ "location", separator = { right = " " }, padding = 1 },
|
||||
},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = { "filename" },
|
||||
lualine_b = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
})
|
||||
end,
|
||||
},
|
||||
-- {
|
||||
-- "nvim-lualine/lualine.nvim",
|
||||
-- event = "InsertEnter",
|
||||
-- config = function()
|
||||
-- local hide_in_width = function()
|
||||
-- return vim.fn.winwidth(0) > 80
|
||||
-- end
|
||||
-- local icons = require("user.icons")
|
||||
--
|
||||
-- local getLeftSubstring = function(word, length)
|
||||
-- if #word > length then
|
||||
-- return string.sub(word, 1, length) .. "..."
|
||||
-- else
|
||||
-- return word
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- -- start for lsp
|
||||
-- local list_registered_providers_names = function(filetype)
|
||||
-- local s = require("null-ls.sources")
|
||||
-- local available_sources = s.get_available(filetype)
|
||||
-- local registered = {}
|
||||
-- for _, source in ipairs(available_sources) do
|
||||
-- for method in pairs(source.methods) do
|
||||
-- registered[method] = registered[method] or {}
|
||||
-- table.insert(registered[method], source.name)
|
||||
-- end
|
||||
-- end
|
||||
-- return registered
|
||||
-- end
|
||||
--
|
||||
-- local null_ls = require("null-ls")
|
||||
-- -- for formatter
|
||||
-- local list_registered = function(filetype)
|
||||
-- local method = null_ls.methods.FORMATTING
|
||||
-- local registered_providers = list_registered_providers_names(filetype)
|
||||
-- return registered_providers[method] or {}
|
||||
-- end
|
||||
--
|
||||
-- --- for linter
|
||||
-- local alternative_methods = {
|
||||
-- null_ls.methods.DIAGNOSTICS,
|
||||
-- null_ls.methods.DIAGNOSTICS_ON_OPEN,
|
||||
-- null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||
-- }
|
||||
--
|
||||
-- local linter_list_registered = function(filetype)
|
||||
-- local registered_providers = list_registered_providers_names(filetype)
|
||||
-- local providers_for_methods = vim.tbl_flatten(vim.tbl_map(function(m)
|
||||
-- return registered_providers[m] or {}
|
||||
-- end, alternative_methods))
|
||||
--
|
||||
-- return providers_for_methods
|
||||
-- end
|
||||
-- -- end for lsp
|
||||
--
|
||||
-- local lsp_info = {
|
||||
-- function()
|
||||
-- local msg = "LS Inactive"
|
||||
-- local buf_ft = vim.bo.filetype
|
||||
-- local clients = vim.lsp.get_active_clients()
|
||||
-- -- start register
|
||||
-- local buf_clients = vim.lsp.buf_get_clients()
|
||||
-- local buf_client_names = {}
|
||||
-- if next(buf_clients) == nil then
|
||||
-- -- TODO: clean up this if statement
|
||||
-- if type(msg) == "boolean" or #msg == 0 then
|
||||
-- return "LS Inactive"
|
||||
-- end
|
||||
-- return msg
|
||||
-- end
|
||||
-- -- add client
|
||||
-- for _, client in pairs(buf_clients) do
|
||||
-- if client.name ~= "null-ls" and client.name ~= "copilot" then
|
||||
-- table.insert(buf_client_names, client.name)
|
||||
-- end
|
||||
-- end
|
||||
-- -- add formatter
|
||||
-- local supported_formatters = list_registered(buf_ft)
|
||||
-- vim.list_extend(buf_client_names, supported_formatters)
|
||||
-- -- add linter
|
||||
-- local supported_linters = linter_list_registered(buf_ft)
|
||||
-- vim.list_extend(buf_client_names, supported_linters)
|
||||
-- -- decomple
|
||||
-- local unique_client_names = vim.fn.uniq(buf_client_names)
|
||||
-- local msg = table.concat(unique_client_names, ", ")
|
||||
-- return msg
|
||||
-- end,
|
||||
-- --icon = " ",
|
||||
-- icon = icons.ui.Gear .. "",
|
||||
-- padding = 1,
|
||||
-- }
|
||||
--
|
||||
-- local diagnostics = {
|
||||
-- "diagnostics",
|
||||
-- sources = { "nvim_diagnostic" },
|
||||
-- sections = { "error", "warn" },
|
||||
-- -- symbols = { error = " ", warn = " " },
|
||||
-- symbols = {
|
||||
-- error = icons.diagnostics.BoldError .. " ",
|
||||
-- warn = icons.diagnostics.BoldWarning .. " ",
|
||||
-- },
|
||||
-- colored = true,
|
||||
-- update_in_insert = false,
|
||||
-- always_visible = false,
|
||||
-- }
|
||||
--
|
||||
-- local diff = {
|
||||
-- "diff",
|
||||
-- colored = true,
|
||||
-- -- symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
|
||||
-- symbols = {
|
||||
-- added = icons.git.LineAdded .. " ",
|
||||
-- modified = icons.git.LineModified .. " ",
|
||||
-- removed = icons.git.LineRemoved .. " ",
|
||||
-- }, -- changes diff symbols
|
||||
-- cond = hide_in_width,
|
||||
-- }
|
||||
--
|
||||
-- local spaces = function()
|
||||
-- -- return " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||
-- return icons.ui.Tab .. " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||
-- end
|
||||
--
|
||||
-- local mode = {
|
||||
-- "mode",
|
||||
-- padding = 1,
|
||||
-- separator = { left = " " },
|
||||
-- -- right_padding = 3,
|
||||
-- fmt = function(str)
|
||||
-- return icons.ui.Neovim .. " " .. str
|
||||
-- end,
|
||||
-- }
|
||||
-- local branch = {
|
||||
-- "branch",
|
||||
-- padding = 1,
|
||||
-- }
|
||||
--
|
||||
-- local get_branch = function()
|
||||
-- if vim.b.gitsigns_head ~= nil then
|
||||
-- return icons.git.Branch2 .. " " .. getLeftSubstring(vim.b.gitsigns_head, 6)
|
||||
-- else
|
||||
-- return icons.git.Branch2 .. vim.fn.fnamemodify("", ":t")
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- local lsp_progress = {}
|
||||
-- local data_ok, lspprogress = pcall(require, "lsp-progress")
|
||||
-- if data_ok then
|
||||
-- lsp_progress = lspprogress.progress
|
||||
-- end
|
||||
-- -- stylua: ignore
|
||||
-- local colors = {
|
||||
-- blue = '#50fa7b',
|
||||
-- cyan = '#f1fa8c',
|
||||
-- black = '#1a1b26',
|
||||
-- black_transparant = 'none',
|
||||
-- white = '#c6c6c6',
|
||||
-- red = "#ff757f",
|
||||
-- skyblue_1 = '#bd93f9',
|
||||
-- grey = '#5f6a8e',
|
||||
-- yellow = "#ffb86c",
|
||||
-- fg_gutter = "#3b4261",
|
||||
-- green1 = "#bd93f9",
|
||||
-- }
|
||||
--
|
||||
-- -- check config for theme
|
||||
-- local set_theme
|
||||
-- local bubbles_theme = {}
|
||||
-- local data_exists, config = pcall(require, "core.config")
|
||||
-- if data_exists then
|
||||
-- if config.colorscheme ~= nil then
|
||||
-- local color = config.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,
|
||||
-- default = function()
|
||||
-- set_theme = "auto"
|
||||
-- end,
|
||||
-- })
|
||||
-- end
|
||||
-- end
|
||||
--
|
||||
-- bubbles_theme = {
|
||||
-- normal = {
|
||||
-- a = { fg = colors.black, bg = colors.skyblue_1 },
|
||||
-- b = { fg = colors.white, bg = colors.grey },
|
||||
-- c = { fg = colors.white, bg = colors.black_transparant },
|
||||
-- },
|
||||
--
|
||||
-- insert = {
|
||||
-- a = { fg = colors.black, bg = colors.blue },
|
||||
-- b = { fg = colors.blue, bg = colors.grey },
|
||||
-- },
|
||||
-- visual = {
|
||||
-- a = { fg = colors.black, bg = colors.cyan },
|
||||
-- b = { fg = colors.cyan, bg = colors.grey },
|
||||
-- },
|
||||
-- replace = {
|
||||
-- a = { bg = colors.red, fg = colors.black },
|
||||
-- b = { bg = colors.fg_gutter, fg = colors.red },
|
||||
-- },
|
||||
-- command = {
|
||||
-- a = { bg = colors.yellow, fg = colors.black },
|
||||
-- b = { bg = colors.fg_gutter, fg = colors.yellow },
|
||||
-- },
|
||||
-- terminal = {
|
||||
-- a = { bg = colors.green1, fg = colors.black },
|
||||
-- b = { bg = colors.fg_gutter, fg = colors.green1 },
|
||||
-- },
|
||||
-- inactive = {
|
||||
-- a = { fg = colors.white, bg = colors.black_transparant },
|
||||
-- b = { fg = colors.white, bg = colors.black_transparant },
|
||||
-- c = { fg = colors.black, bg = colors.black_transparant },
|
||||
-- },
|
||||
-- }
|
||||
--
|
||||
-- if set_theme == "auto" then
|
||||
-- bubbles_theme = vim.fn.fnamemodify("auto", ":t")
|
||||
-- end
|
||||
--
|
||||
-- require("lualine").setup({
|
||||
-- options = {
|
||||
-- theme = bubbles_theme,
|
||||
-- -- theme = "auto",
|
||||
-- component_separators = { left = "", right = "" },
|
||||
-- section_separators = { left = "", right = "" },
|
||||
-- disabled_filetypes = {
|
||||
-- "TelescopePrompt",
|
||||
-- "packer",
|
||||
-- "alpha",
|
||||
-- "dashboard",
|
||||
-- "NvimTree",
|
||||
-- "Outline",
|
||||
-- "DressingInput",
|
||||
-- "toggleterm",
|
||||
-- "lazy",
|
||||
-- "mason",
|
||||
-- "neo-tree",
|
||||
-- "startuptime",
|
||||
-- },
|
||||
-- always_divide_middle = true,
|
||||
-- },
|
||||
-- sections = {
|
||||
-- lualine_a = {
|
||||
-- mode,
|
||||
-- },
|
||||
-- lualine_b = { get_branch },
|
||||
-- lualine_c = { lsp_info, diagnostics, lsp_progress },
|
||||
-- lualine_x = { diff, spaces, "filetype" },
|
||||
-- lualine_y = { "progress" },
|
||||
-- lualine_z = {
|
||||
-- { "location", separator = { right = " " }, padding = 1 },
|
||||
-- },
|
||||
-- },
|
||||
-- inactive_sections = {
|
||||
-- lualine_a = { "filename" },
|
||||
-- lualine_b = {},
|
||||
-- lualine_c = {},
|
||||
-- lualine_x = {},
|
||||
-- lualine_y = {},
|
||||
-- lualine_z = { "location" },
|
||||
-- },
|
||||
-- tabline = {},
|
||||
-- extensions = {},
|
||||
-- })
|
||||
-- end,
|
||||
-- },
|
||||
}
|
||||
|
|
240
lua/custom/plugins/lualine_github.lua
Normal file
240
lua/custom/plugins/lualine_github.lua
Normal file
|
@ -0,0 +1,240 @@
|
|||
return {
|
||||
{
|
||||
"nvim-lualine/lualine.nvim",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
local hide_in_width = function()
|
||||
return vim.fn.winwidth(0) > 80
|
||||
end
|
||||
local icons = require("user.icons")
|
||||
|
||||
local getLeftSubstring = function(word, length)
|
||||
if #word > length then
|
||||
return string.sub(word, 1, length) .. "..."
|
||||
else
|
||||
return word
|
||||
end
|
||||
end
|
||||
|
||||
-- start for lsp
|
||||
local list_registered_providers_names = function(filetype)
|
||||
local s = require("null-ls.sources")
|
||||
local available_sources = s.get_available(filetype)
|
||||
local registered = {}
|
||||
for _, source in ipairs(available_sources) do
|
||||
for method in pairs(source.methods) do
|
||||
registered[method] = registered[method] or {}
|
||||
table.insert(registered[method], source.name)
|
||||
end
|
||||
end
|
||||
return registered
|
||||
end
|
||||
|
||||
local null_ls = require("null-ls")
|
||||
-- for formatter
|
||||
local list_registered = function(filetype)
|
||||
local method = null_ls.methods.FORMATTING
|
||||
local registered_providers = list_registered_providers_names(filetype)
|
||||
return registered_providers[method] or {}
|
||||
end
|
||||
|
||||
--- for linter
|
||||
local alternative_methods = {
|
||||
null_ls.methods.DIAGNOSTICS,
|
||||
null_ls.methods.DIAGNOSTICS_ON_OPEN,
|
||||
null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||
}
|
||||
|
||||
local linter_list_registered = function(filetype)
|
||||
local registered_providers = list_registered_providers_names(filetype)
|
||||
local providers_for_methods = vim.tbl_flatten(vim.tbl_map(function(m)
|
||||
return registered_providers[m] or {}
|
||||
end, alternative_methods))
|
||||
|
||||
return providers_for_methods
|
||||
end
|
||||
-- end for lsp
|
||||
|
||||
local lsp_info = {
|
||||
function()
|
||||
local msg = "LS Inactive"
|
||||
local buf_ft = vim.bo.filetype
|
||||
local clients = vim.lsp.get_active_clients()
|
||||
-- start register
|
||||
local buf_clients = vim.lsp.buf_get_clients()
|
||||
local buf_client_names = {}
|
||||
if next(buf_clients) == nil then
|
||||
-- TODO: clean up this if statement
|
||||
if type(msg) == "boolean" or #msg == 0 then
|
||||
return "LS Inactive"
|
||||
end
|
||||
return msg
|
||||
end
|
||||
-- add client
|
||||
for _, client in pairs(buf_clients) do
|
||||
if client.name ~= "null-ls" and client.name ~= "copilot" then
|
||||
table.insert(buf_client_names, client.name)
|
||||
end
|
||||
end
|
||||
-- add formatter
|
||||
local supported_formatters = list_registered(buf_ft)
|
||||
vim.list_extend(buf_client_names, supported_formatters)
|
||||
-- add linter
|
||||
local supported_linters = linter_list_registered(buf_ft)
|
||||
vim.list_extend(buf_client_names, supported_linters)
|
||||
-- decomple
|
||||
local unique_client_names = vim.fn.uniq(buf_client_names)
|
||||
local msg = table.concat(unique_client_names, ", ")
|
||||
return msg
|
||||
end,
|
||||
--icon = " ",
|
||||
icon = icons.ui.Gear .. "",
|
||||
padding = 1,
|
||||
}
|
||||
|
||||
local diagnostics = {
|
||||
"diagnostics",
|
||||
sources = { "nvim_diagnostic" },
|
||||
sections = { "error", "warn" },
|
||||
-- symbols = { error = " ", warn = " " },
|
||||
symbols = {
|
||||
error = icons.diagnostics.BoldError .. " ",
|
||||
warn = icons.diagnostics.BoldWarning .. " ",
|
||||
},
|
||||
colored = true,
|
||||
update_in_insert = false,
|
||||
always_visible = false,
|
||||
}
|
||||
|
||||
local diff = {
|
||||
"diff",
|
||||
colored = true,
|
||||
-- symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
|
||||
symbols = {
|
||||
added = icons.git.LineAdded .. " ",
|
||||
modified = icons.git.LineModified .. " ",
|
||||
removed = icons.git.LineRemoved .. " ",
|
||||
}, -- changes diff symbols
|
||||
cond = hide_in_width,
|
||||
}
|
||||
|
||||
local spaces = function()
|
||||
-- return " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||
return icons.ui.Tab .. " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||
end
|
||||
|
||||
local mode = {
|
||||
"mode",
|
||||
padding = 1,
|
||||
separator = { left = " " },
|
||||
-- right_padding = 3,
|
||||
fmt = function(str)
|
||||
return icons.ui.Neovim .. " " .. str
|
||||
end,
|
||||
}
|
||||
local branch = {
|
||||
"branch",
|
||||
padding = 1,
|
||||
}
|
||||
|
||||
local get_branch = function()
|
||||
if vim.b.gitsigns_head ~= nil then
|
||||
return icons.git.Branch2 .. " " .. getLeftSubstring(vim.b.gitsigns_head, 6)
|
||||
else
|
||||
return icons.git.Branch2 .. vim.fn.fnamemodify("", ":t")
|
||||
end
|
||||
end
|
||||
|
||||
local lsp_progress = {}
|
||||
local data_ok, lspprogress = pcall(require, "lsp-progress")
|
||||
if data_ok then
|
||||
lsp_progress = lspprogress.progress
|
||||
end
|
||||
-- stylua: ignore
|
||||
local github=vim.fn.fnamemodify("auto", ":t")
|
||||
local status_ok, _ = pcall(require, "github-theme")
|
||||
if status_ok then
|
||||
local C = require("github-theme.lib.color")
|
||||
local config = require("github-theme.config").options
|
||||
local s = require("github-theme.spec").load("github_dark_dimmed")
|
||||
local p = s.palette
|
||||
local tbg = config.transparent and "NONE" or s.bg0
|
||||
|
||||
local function blend(color, a)
|
||||
return C(s.bg1):blend(C(color), a):to_css()
|
||||
end
|
||||
|
||||
--- Create lualine group colors for github-theme
|
||||
---@param color string
|
||||
local tint = function(color)
|
||||
return {
|
||||
a = { bg = color, fg = s.bg1 },
|
||||
b = { bg = blend(color, 0.2), fg = blend(color, 0.8) },
|
||||
c = { bg = "NONE", fg = blend(color, 0.60) },
|
||||
}
|
||||
end
|
||||
|
||||
local inactive_hi = { bg = tbg, fg = blend(s.fg1, 0.3) }
|
||||
github = {
|
||||
normal = tint(p.blue.base),
|
||||
insert = tint(p.green.base),
|
||||
command = tint(p.magenta.bright),
|
||||
visual = tint(p.yellow.base),
|
||||
replace = tint(p.red.base),
|
||||
terminal = tint(p.orange),
|
||||
inactive = {
|
||||
a = inactive_hi,
|
||||
b = inactive_hi,
|
||||
c = inactive_hi,
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
theme = github,
|
||||
-- theme = "auto",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
"TelescopePrompt",
|
||||
"packer",
|
||||
"alpha",
|
||||
"dashboard",
|
||||
"NvimTree",
|
||||
"Outline",
|
||||
"DressingInput",
|
||||
"toggleterm",
|
||||
"lazy",
|
||||
"mason",
|
||||
"neo-tree",
|
||||
"startuptime",
|
||||
},
|
||||
always_divide_middle = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {
|
||||
mode,
|
||||
},
|
||||
lualine_b = { get_branch },
|
||||
lualine_c = { lsp_info, diagnostics, lsp_progress },
|
||||
lualine_x = { diff, spaces, "filetype" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = {
|
||||
{ "location", separator = { right = " " }, padding = 1 },
|
||||
},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = { "filename" },
|
||||
lualine_b = {},
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = { "location" },
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue