mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-23 01:08:53 +02:00
add: update config
This commit is contained in:
parent
99e49e4087
commit
83ef9398c8
5 changed files with 298 additions and 9 deletions
|
@ -23,7 +23,7 @@
|
||||||
"mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
|
"mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
|
||||||
"noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" },
|
"noice.nvim": { "branch": "main", "commit": "0cbe3f88d038320bdbda3c4c5c95f43a13c3aa12" },
|
||||||
"none-ls-extras.nvim": { "branch": "main", "commit": "f0746bf4f1a21d6e1d2002f671fb9b46d2146de7" },
|
"none-ls-extras.nvim": { "branch": "main", "commit": "f0746bf4f1a21d6e1d2002f671fb9b46d2146de7" },
|
||||||
"none-ls.nvim": { "branch": "main", "commit": "0d42ba8d506242b2252d2d2885a7f6f4f5b2bcb2" },
|
"none-ls.nvim": { "branch": "main", "commit": "dca7ddec321a102ec9e792b1b29193702aff5fbb" },
|
||||||
"nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" },
|
"nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" },
|
||||||
"nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" },
|
"nvim-autopairs": { "branch": "master", "commit": "4f41e5940bc0443fdbe5f995e2a596847215cd2a" },
|
||||||
"nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" },
|
"nvim-cmp": { "branch": "main", "commit": "ce16de5665c766f39c271705b17fff06f7bcb84f" },
|
||||||
|
|
|
@ -102,8 +102,16 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"hrsh7th/cmp-cmdline",
|
"hrsh7th/cmp-cmdline",
|
||||||
event = "VeryLazy",
|
-- event = "VeryLazy",
|
||||||
enabled = use_noice,
|
enabled = use_noice,
|
||||||
|
init = function()
|
||||||
|
-- load if mode command mode
|
||||||
|
vim.api.nvim_create_autocmd("CmdlineEnter", {
|
||||||
|
callback = function()
|
||||||
|
require("lazy").load({ plugins = { "cmp-cmdline" } })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end,
|
||||||
config = function()
|
config = function()
|
||||||
local cmp = require("cmp")
|
local cmp = require("cmp")
|
||||||
local mapping = {
|
local mapping = {
|
||||||
|
|
|
@ -118,7 +118,7 @@ return {
|
||||||
local mode = {
|
local mode = {
|
||||||
"mode",
|
"mode",
|
||||||
padding = 1,
|
padding = 1,
|
||||||
separator = { left = " " },
|
separator = { left = " " },
|
||||||
-- right_padding = 3,
|
-- right_padding = 3,
|
||||||
fmt = function(str)
|
fmt = function(str)
|
||||||
return icons.ui.Neovim .. " " .. str
|
return icons.ui.Neovim .. " " .. str
|
||||||
|
@ -198,7 +198,7 @@ return {
|
||||||
normal = {
|
normal = {
|
||||||
a = { fg = colors.black, bg = colors.skyblue_1 },
|
a = { fg = colors.black, bg = colors.skyblue_1 },
|
||||||
b = { fg = colors.white, bg = colors.grey },
|
b = { fg = colors.white, bg = colors.grey },
|
||||||
c = { fg = colors.white, bg = colors.black_transparant },
|
c = { fg = colors.white, bg = "#393f4a" },
|
||||||
},
|
},
|
||||||
|
|
||||||
insert = {
|
insert = {
|
||||||
|
@ -224,7 +224,7 @@ return {
|
||||||
inactive = {
|
inactive = {
|
||||||
a = { fg = colors.white, bg = colors.black_transparant },
|
a = { fg = colors.white, bg = colors.black_transparant },
|
||||||
b = { fg = colors.white, bg = colors.black_transparant },
|
b = { fg = colors.white, bg = colors.black_transparant },
|
||||||
c = { fg = colors.black, bg = colors.black_transparant },
|
c = { fg = colors.black, bg = "#393f4a" },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +237,7 @@ return {
|
||||||
theme = bubbles_theme,
|
theme = bubbles_theme,
|
||||||
-- theme = "auto",
|
-- theme = "auto",
|
||||||
component_separators = { left = "", right = "" },
|
component_separators = { left = "", right = "" },
|
||||||
section_separators = { left = "", right = "" },
|
section_separators = { left = "", right = "" },
|
||||||
disabled_filetypes = {
|
disabled_filetypes = {
|
||||||
"TelescopePrompt",
|
"TelescopePrompt",
|
||||||
"packer",
|
"packer",
|
||||||
|
@ -258,12 +258,12 @@ return {
|
||||||
lualine_a = {
|
lualine_a = {
|
||||||
mode,
|
mode,
|
||||||
},
|
},
|
||||||
lualine_b = { get_branch },
|
lualine_b = { "branch" },
|
||||||
lualine_c = { lsp_info, diagnostics, lsp_progress },
|
lualine_c = { lsp_info, diagnostics, lsp_progress },
|
||||||
lualine_x = { diff, spaces, "filetype" },
|
lualine_x = { diff, spaces, "filetype" },
|
||||||
lualine_y = { "progress" },
|
lualine_y = { "progress" },
|
||||||
lualine_z = {
|
lualine_z = {
|
||||||
{ "location", separator = { right = " " }, padding = 1 },
|
{ "location", separator = { right = " " }, padding = { left = 1, right = 1 } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
inactive_sections = {
|
inactive_sections = {
|
||||||
|
|
282
lua/custom/plugins/lualine_backup.lua
Normal file
282
lua/custom/plugins/lualine_backup.lua
Normal file
|
@ -0,0 +1,282 @@
|
||||||
|
return {
|
||||||
|
-- {
|
||||||
|
-- "nvim-lualine/lualine.nvim",
|
||||||
|
-- event = "BufWinEnter",
|
||||||
|
-- config = function()
|
||||||
|
-- local hide_in_width = function()
|
||||||
|
-- return vim.fn.winwidth(0) > 80
|
||||||
|
-- end
|
||||||
|
-- local icons = require("user.icons")
|
||||||
|
--
|
||||||
|
-- -- 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 " " .. vim.b.gitsigns_head
|
||||||
|
-- else
|
||||||
|
-- return "" .. 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,
|
||||||
|
-- },
|
||||||
|
}
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
local opts, _ = pcall(require, "user.options")
|
local opts, _ = pcall(require, "user.options")
|
||||||
if opts then
|
if opts then
|
||||||
require("user.options")
|
require("user.options")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue