mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-22 08:53:31 +02:00
Merge branch 'v2' into main
This commit is contained in:
commit
354b276c72
16 changed files with 2947 additions and 1036 deletions
|
@ -6,7 +6,7 @@ require("user.keymaps")
|
||||||
-- require("user.snip")
|
-- require("user.snip")
|
||||||
-- require("core.neovide")
|
-- require("core.neovide")
|
||||||
require("custom.autocmd")
|
require("custom.autocmd")
|
||||||
-- require("custom.keymaps")
|
require("custom.keymaps")
|
||||||
-- require("user.nvim-tree")
|
-- require("user.nvim-tree")
|
||||||
-- require("user.options")
|
-- require("user.options")
|
||||||
-- require("user.keymaps")
|
-- require("user.keymaps")
|
||||||
|
|
|
@ -47,3 +47,21 @@ vim.g.VM_Extend_hl = "DiffAdd"
|
||||||
-- vim.g.VM_Cursor_hl = "Visual"
|
-- vim.g.VM_Cursor_hl = "Visual"
|
||||||
vim.g.VM_Cursor_hl = "DiffText"
|
vim.g.VM_Cursor_hl = "DiffText"
|
||||||
vim.g.VM_Insert_hl = "DiffChange"
|
vim.g.VM_Insert_hl = "DiffChange"
|
||||||
|
|
||||||
|
-- NvimTree automatically resize the floating window when neovim's window size changes
|
||||||
|
-- local tree_api = require("nvim-tree")
|
||||||
|
-- local tree_view = require("nvim-tree.view")
|
||||||
|
--
|
||||||
|
-- vim.api.nvim_create_augroup("NvimTreeResize", {
|
||||||
|
-- clear = true,
|
||||||
|
-- })
|
||||||
|
--
|
||||||
|
-- vim.api.nvim_create_autocmd({ "VimResized" }, {
|
||||||
|
-- group = "NvimTreeResize",
|
||||||
|
-- callback = function()
|
||||||
|
-- if tree_view.is_visible() then
|
||||||
|
-- tree_view.close()
|
||||||
|
-- tree_api.open()
|
||||||
|
-- end
|
||||||
|
-- end,
|
||||||
|
-- })
|
||||||
|
|
|
@ -2,3 +2,4 @@ local opts = { noremap = true, silent = true }
|
||||||
local keymap = vim.api.nvim_set_keymap
|
local keymap = vim.api.nvim_set_keymap
|
||||||
|
|
||||||
keymap("n", "]h", '<cmd>lua print("Testing")<cr>', opts)
|
keymap("n", "]h", '<cmd>lua print("Testing")<cr>', opts)
|
||||||
|
keymap("n", "f", "<cmd>NvimTreeFindFileToggle<cr><cr><Up>", opts)
|
||||||
|
|
|
@ -65,10 +65,13 @@ return {
|
||||||
-- IlluminatedWordWrite = { bg = "#3b4261" },
|
-- IlluminatedWordWrite = { bg = "#3b4261" },
|
||||||
-- ["@tag.attribute"] = { fg = "#77bdfb", style = "italic" },
|
-- ["@tag.attribute"] = { fg = "#77bdfb", style = "italic" },
|
||||||
-- ["@text.uri"] = { fg = palette.const, style = "italic" },
|
-- ["@text.uri"] = { fg = palette.const, style = "italic" },
|
||||||
|
-- ["@keyword.return"] = { fg = "#fa7970", style = "italic" },
|
||||||
-- -- ["@tag.attribute.html"] = { fg = "#faa356", style = "italic" },
|
-- -- ["@tag.attribute.html"] = { fg = "#faa356", style = "italic" },
|
||||||
-- -- ["@operator.html"] = { fg = "#faa356" },
|
-- -- ["@operator.html"] = { fg = "#faa356" },
|
||||||
-- -- ["@tag.html"] = { fg = "#fa7970" },
|
-- -- ["@tag.html"] = { fg = "#fa7970" },
|
||||||
-- -- ["@tag.delimiter.html"] = { fg = "#faa356" },
|
-- -- ["@tag.delimiter.html"] = { fg = "#faa356" },
|
||||||
|
-- ["@tag.javascript"] = { fg = "#faa356" },
|
||||||
|
-- ["@tag.tsx"] = { fg = "#faa356" },
|
||||||
-- },
|
-- },
|
||||||
-- github_dark_high_contrast = {
|
-- github_dark_high_contrast = {
|
||||||
-- NvimTreeSpecialFile = { fg = "#faa356", style = "italic" },
|
-- NvimTreeSpecialFile = { fg = "#faa356", style = "italic" },
|
||||||
|
@ -77,6 +80,7 @@ return {
|
||||||
-- -- As with specs and palettes, a specific style's value will be used over the `all`'s value.
|
-- -- As with specs and palettes, a specific style's value will be used over the `all`'s value.
|
||||||
-- NvimTreeNormal = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" },
|
-- NvimTreeNormal = { fg = "fg1", bg = is_transparent and "NONE" or "bg1" },
|
||||||
-- NvimTreeSpecialFile = { fg = "#faa356", style = "italic" },
|
-- NvimTreeSpecialFile = { fg = "#faa356", style = "italic" },
|
||||||
|
-- NvimTreeIndentMarker = { fg = "#3E4450" },
|
||||||
-- BufferLineFill = { bg = is_transparent and "NONE" or "bg1" },
|
-- BufferLineFill = { bg = is_transparent and "NONE" or "bg1" },
|
||||||
-- BufferLineUnfocusedFill = { bg = is_transparent and "NONE" or "bg1" },
|
-- BufferLineUnfocusedFill = { bg = is_transparent and "NONE" or "bg1" },
|
||||||
-- LualineNormal = { bg = is_transparent and "NONE" or "bg1" },
|
-- LualineNormal = { bg = is_transparent and "NONE" or "bg1" },
|
||||||
|
@ -87,6 +91,7 @@ return {
|
||||||
-- WhichKeyFloat = { bg = is_transparent and "NONE" or "bg1" },
|
-- WhichKeyFloat = { bg = is_transparent and "NONE" or "bg1" },
|
||||||
-- LazyNormal = { bg = is_transparent and "NONE" or "bg1" },
|
-- LazyNormal = { bg = is_transparent and "NONE" or "bg1" },
|
||||||
-- LazyBackground = { bg = is_transparent and "NONE" or "bg1" },
|
-- LazyBackground = { bg = is_transparent and "NONE" or "bg1" },
|
||||||
|
-- NormalSB = { fg = "fg1", bg = "bg1" }, -- normal text
|
||||||
-- },
|
-- },
|
||||||
-- },
|
-- },
|
||||||
-- })
|
-- })
|
||||||
|
|
|
@ -19,37 +19,37 @@ return {
|
||||||
-- },
|
-- },
|
||||||
-- },
|
-- },
|
||||||
-- },
|
-- },
|
||||||
-- {
|
{
|
||||||
-- "echasnovski/mini.indentscope",
|
"echasnovski/mini.indentscope",
|
||||||
-- version = false, -- wait till new 0.7.0 release to put it back on semver
|
version = false, -- wait till new 0.7.0 release to put it back on semver
|
||||||
-- event = "BufReadPre",
|
event = "BufReadPre",
|
||||||
-- opts = {
|
opts = {
|
||||||
-- -- symbol = "▏",
|
-- symbol = "▏",
|
||||||
-- -- symbol = "│",
|
-- symbol = "│",
|
||||||
-- symbol = icons.ui.LineMiddle,
|
symbol = icons.ui.LineMiddle,
|
||||||
-- options = { try_as_border = true },
|
options = { try_as_border = true },
|
||||||
-- },
|
},
|
||||||
-- config = function(_, opts)
|
config = function(_, opts)
|
||||||
-- vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
-- pattern = { "help", "alpha", "dashboard", "NvimTree", "Trouble", "lazy", "mason" },
|
pattern = { "help", "alpha", "dashboard", "NvimTree", "Trouble", "lazy", "mason" },
|
||||||
-- callback = function()
|
callback = function()
|
||||||
-- vim.b.miniindentscope_disable = true
|
vim.b.miniindentscope_disable = true
|
||||||
-- end,
|
end,
|
||||||
-- })
|
})
|
||||||
-- require("mini.indentscope").setup(opts)
|
require("mini.indentscope").setup(opts)
|
||||||
-- end,
|
end,
|
||||||
-- },
|
},
|
||||||
{
|
{
|
||||||
"hrsh7th/cmp-nvim-lua",
|
"hrsh7th/cmp-nvim-lua",
|
||||||
enabled = false,
|
enabled = false,
|
||||||
},
|
},
|
||||||
-- {
|
{
|
||||||
-- "gbprod/yanky.nvim",
|
"gbprod/yanky.nvim",
|
||||||
-- event = "BufReadPre",
|
event = "BufReadPre",
|
||||||
-- config = function()
|
config = function()
|
||||||
-- require("user.yanky")
|
require("user.yanky")
|
||||||
-- end,
|
end,
|
||||||
-- },
|
},
|
||||||
-- {
|
-- {
|
||||||
-- "is0n/jaq-nvim",
|
-- "is0n/jaq-nvim",
|
||||||
-- event = "BufRead",
|
-- event = "BufRead",
|
||||||
|
|
|
@ -1,282 +0,0 @@
|
||||||
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")
|
|
||||||
--
|
|
||||||
-- -- 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 = "none" },
|
|
||||||
-- },
|
|
||||||
--
|
|
||||||
-- 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 = "#393f4a" },
|
|
||||||
-- },
|
|
||||||
-- }
|
|
||||||
--
|
|
||||||
-- 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 = { "branch" },
|
|
||||||
-- lualine_c = { lsp_info, diagnostics, lsp_progress },
|
|
||||||
-- lualine_x = { diff, spaces, "filetype" },
|
|
||||||
-- lualine_y = { "progress" },
|
|
||||||
-- lualine_z = {
|
|
||||||
-- { "location", separator = { right = " " }, padding = { left = 1, right = 1 } },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- inactive_sections = {
|
|
||||||
-- lualine_a = { "filename" },
|
|
||||||
-- lualine_b = {},
|
|
||||||
-- lualine_c = {},
|
|
||||||
-- lualine_x = {},
|
|
||||||
-- lualine_y = {},
|
|
||||||
-- lualine_z = { "location" },
|
|
||||||
-- },
|
|
||||||
-- tabline = {},
|
|
||||||
-- extensions = {},
|
|
||||||
-- })
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
}
|
|
|
@ -1,290 +1,290 @@
|
||||||
return {
|
return {
|
||||||
{
|
-- {
|
||||||
"nvim-lualine/lualine.nvim",
|
-- "nvim-lualine/lualine.nvim",
|
||||||
event = "InsertEnter",
|
-- event = "InsertEnter",
|
||||||
config = function()
|
-- config = function()
|
||||||
local hide_in_width = function()
|
-- local hide_in_width = function()
|
||||||
return vim.fn.winwidth(0) > 80
|
-- return vim.fn.winwidth(0) > 80
|
||||||
end
|
-- end
|
||||||
local icons = require("user.icons")
|
-- local icons = require("user.icons")
|
||||||
|
--
|
||||||
local getLeftSubstring = function(word, length)
|
-- local getLeftSubstring = function(word, length)
|
||||||
if #word > length then
|
-- if #word > length then
|
||||||
return string.sub(word, 1, length) .. "..."
|
-- return string.sub(word, 1, length) .. "..."
|
||||||
else
|
-- else
|
||||||
return word
|
-- return word
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
-- start for lsp
|
-- -- start for lsp
|
||||||
local list_registered_providers_names = function(filetype)
|
-- local list_registered_providers_names = function(filetype)
|
||||||
local s = require("null-ls.sources")
|
-- local s = require("null-ls.sources")
|
||||||
local available_sources = s.get_available(filetype)
|
-- local available_sources = s.get_available(filetype)
|
||||||
local registered = {}
|
-- local registered = {}
|
||||||
for _, source in ipairs(available_sources) do
|
-- for _, source in ipairs(available_sources) do
|
||||||
for method in pairs(source.methods) do
|
-- for method in pairs(source.methods) do
|
||||||
registered[method] = registered[method] or {}
|
-- registered[method] = registered[method] or {}
|
||||||
table.insert(registered[method], source.name)
|
-- table.insert(registered[method], source.name)
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
return registered
|
-- return registered
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
local null_ls = require("null-ls")
|
-- local null_ls = require("null-ls")
|
||||||
-- for formatter
|
-- -- for formatter
|
||||||
local list_registered = function(filetype)
|
-- local list_registered = function(filetype)
|
||||||
local method = null_ls.methods.FORMATTING
|
-- local method = null_ls.methods.FORMATTING
|
||||||
local registered_providers = list_registered_providers_names(filetype)
|
-- local registered_providers = list_registered_providers_names(filetype)
|
||||||
return registered_providers[method] or {}
|
-- return registered_providers[method] or {}
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
--- for linter
|
-- --- for linter
|
||||||
local alternative_methods = {
|
-- local alternative_methods = {
|
||||||
null_ls.methods.DIAGNOSTICS,
|
-- null_ls.methods.DIAGNOSTICS,
|
||||||
null_ls.methods.DIAGNOSTICS_ON_OPEN,
|
-- null_ls.methods.DIAGNOSTICS_ON_OPEN,
|
||||||
null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
-- null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||||
}
|
-- }
|
||||||
|
--
|
||||||
local linter_list_registered = function(filetype)
|
-- local linter_list_registered = function(filetype)
|
||||||
local registered_providers = list_registered_providers_names(filetype)
|
-- local registered_providers = list_registered_providers_names(filetype)
|
||||||
local providers_for_methods = vim.tbl_flatten(vim.tbl_map(function(m)
|
-- local providers_for_methods = vim.tbl_flatten(vim.tbl_map(function(m)
|
||||||
return registered_providers[m] or {}
|
-- return registered_providers[m] or {}
|
||||||
end, alternative_methods))
|
-- end, alternative_methods))
|
||||||
|
--
|
||||||
return providers_for_methods
|
-- return providers_for_methods
|
||||||
end
|
-- end
|
||||||
-- end for lsp
|
-- -- end for lsp
|
||||||
|
--
|
||||||
local lsp_info = {
|
-- local lsp_info = {
|
||||||
function()
|
-- function()
|
||||||
local msg = "LS Inactive"
|
-- local msg = "LS Inactive"
|
||||||
local buf_ft = vim.bo.filetype
|
-- local buf_ft = vim.bo.filetype
|
||||||
local clients = vim.lsp.get_active_clients()
|
-- local clients = vim.lsp.get_active_clients()
|
||||||
-- start register
|
-- -- start register
|
||||||
local buf_clients = vim.lsp.buf_get_clients()
|
-- local buf_clients = vim.lsp.buf_get_clients()
|
||||||
local buf_client_names = {}
|
-- local buf_client_names = {}
|
||||||
if next(buf_clients) == nil then
|
-- if next(buf_clients) == nil then
|
||||||
-- TODO: clean up this if statement
|
-- -- TODO: clean up this if statement
|
||||||
if type(msg) == "boolean" or #msg == 0 then
|
-- if type(msg) == "boolean" or #msg == 0 then
|
||||||
return "LS Inactive"
|
-- return "LS Inactive"
|
||||||
end
|
-- end
|
||||||
return msg
|
-- return msg
|
||||||
end
|
-- end
|
||||||
-- add client
|
-- -- add client
|
||||||
for _, client in pairs(buf_clients) do
|
-- for _, client in pairs(buf_clients) do
|
||||||
if client.name ~= "null-ls" and client.name ~= "copilot" then
|
-- if client.name ~= "null-ls" and client.name ~= "copilot" then
|
||||||
table.insert(buf_client_names, client.name)
|
-- table.insert(buf_client_names, client.name)
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
-- add formatter
|
-- -- add formatter
|
||||||
local supported_formatters = list_registered(buf_ft)
|
-- local supported_formatters = list_registered(buf_ft)
|
||||||
vim.list_extend(buf_client_names, supported_formatters)
|
-- vim.list_extend(buf_client_names, supported_formatters)
|
||||||
-- add linter
|
-- -- add linter
|
||||||
local supported_linters = linter_list_registered(buf_ft)
|
-- local supported_linters = linter_list_registered(buf_ft)
|
||||||
vim.list_extend(buf_client_names, supported_linters)
|
-- vim.list_extend(buf_client_names, supported_linters)
|
||||||
-- decomple
|
-- -- decomple
|
||||||
local unique_client_names = vim.fn.uniq(buf_client_names)
|
-- local unique_client_names = vim.fn.uniq(buf_client_names)
|
||||||
local msg = table.concat(unique_client_names, ", ")
|
-- local msg = table.concat(unique_client_names, ", ")
|
||||||
return msg
|
-- return msg
|
||||||
end,
|
-- end,
|
||||||
--icon = " ",
|
-- --icon = " ",
|
||||||
icon = icons.ui.Gear .. "",
|
-- icon = icons.ui.Gear .. "",
|
||||||
padding = 1,
|
-- padding = 1,
|
||||||
}
|
-- }
|
||||||
|
--
|
||||||
local diagnostics = {
|
-- local diagnostics = {
|
||||||
"diagnostics",
|
-- "diagnostics",
|
||||||
sources = { "nvim_diagnostic" },
|
-- sources = { "nvim_diagnostic" },
|
||||||
sections = { "error", "warn" },
|
-- sections = { "error", "warn" },
|
||||||
-- symbols = { error = " ", warn = " " },
|
-- -- symbols = { error = " ", warn = " " },
|
||||||
symbols = {
|
-- symbols = {
|
||||||
error = icons.diagnostics.BoldError .. " ",
|
-- error = icons.diagnostics.BoldError .. " ",
|
||||||
warn = icons.diagnostics.BoldWarning .. " ",
|
-- warn = icons.diagnostics.BoldWarning .. " ",
|
||||||
},
|
-- },
|
||||||
colored = true,
|
-- colored = true,
|
||||||
update_in_insert = false,
|
-- update_in_insert = false,
|
||||||
always_visible = false,
|
-- always_visible = false,
|
||||||
}
|
-- }
|
||||||
|
--
|
||||||
local diff = {
|
-- local diff = {
|
||||||
"diff",
|
-- "diff",
|
||||||
colored = true,
|
-- colored = true,
|
||||||
-- symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
|
-- -- symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
|
||||||
symbols = {
|
-- symbols = {
|
||||||
added = icons.git.LineAdded .. " ",
|
-- added = icons.git.LineAdded .. " ",
|
||||||
modified = icons.git.LineModified .. " ",
|
-- modified = icons.git.LineModified .. " ",
|
||||||
removed = icons.git.LineRemoved .. " ",
|
-- removed = icons.git.LineRemoved .. " ",
|
||||||
}, -- changes diff symbols
|
-- }, -- changes diff symbols
|
||||||
cond = hide_in_width,
|
-- cond = hide_in_width,
|
||||||
}
|
-- }
|
||||||
|
--
|
||||||
local spaces = function()
|
-- local spaces = function()
|
||||||
-- return " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
-- -- return " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||||
return icons.ui.Tab .. " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
-- return icons.ui.Tab .. " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
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
|
||||||
end,
|
-- end,
|
||||||
}
|
-- }
|
||||||
local branch = {
|
-- local branch = {
|
||||||
"branch",
|
-- "branch",
|
||||||
padding = 1,
|
-- padding = 1,
|
||||||
}
|
-- }
|
||||||
|
--
|
||||||
local get_branch = function()
|
-- local get_branch = function()
|
||||||
if vim.b.gitsigns_head ~= nil then
|
-- if vim.b.gitsigns_head ~= nil then
|
||||||
return icons.git.Branch2 .. " " .. getLeftSubstring(vim.b.gitsigns_head, 6)
|
-- return icons.git.Branch2 .. " " .. getLeftSubstring(vim.b.gitsigns_head, 6)
|
||||||
else
|
-- else
|
||||||
return icons.git.Branch2 .. vim.fn.fnamemodify("", ":t")
|
-- return icons.git.Branch2 .. vim.fn.fnamemodify("", ":t")
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
local lsp_progress = {}
|
-- local lsp_progress = {}
|
||||||
local data_ok, lspprogress = pcall(require, "lsp-progress")
|
-- local data_ok, lspprogress = pcall(require, "lsp-progress")
|
||||||
if data_ok then
|
-- if data_ok then
|
||||||
lsp_progress = lspprogress.progress
|
-- lsp_progress = lspprogress.progress
|
||||||
end
|
-- end
|
||||||
-- stylua: ignore
|
-- -- stylua: ignore
|
||||||
local colors = {
|
-- local colors = {
|
||||||
blue = '#50fa7b',
|
-- blue = '#50fa7b',
|
||||||
cyan = '#f1fa8c',
|
-- cyan = '#f1fa8c',
|
||||||
black = '#1a1b26',
|
-- black = '#1a1b26',
|
||||||
black_transparant = 'none',
|
-- black_transparant = 'none',
|
||||||
white = '#c6c6c6',
|
-- white = '#c6c6c6',
|
||||||
red = "#ff757f",
|
-- red = "#ff757f",
|
||||||
skyblue_1 = '#bd93f9',
|
-- skyblue_1 = '#bd93f9',
|
||||||
grey = '#5f6a8e',
|
-- grey = '#5f6a8e',
|
||||||
yellow = "#ffb86c",
|
-- yellow = "#ffb86c",
|
||||||
fg_gutter = "#3b4261",
|
-- fg_gutter = "#3b4261",
|
||||||
green1 = "#bd93f9",
|
-- green1 = "#bd93f9",
|
||||||
}
|
-- }
|
||||||
|
--
|
||||||
-- check config for theme
|
-- -- check config for theme
|
||||||
local set_theme
|
-- local set_theme
|
||||||
local bubbles_theme = {}
|
-- local bubbles_theme = {}
|
||||||
local data_exists, config = pcall(require, "core.config")
|
-- local data_exists, config = pcall(require, "core.config")
|
||||||
if data_exists then
|
-- if data_exists then
|
||||||
if config.colorscheme ~= nil then
|
-- if config.colorscheme ~= nil then
|
||||||
local color = config.colorscheme
|
-- local color = config.colorscheme
|
||||||
switch(color, {
|
-- switch(color, {
|
||||||
["tokyonight"] = function()
|
-- ["tokyonight"] = function()
|
||||||
set_theme = "auto"
|
-- set_theme = "auto"
|
||||||
end,
|
-- end,
|
||||||
["tokyonight-night"] = function()
|
-- ["tokyonight-night"] = function()
|
||||||
set_theme = "auto"
|
-- set_theme = "auto"
|
||||||
end,
|
-- end,
|
||||||
["tokyonight-storm"] = function()
|
-- ["tokyonight-storm"] = function()
|
||||||
set_theme = "auto"
|
-- set_theme = "auto"
|
||||||
end,
|
-- end,
|
||||||
["tokyonight-day"] = function()
|
-- ["tokyonight-day"] = function()
|
||||||
set_theme = "auto"
|
-- set_theme = "auto"
|
||||||
end,
|
-- end,
|
||||||
["tokyonight-moon"] = function()
|
-- ["tokyonight-moon"] = function()
|
||||||
set_theme = "auto"
|
-- set_theme = "auto"
|
||||||
end,
|
-- end,
|
||||||
["dracula"] = function()
|
-- ["dracula"] = function()
|
||||||
local clr = require("dracula").colors()
|
-- local clr = require("dracula").colors()
|
||||||
colors.blue = clr.green
|
-- colors.blue = clr.green
|
||||||
colors.black = clr.black
|
-- colors.black = clr.black
|
||||||
colors.cyan = clr.yellow
|
-- colors.cyan = clr.yellow
|
||||||
set_theme = bubbles_theme
|
-- set_theme = bubbles_theme
|
||||||
end,
|
-- end,
|
||||||
default = function()
|
-- default = function()
|
||||||
set_theme = "auto"
|
-- set_theme = "auto"
|
||||||
end,
|
-- end,
|
||||||
})
|
-- })
|
||||||
end
|
-- end
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
bubbles_theme = {
|
-- bubbles_theme = {
|
||||||
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 = colors.black_transparant },
|
||||||
},
|
-- },
|
||||||
|
--
|
||||||
insert = {
|
-- insert = {
|
||||||
a = { fg = colors.black, bg = colors.blue },
|
-- a = { fg = colors.black, bg = colors.blue },
|
||||||
b = { fg = colors.blue, bg = colors.grey },
|
-- b = { fg = colors.blue, bg = colors.grey },
|
||||||
},
|
-- },
|
||||||
visual = {
|
-- visual = {
|
||||||
a = { fg = colors.black, bg = colors.cyan },
|
-- a = { fg = colors.black, bg = colors.cyan },
|
||||||
b = { fg = colors.cyan, bg = colors.grey },
|
-- b = { fg = colors.cyan, bg = colors.grey },
|
||||||
},
|
-- },
|
||||||
replace = {
|
-- replace = {
|
||||||
a = { bg = colors.red, fg = colors.black },
|
-- a = { bg = colors.red, fg = colors.black },
|
||||||
b = { bg = colors.fg_gutter, fg = colors.red },
|
-- b = { bg = colors.fg_gutter, fg = colors.red },
|
||||||
},
|
-- },
|
||||||
command = {
|
-- command = {
|
||||||
a = { bg = colors.yellow, fg = colors.black },
|
-- a = { bg = colors.yellow, fg = colors.black },
|
||||||
b = { bg = colors.fg_gutter, fg = colors.yellow },
|
-- b = { bg = colors.fg_gutter, fg = colors.yellow },
|
||||||
},
|
-- },
|
||||||
terminal = {
|
-- terminal = {
|
||||||
a = { bg = colors.green1, fg = colors.black },
|
-- a = { bg = colors.green1, fg = colors.black },
|
||||||
b = { bg = colors.fg_gutter, fg = colors.green1 },
|
-- b = { bg = colors.fg_gutter, fg = colors.green1 },
|
||||||
},
|
-- },
|
||||||
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 = colors.black_transparant },
|
||||||
},
|
-- },
|
||||||
}
|
-- }
|
||||||
|
--
|
||||||
if set_theme == "auto" then
|
-- if set_theme == "auto" then
|
||||||
bubbles_theme = vim.fn.fnamemodify("auto", ":t")
|
-- bubbles_theme = vim.fn.fnamemodify("auto", ":t")
|
||||||
end
|
-- end
|
||||||
|
--
|
||||||
require("lualine").setup({
|
-- require("lualine").setup({
|
||||||
options = {
|
-- options = {
|
||||||
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",
|
||||||
"alpha",
|
-- "alpha",
|
||||||
"dashboard",
|
-- "dashboard",
|
||||||
"NvimTree",
|
-- "NvimTree",
|
||||||
"Outline",
|
-- "Outline",
|
||||||
"DressingInput",
|
-- "DressingInput",
|
||||||
"toggleterm",
|
-- "toggleterm",
|
||||||
"lazy",
|
-- "lazy",
|
||||||
"mason",
|
-- "mason",
|
||||||
"neo-tree",
|
-- "neo-tree",
|
||||||
"startuptime",
|
-- "startuptime",
|
||||||
},
|
-- },
|
||||||
always_divide_middle = true,
|
-- always_divide_middle = true,
|
||||||
},
|
-- },
|
||||||
sections = {
|
-- sections = {
|
||||||
lualine_a = {
|
-- lualine_a = {
|
||||||
mode,
|
-- mode,
|
||||||
},
|
-- },
|
||||||
lualine_b = { get_branch },
|
-- lualine_b = { get_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 = 1 },
|
||||||
},
|
-- },
|
||||||
},
|
-- },
|
||||||
inactive_sections = {
|
-- inactive_sections = {
|
||||||
lualine_a = { "filename" },
|
-- lualine_a = { "filename" },
|
||||||
lualine_b = {},
|
-- lualine_b = {},
|
||||||
lualine_c = {},
|
-- lualine_c = {},
|
||||||
lualine_x = {},
|
-- lualine_x = {},
|
||||||
lualine_y = {},
|
-- lualine_y = {},
|
||||||
lualine_z = { "location" },
|
-- lualine_z = { "location" },
|
||||||
},
|
-- },
|
||||||
tabline = {},
|
-- tabline = {},
|
||||||
extensions = {},
|
-- extensions = {},
|
||||||
})
|
-- })
|
||||||
end,
|
-- end,
|
||||||
},
|
-- },
|
||||||
}
|
}
|
||||||
|
|
248
lua/custom/plugins/lualine_onedark.lua
Normal file
248
lua/custom/plugins/lualine_onedark.lua
Normal file
|
@ -0,0 +1,248 @@
|
||||||
|
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 onedark=vim.fn.fnamemodify("auto", ":t")
|
||||||
|
local is_transparat = true
|
||||||
|
local status_ok, onedarkpro = pcall(require, "onedarkpro.helpers")
|
||||||
|
if status_ok then
|
||||||
|
local colors = onedarkpro.get_colors("onedark")
|
||||||
|
|
||||||
|
onedark = {
|
||||||
|
normal = {
|
||||||
|
a = { bg = colors.green, fg = colors.bg },
|
||||||
|
b = { bg = colors.fg_gutter, fg = colors.green },
|
||||||
|
c = {
|
||||||
|
bg = is_transparat and colors.none or colors.bg_statusline,
|
||||||
|
fg = colors.fg,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
insert = {
|
||||||
|
a = { bg = colors.blue, fg = colors.bg },
|
||||||
|
b = { bg = colors.fg_gutter, fg = colors.blue },
|
||||||
|
},
|
||||||
|
visual = {
|
||||||
|
a = { bg = colors.yellow, fg = colors.bg },
|
||||||
|
b = { bg = colors.fg_gutter, fg = colors.yellow },
|
||||||
|
},
|
||||||
|
replace = {
|
||||||
|
a = { bg = colors.red, fg = colors.bg },
|
||||||
|
b = { bg = colors.fg_gutter, fg = colors.red },
|
||||||
|
},
|
||||||
|
command = {
|
||||||
|
a = { bg = colors.purple, fg = colors.bg },
|
||||||
|
b = { bg = colors.fg_gutter, fg = colors.purple },
|
||||||
|
},
|
||||||
|
terminal = {
|
||||||
|
a = { bg = colors.cyan, fg = colors.bg },
|
||||||
|
b = { bg = colors.fg_gutter, fg = colors.cyan },
|
||||||
|
},
|
||||||
|
inactive = {
|
||||||
|
a = { bg = colors.bg, fg = colors.blue },
|
||||||
|
b = { bg = colors.bg, fg = colors.fg_gutter_inactive, gui = "bold" },
|
||||||
|
c = {
|
||||||
|
bg = is_transparat and colors.none or colors.bg,
|
||||||
|
fg = colors.fg_gutter_inactive,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
require("lualine").setup({
|
||||||
|
options = {
|
||||||
|
theme = onedark,
|
||||||
|
-- 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,
|
||||||
|
},
|
||||||
|
}
|
279
lua/custom/plugins/nvim_tree.lua
Normal file
279
lua/custom/plugins/nvim_tree.lua
Normal file
|
@ -0,0 +1,279 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"kyazdani42/nvim-tree.lua",
|
||||||
|
lazy = true,
|
||||||
|
event = "VeryLazy",
|
||||||
|
cmd = { "NvimTree", "NvimTreeOpen", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" },
|
||||||
|
-- dependencies = "kyazdani42/nvim-web-devicons",
|
||||||
|
config = function()
|
||||||
|
local data_exists, treeconfig = pcall(require, "core.config")
|
||||||
|
if data_exists then
|
||||||
|
if treeconfig.loadnvimtree_lazy then
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
|
-- set termguicolors to enable highlight groups
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
local status_ok, nvim_tree = pcall(require, "nvim-tree")
|
||||||
|
if not status_ok then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local HEIGHT_RATIO = 0.9 -- You can change this
|
||||||
|
local WIDTH_RATIO = 0.5 -- You can change this too
|
||||||
|
|
||||||
|
local icons = require("user.icons")
|
||||||
|
nvim_tree.setup({
|
||||||
|
auto_reload_on_write = false,
|
||||||
|
disable_netrw = false,
|
||||||
|
hijack_cursor = false,
|
||||||
|
hijack_netrw = true,
|
||||||
|
hijack_unnamed_buffer_when_opening = false,
|
||||||
|
sort_by = "name",
|
||||||
|
root_dirs = {},
|
||||||
|
prefer_startup_root = false,
|
||||||
|
sync_root_with_cwd = true,
|
||||||
|
reload_on_bufenter = false,
|
||||||
|
respect_buf_cwd = false,
|
||||||
|
on_attach = "default",
|
||||||
|
select_prompts = false,
|
||||||
|
view = {
|
||||||
|
adaptive_size = false,
|
||||||
|
centralize_selection = true,
|
||||||
|
-- width = 30,
|
||||||
|
side = "left",
|
||||||
|
preserve_window_proportions = false,
|
||||||
|
number = false,
|
||||||
|
relativenumber = false,
|
||||||
|
signcolumn = "yes",
|
||||||
|
-- float = {
|
||||||
|
-- enable = true,
|
||||||
|
-- quit_on_focus_loss = true,
|
||||||
|
-- open_win_config = {
|
||||||
|
-- relative = "editor",
|
||||||
|
-- border = "rounded",
|
||||||
|
-- width = 30,
|
||||||
|
-- height = 30,
|
||||||
|
-- row = 1,
|
||||||
|
-- col = 1,
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
float = {
|
||||||
|
enable = true,
|
||||||
|
open_win_config = function()
|
||||||
|
local screen_w = vim.opt.columns:get()
|
||||||
|
local screen_h = vim.opt.lines:get() - vim.opt.cmdheight:get()
|
||||||
|
local window_w = screen_w * WIDTH_RATIO
|
||||||
|
local window_h = screen_h * HEIGHT_RATIO
|
||||||
|
local window_w_int = math.floor(window_w)
|
||||||
|
local window_h_int = math.floor(window_h)
|
||||||
|
local center_x = (screen_w - window_w) / 2
|
||||||
|
local center_y = ((vim.opt.lines:get() - window_h) / 2) - vim.opt.cmdheight:get()
|
||||||
|
return {
|
||||||
|
border = "rounded",
|
||||||
|
relative = "editor",
|
||||||
|
row = center_y,
|
||||||
|
col = center_x,
|
||||||
|
width = window_w_int,
|
||||||
|
height = window_h_int,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
width = function()
|
||||||
|
return math.floor(vim.opt.columns:get() * WIDTH_RATIO)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
renderer = {
|
||||||
|
add_trailing = false,
|
||||||
|
group_empty = false,
|
||||||
|
highlight_git = true,
|
||||||
|
full_name = false,
|
||||||
|
highlight_opened_files = "none",
|
||||||
|
root_folder_label = ":t",
|
||||||
|
-- root_folder_label = false,
|
||||||
|
indent_width = 2,
|
||||||
|
indent_markers = {
|
||||||
|
enable = true,
|
||||||
|
inline_arrows = true,
|
||||||
|
icons = {
|
||||||
|
corner = "└",
|
||||||
|
edge = "│",
|
||||||
|
item = "│",
|
||||||
|
none = " ",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
icons = {
|
||||||
|
webdev_colors = true,
|
||||||
|
git_placement = "before",
|
||||||
|
padding = " ",
|
||||||
|
symlink_arrow = " ➛ ",
|
||||||
|
show = {
|
||||||
|
file = true,
|
||||||
|
folder = true,
|
||||||
|
folder_arrow = true,
|
||||||
|
git = true,
|
||||||
|
},
|
||||||
|
glyphs = {
|
||||||
|
default = icons.ui.Text,
|
||||||
|
symlink = icons.ui.FileSymlink,
|
||||||
|
bookmark = icons.ui.BookMark,
|
||||||
|
folder = {
|
||||||
|
-- arrow_closed = icons.ui.TriangleShortArrowRight,
|
||||||
|
arrow_closed = icons.ui.ChevronShortRight,
|
||||||
|
-- arrow_open = icons.ui.TriangleShortArrowDown,
|
||||||
|
arrow_open = icons.ui.ChevronShortDown,
|
||||||
|
default = icons.ui.Folder,
|
||||||
|
open = icons.ui.FolderOpen,
|
||||||
|
empty = icons.ui.EmptyFolder,
|
||||||
|
empty_open = icons.ui.EmptyFolderOpen,
|
||||||
|
symlink = icons.ui.FolderSymlink,
|
||||||
|
symlink_open = icons.ui.FolderOpen,
|
||||||
|
},
|
||||||
|
git = {
|
||||||
|
unstaged = icons.git.FileUnstaged,
|
||||||
|
staged = icons.git.FileStaged,
|
||||||
|
unmerged = icons.git.FileUnmerged,
|
||||||
|
renamed = icons.git.FileRenamed,
|
||||||
|
untracked = icons.git.FileUntracked,
|
||||||
|
deleted = icons.git.FileDeleted,
|
||||||
|
ignored = icons.git.FileIgnored,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
special_files = { "Cargo.toml", "Makefile", "README.md", "readme.md" },
|
||||||
|
symlink_destination = true,
|
||||||
|
},
|
||||||
|
hijack_directories = {
|
||||||
|
enable = false,
|
||||||
|
auto_open = true,
|
||||||
|
},
|
||||||
|
update_focused_file = {
|
||||||
|
enable = true,
|
||||||
|
debounce_delay = 15,
|
||||||
|
update_root = true,
|
||||||
|
ignore_list = {},
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
enable = true,
|
||||||
|
show_on_dirs = false,
|
||||||
|
show_on_open_dirs = true,
|
||||||
|
debounce_delay = 50,
|
||||||
|
severity = {
|
||||||
|
min = vim.diagnostic.severity.HINT,
|
||||||
|
max = vim.diagnostic.severity.ERROR,
|
||||||
|
},
|
||||||
|
icons = {
|
||||||
|
hint = icons.diagnostics.BoldHint,
|
||||||
|
info = icons.diagnostics.BoldInformation,
|
||||||
|
warning = icons.diagnostics.BoldWarning,
|
||||||
|
error = icons.diagnostics.BoldError,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filters = {
|
||||||
|
dotfiles = false,
|
||||||
|
git_clean = false,
|
||||||
|
no_buffer = false,
|
||||||
|
custom = { "node_modules", "\\.cache", "\\.git" },
|
||||||
|
exclude = {
|
||||||
|
".gitignore",
|
||||||
|
".prettierignore",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filesystem_watchers = {
|
||||||
|
enable = true,
|
||||||
|
debounce_delay = 50,
|
||||||
|
ignore_dirs = {},
|
||||||
|
},
|
||||||
|
git = {
|
||||||
|
enable = true,
|
||||||
|
ignore = false,
|
||||||
|
show_on_dirs = true,
|
||||||
|
show_on_open_dirs = true,
|
||||||
|
disable_for_dirs = {},
|
||||||
|
timeout = 400,
|
||||||
|
},
|
||||||
|
actions = {
|
||||||
|
use_system_clipboard = true,
|
||||||
|
change_dir = {
|
||||||
|
enable = true,
|
||||||
|
global = false,
|
||||||
|
restrict_above_cwd = false,
|
||||||
|
},
|
||||||
|
expand_all = {
|
||||||
|
max_folder_discovery = 300,
|
||||||
|
exclude = {},
|
||||||
|
},
|
||||||
|
file_popup = {
|
||||||
|
open_win_config = {
|
||||||
|
col = 1,
|
||||||
|
row = 1,
|
||||||
|
relative = "cursor",
|
||||||
|
border = "shadow",
|
||||||
|
style = "minimal",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
open_file = {
|
||||||
|
quit_on_open = false,
|
||||||
|
resize_window = false,
|
||||||
|
window_picker = {
|
||||||
|
enable = true,
|
||||||
|
picker = "default",
|
||||||
|
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890",
|
||||||
|
exclude = {
|
||||||
|
filetype = { "notify", "lazy", "qf", "diff", "fugitive", "fugitiveblame" },
|
||||||
|
buftype = { "nofile", "terminal", "help" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
remove_file = {
|
||||||
|
close_window = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
trash = {
|
||||||
|
cmd = "trash",
|
||||||
|
require_confirm = true,
|
||||||
|
},
|
||||||
|
live_filter = {
|
||||||
|
prefix = "[FILTER]: ",
|
||||||
|
always_show_folders = true,
|
||||||
|
},
|
||||||
|
tab = {
|
||||||
|
sync = {
|
||||||
|
open = false,
|
||||||
|
close = false,
|
||||||
|
ignore = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
notify = {
|
||||||
|
threshold = vim.log.levels.INFO,
|
||||||
|
-- threshold = vim.log.levels.ERROR,
|
||||||
|
},
|
||||||
|
log = {
|
||||||
|
enable = false,
|
||||||
|
truncate = false,
|
||||||
|
types = {
|
||||||
|
all = false,
|
||||||
|
config = false,
|
||||||
|
copy_paste = false,
|
||||||
|
dev = false,
|
||||||
|
diagnostics = false,
|
||||||
|
git = false,
|
||||||
|
profile = false,
|
||||||
|
watcher = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
system_open = {
|
||||||
|
cmd = nil,
|
||||||
|
args = {},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- auto open file if creation
|
||||||
|
local api = require("nvim-tree.api")
|
||||||
|
api.events.subscribe(api.events.Event.FileCreated, function(file)
|
||||||
|
vim.cmd("edit " .. file.fname)
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
|
@ -17,14 +17,14 @@ return {
|
||||||
-- event = "BufWinEnter",
|
-- event = "BufWinEnter",
|
||||||
event = { "BufRead", "BufNewFile" },
|
event = { "BufRead", "BufNewFile" },
|
||||||
config = function()
|
config = function()
|
||||||
require("user.lualine")
|
require("user.lualine_cfg")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
-- for show icon
|
-- for show icon
|
||||||
{
|
{
|
||||||
"kyazdani42/nvim-web-devicons",
|
"kyazdani42/nvim-web-devicons",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
dependencies = { "DaikyXendo/nvim-material-icon" },
|
dependencies = { "pojokcodeid/nvim-material-icon" },
|
||||||
-- event = "BufRead",
|
-- event = "BufRead",
|
||||||
config = function()
|
config = function()
|
||||||
require("user.webdevicons")
|
require("user.webdevicons")
|
||||||
|
@ -35,7 +35,7 @@ return {
|
||||||
"kyazdani42/nvim-tree.lua",
|
"kyazdani42/nvim-tree.lua",
|
||||||
lazy = true,
|
lazy = true,
|
||||||
-- event = "BufRead",
|
-- event = "BufRead",
|
||||||
cmd = { "NvimTree", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" },
|
cmd = { "NvimTree", "NvimTreeOpen", "NvimTreeToggle", "NvimTreeFocus", "NvimTreeClose" },
|
||||||
-- dependencies = "kyazdani42/nvim-web-devicons",
|
-- dependencies = "kyazdani42/nvim-web-devicons",
|
||||||
config = function()
|
config = function()
|
||||||
local data_exists, treeconfig = pcall(require, "core.config")
|
local data_exists, treeconfig = pcall(require, "core.config")
|
||||||
|
|
|
@ -25,7 +25,7 @@ end
|
||||||
local dashboard = require("alpha.themes.dashboard")
|
local dashboard = require("alpha.themes.dashboard")
|
||||||
dashboard.section.header.val = board
|
dashboard.section.header.val = board
|
||||||
dashboard.section.buttons.val = {
|
dashboard.section.buttons.val = {
|
||||||
dashboard.button("f", " Find file", ":Telescope find_files <CR>"),
|
dashboard.button("F", " Find file", ":Telescope find_files <CR>"),
|
||||||
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
|
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
|
||||||
dashboard.button("p", " Find project", ":Telescope projects <CR>"),
|
dashboard.button("p", " Find project", ":Telescope projects <CR>"),
|
||||||
dashboard.button("r", " Recently used files", ":Telescope oldfiles <CR>"),
|
dashboard.button("r", " Recently used files", ":Telescope oldfiles <CR>"),
|
||||||
|
|
|
@ -52,7 +52,7 @@ keymap("v", "<C-c>", '"+y', opts)
|
||||||
keymap("x", "<C-c>", '"+y', opts)
|
keymap("x", "<C-c>", '"+y', opts)
|
||||||
keymap("n", "<C-v>", '"+P', opts)
|
keymap("n", "<C-v>", '"+P', opts)
|
||||||
keymap("v", "<C-v>", '"+P', opts)
|
keymap("v", "<C-v>", '"+P', opts)
|
||||||
keymap("i", "<C-v>", "<esc>pa", opts)
|
keymap("i", "<C-v>", "<esc>pa<Left>", opts)
|
||||||
keymap("x", "<C-v>", '"+P', opts)
|
keymap("x", "<C-v>", '"+P', opts)
|
||||||
keymap("n", "<C-Z>", "<cmd>undo<CR>", opts)
|
keymap("n", "<C-Z>", "<cmd>undo<CR>", opts)
|
||||||
keymap("x", "<C-Z>", "<esc><cmd>undo<CR>", opts)
|
keymap("x", "<C-Z>", "<esc><cmd>undo<CR>", opts)
|
||||||
|
|
|
@ -1,430 +1,430 @@
|
||||||
local status_ok, lualine = pcall(require, "lualine")
|
local status_ok, lualine = pcall(require, "lualine")
|
||||||
if not status_ok then
|
if not status_ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local icons = require("user.icons")
|
local icons = require("user.icons")
|
||||||
local hide_in_width = function()
|
local hide_in_width = function()
|
||||||
return vim.fn.winwidth(0) > 80
|
return vim.fn.winwidth(0) > 80
|
||||||
end
|
end
|
||||||
|
|
||||||
local conditions = {
|
local conditions = {
|
||||||
buffer_not_empty = function()
|
buffer_not_empty = function()
|
||||||
return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
|
return vim.fn.empty(vim.fn.expand("%:t")) ~= 1
|
||||||
end,
|
end,
|
||||||
hide_in_width = function()
|
hide_in_width = function()
|
||||||
return vim.fn.winwidth(0) > 80
|
return vim.fn.winwidth(0) > 80
|
||||||
end,
|
end,
|
||||||
check_git_workspace = function()
|
check_git_workspace = function()
|
||||||
local filepath = vim.fn.expand("%:p:h")
|
local filepath = vim.fn.expand("%:p:h")
|
||||||
local gitdir = vim.fn.finddir(".git", filepath .. ";")
|
local gitdir = vim.fn.finddir(".git", filepath .. ";")
|
||||||
return gitdir and #gitdir > 0 and #gitdir < #filepath
|
return gitdir and #gitdir > 0 and #gitdir < #filepath
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
local diagnostics = {
|
local diagnostics = {
|
||||||
"diagnostics",
|
"diagnostics",
|
||||||
sources = { "nvim_diagnostic" },
|
sources = { "nvim_diagnostic" },
|
||||||
sections = { "error", "warn" },
|
sections = { "error", "warn" },
|
||||||
-- symbols = { error = " ", warn = " " },
|
-- symbols = { error = " ", warn = " " },
|
||||||
symbols = {
|
symbols = {
|
||||||
error = icons.diagnostics.BoldError .. " ",
|
error = icons.diagnostics.BoldError .. " ",
|
||||||
warn = icons.diagnostics.BoldWarning .. " ",
|
warn = icons.diagnostics.BoldWarning .. " ",
|
||||||
},
|
},
|
||||||
colored = true,
|
colored = true,
|
||||||
update_in_insert = false,
|
update_in_insert = false,
|
||||||
always_visible = false,
|
always_visible = false,
|
||||||
}
|
}
|
||||||
|
|
||||||
local diff = {
|
local diff = {
|
||||||
"diff",
|
"diff",
|
||||||
colored = true,
|
colored = true,
|
||||||
-- symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
|
-- symbols = { added = " ", modified = " ", removed = " " }, -- changes diff symbols
|
||||||
symbols = {
|
symbols = {
|
||||||
added = icons.git.LineAdded .. " ",
|
added = icons.git.LineAdded .. " ",
|
||||||
modified = icons.git.LineModified .. " ",
|
modified = icons.git.LineModified .. " ",
|
||||||
removed = icons.git.LineRemoved .. " ",
|
removed = icons.git.LineRemoved .. " ",
|
||||||
}, -- changes diff symbols
|
}, -- changes diff symbols
|
||||||
cond = hide_in_width,
|
cond = hide_in_width,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- for config style
|
-- for config style
|
||||||
local component_separators = { left = "", right = "" }
|
local component_separators = { left = "", right = "" }
|
||||||
local section_separators = { left = "", right = "" }
|
local section_separators = { left = "", right = "" }
|
||||||
local icon_mode = ""
|
local icon_mode = ""
|
||||||
local sts_mode = 0
|
local sts_mode = 0
|
||||||
|
|
||||||
local data_exists, custom_ui = pcall(require, "core.config")
|
local data_exists, custom_ui = pcall(require, "core.config")
|
||||||
if data_exists then
|
if data_exists then
|
||||||
local ui_style = custom_ui.lualine_style
|
local ui_style = custom_ui.lualine_style
|
||||||
if ui_style ~= nil then
|
if ui_style ~= nil then
|
||||||
if custom_ui.lualine_style == 1 then
|
if custom_ui.lualine_style == 1 then
|
||||||
component_separators = { left = "", right = "" }
|
component_separators = { left = "", right = "" }
|
||||||
section_separators = { left = "", right = "" }
|
section_separators = { left = "", right = "" }
|
||||||
elseif custom_ui.lualine_style == 2 then
|
elseif custom_ui.lualine_style == 2 then
|
||||||
component_separators = { left = "", right = "" }
|
component_separators = { left = "", right = "" }
|
||||||
section_separators = { left = " ", right = " " }
|
section_separators = { left = " ", right = " " }
|
||||||
elseif custom_ui.lualine_style == 3 then
|
elseif custom_ui.lualine_style == 3 then
|
||||||
component_separators = { left = "", right = "" }
|
component_separators = { left = "", right = "" }
|
||||||
section_separators = { left = "", right = "" }
|
section_separators = { left = "", right = "" }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local ui_icon = custom_ui.status_icon
|
local ui_icon = custom_ui.status_icon
|
||||||
if ui_icon ~= nil then
|
if ui_icon ~= nil then
|
||||||
if custom_ui.status_icon == 1 then
|
if custom_ui.status_icon == 1 then
|
||||||
icon_mode = " "
|
icon_mode = " "
|
||||||
sts_mode = 1
|
sts_mode = 1
|
||||||
elseif custom_ui.status_icon == 2 then
|
elseif custom_ui.status_icon == 2 then
|
||||||
icon_mode = " "
|
icon_mode = " "
|
||||||
sts_mode = 1
|
sts_mode = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
local custom_style = custom_ui.custom_lualine
|
local custom_style = custom_ui.custom_lualine
|
||||||
if custom_style ~= nil and custom_style == true then
|
if custom_style ~= nil and custom_style == true then
|
||||||
local comp = custom_ui.component_separators
|
local comp = custom_ui.component_separators
|
||||||
local section = custom_ui.section_separators
|
local section = custom_ui.section_separators
|
||||||
if comp ~= nil and section ~= nil then
|
if comp ~= nil and section ~= nil then
|
||||||
component_separators = comp
|
component_separators = comp
|
||||||
section_separators = section
|
section_separators = section
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local mode = {
|
local mode = {
|
||||||
"mode",
|
"mode",
|
||||||
padding = 1,
|
padding = 1,
|
||||||
fmt = function(str)
|
fmt = function(str)
|
||||||
-- if str == "NORMAL" then
|
-- if str == "NORMAL" then
|
||||||
-- str = "NOR"
|
-- str = "NOR"
|
||||||
-- elseif str == "INSERT" then
|
-- elseif str == "INSERT" then
|
||||||
-- str = "INS"
|
-- str = "INS"
|
||||||
-- elseif str == "VISUAL" then
|
-- elseif str == "VISUAL" then
|
||||||
-- str = "VIS"
|
-- str = "VIS"
|
||||||
-- elseif str == "COMMAND" then
|
-- elseif str == "COMMAND" then
|
||||||
-- str = "CMD"
|
-- str = "CMD"
|
||||||
-- else
|
-- else
|
||||||
-- str = str
|
-- str = str
|
||||||
-- end
|
-- end
|
||||||
|
|
||||||
if sts_mode == 0 then
|
if sts_mode == 0 then
|
||||||
-- return "--" .. str .. "--"
|
-- return "--" .. str .. "--"
|
||||||
return " " .. str
|
return " " .. str
|
||||||
else
|
else
|
||||||
return icon_mode
|
return icon_mode
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
local filetype = {
|
local filetype = {
|
||||||
"filetype",
|
"filetype",
|
||||||
icons_enabled = true,
|
icons_enabled = true,
|
||||||
icon = nil,
|
icon = nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
local branch = {
|
local branch = {
|
||||||
"branch",
|
"branch",
|
||||||
icons_enabled = true,
|
icons_enabled = true,
|
||||||
--icon = "",
|
--icon = "",
|
||||||
icon = icons.git.Branch,
|
icon = icons.git.Branch,
|
||||||
padding = 1,
|
padding = 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
local location = {
|
local location = {
|
||||||
"location",
|
"location",
|
||||||
padding = 1,
|
padding = 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- cool function for progress
|
-- cool function for progress
|
||||||
local progress = function()
|
local progress = function()
|
||||||
local current_line = vim.fn.line(".")
|
local current_line = vim.fn.line(".")
|
||||||
local total_lines = vim.fn.line("$")
|
local total_lines = vim.fn.line("$")
|
||||||
local chars = { "__", "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆", "▇▇", "██" }
|
local chars = { "__", "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆", "▇▇", "██" }
|
||||||
local line_ratio = current_line / total_lines
|
local line_ratio = current_line / total_lines
|
||||||
local index = math.ceil(line_ratio * #chars)
|
local index = math.ceil(line_ratio * #chars)
|
||||||
return chars[index]
|
return chars[index]
|
||||||
end
|
end
|
||||||
|
|
||||||
local time = function()
|
local time = function()
|
||||||
return " " .. os.date("%R")
|
return " " .. os.date("%R")
|
||||||
end
|
end
|
||||||
|
|
||||||
local spaces = function()
|
local spaces = function()
|
||||||
-- return "->| " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
-- return "->| " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||||
return icons.ui.Tab .. " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
return icons.ui.Tab .. " " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
|
||||||
end
|
end
|
||||||
|
|
||||||
local file_name = {
|
local file_name = {
|
||||||
"filename",
|
"filename",
|
||||||
cond = conditions.buffer_not_empty,
|
cond = conditions.buffer_not_empty,
|
||||||
}
|
}
|
||||||
|
|
||||||
-- start for lsp
|
-- start for lsp
|
||||||
local list_registered_providers_names = function(filetype)
|
local list_registered_providers_names = function(filetype)
|
||||||
local s = require("null-ls.sources")
|
local s = require("null-ls.sources")
|
||||||
local available_sources = s.get_available(filetype)
|
local available_sources = s.get_available(filetype)
|
||||||
local registered = {}
|
local registered = {}
|
||||||
for _, source in ipairs(available_sources) do
|
for _, source in ipairs(available_sources) do
|
||||||
for method in pairs(source.methods) do
|
for method in pairs(source.methods) do
|
||||||
registered[method] = registered[method] or {}
|
registered[method] = registered[method] or {}
|
||||||
table.insert(registered[method], source.name)
|
table.insert(registered[method], source.name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return registered
|
return registered
|
||||||
end
|
end
|
||||||
|
|
||||||
local null_ls = require("null-ls")
|
local null_ls = require("null-ls")
|
||||||
-- for formatter
|
-- for formatter
|
||||||
local list_registered = function(filetype)
|
local list_registered = function(filetype)
|
||||||
local method = null_ls.methods.FORMATTING
|
local method = null_ls.methods.FORMATTING
|
||||||
local registered_providers = list_registered_providers_names(filetype)
|
local registered_providers = list_registered_providers_names(filetype)
|
||||||
return registered_providers[method] or {}
|
return registered_providers[method] or {}
|
||||||
end
|
end
|
||||||
|
|
||||||
--- for linter
|
--- for linter
|
||||||
local alternative_methods = {
|
local alternative_methods = {
|
||||||
null_ls.methods.DIAGNOSTICS,
|
null_ls.methods.DIAGNOSTICS,
|
||||||
null_ls.methods.DIAGNOSTICS_ON_OPEN,
|
null_ls.methods.DIAGNOSTICS_ON_OPEN,
|
||||||
null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
null_ls.methods.DIAGNOSTICS_ON_SAVE,
|
||||||
}
|
}
|
||||||
|
|
||||||
local linter_list_registered = function(filetype)
|
local linter_list_registered = function(filetype)
|
||||||
local registered_providers = list_registered_providers_names(filetype)
|
local registered_providers = list_registered_providers_names(filetype)
|
||||||
local providers_for_methods = vim.tbl_flatten(vim.tbl_map(function(m)
|
local providers_for_methods = vim.tbl_flatten(vim.tbl_map(function(m)
|
||||||
return registered_providers[m] or {}
|
return registered_providers[m] or {}
|
||||||
end, alternative_methods))
|
end, alternative_methods))
|
||||||
|
|
||||||
return providers_for_methods
|
return providers_for_methods
|
||||||
end
|
end
|
||||||
-- end for lsp
|
-- end for lsp
|
||||||
|
|
||||||
local lsp_info = {
|
local lsp_info = {
|
||||||
function()
|
function()
|
||||||
--local msg = "No Active Lsp"
|
--local msg = "No Active Lsp"
|
||||||
local msg = "LS Inactive"
|
local msg = "LS Inactive"
|
||||||
-- local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
|
-- local buf_ft = vim.api.nvim_buf_get_option(0, "filetype")
|
||||||
local buf_ft = vim.bo.filetype
|
local buf_ft = vim.bo.filetype
|
||||||
local clients = vim.lsp.get_active_clients()
|
local clients = vim.lsp.get_active_clients()
|
||||||
-- start register
|
-- start register
|
||||||
local buf_clients = vim.lsp.buf_get_clients()
|
local buf_clients = vim.lsp.buf_get_clients()
|
||||||
local buf_client_names = {}
|
local buf_client_names = {}
|
||||||
if next(buf_clients) == nil then
|
if next(buf_clients) == nil then
|
||||||
-- TODO: clean up this if statement
|
-- TODO: clean up this if statement
|
||||||
if type(msg) == "boolean" or #msg == 0 then
|
if type(msg) == "boolean" or #msg == 0 then
|
||||||
return "LS Inactive"
|
return "LS Inactive"
|
||||||
end
|
end
|
||||||
return msg
|
return msg
|
||||||
end
|
end
|
||||||
-- add client
|
-- add client
|
||||||
for _, client in pairs(buf_clients) do
|
for _, client in pairs(buf_clients) do
|
||||||
if client.name ~= "null-ls" and client.name ~= "copilot" then
|
if client.name ~= "null-ls" and client.name ~= "copilot" then
|
||||||
table.insert(buf_client_names, client.name)
|
table.insert(buf_client_names, client.name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- add formatter
|
-- add formatter
|
||||||
local supported_formatters = list_registered(buf_ft)
|
local supported_formatters = list_registered(buf_ft)
|
||||||
vim.list_extend(buf_client_names, supported_formatters)
|
vim.list_extend(buf_client_names, supported_formatters)
|
||||||
-- add linter
|
-- add linter
|
||||||
local supported_linters = linter_list_registered(buf_ft)
|
local supported_linters = linter_list_registered(buf_ft)
|
||||||
vim.list_extend(buf_client_names, supported_linters)
|
vim.list_extend(buf_client_names, supported_linters)
|
||||||
-- decomple
|
-- decomple
|
||||||
local unique_client_names = vim.fn.uniq(buf_client_names)
|
local unique_client_names = vim.fn.uniq(buf_client_names)
|
||||||
local msg = table.concat(unique_client_names, ", ")
|
local msg = table.concat(unique_client_names, ", ")
|
||||||
return msg
|
return msg
|
||||||
end,
|
end,
|
||||||
--icon = " ",
|
--icon = " ",
|
||||||
icon = icons.ui.Gear .. "",
|
icon = icons.ui.Gear .. "",
|
||||||
padding = 1,
|
padding = 1,
|
||||||
}
|
}
|
||||||
local lsp_progress = {}
|
local lsp_progress = {}
|
||||||
local data_exists, lspprogress = pcall(require, "lsp-progress")
|
local data_exists, lspprogress = pcall(require, "lsp-progress")
|
||||||
if data_exists then
|
if data_exists then
|
||||||
lsp_progress = lspprogress.progress
|
lsp_progress = lspprogress.progress
|
||||||
end
|
end
|
||||||
|
|
||||||
local clear_lualine = require("core.config").clear_lualine
|
local clear_lualine = require("core.config").clear_lualine
|
||||||
if clear_lualine ~= nil then
|
if clear_lualine ~= nil then
|
||||||
if clear_lualine == 1 then
|
if clear_lualine == 1 then
|
||||||
lualine.setup({
|
lualine.setup({
|
||||||
options = {
|
options = {
|
||||||
icons_enabled = true,
|
icons_enabled = true,
|
||||||
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",
|
||||||
"alpha",
|
"alpha",
|
||||||
"dashboard",
|
"dashboard",
|
||||||
"NvimTree",
|
"NvimTree",
|
||||||
"Outline",
|
"Outline",
|
||||||
"DressingInput",
|
"DressingInput",
|
||||||
"toggleterm",
|
"toggleterm",
|
||||||
"lazy",
|
"lazy",
|
||||||
"mason",
|
"mason",
|
||||||
"neo-tree",
|
"neo-tree",
|
||||||
},
|
},
|
||||||
always_divide_middle = true,
|
always_divide_middle = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = {},
|
lualine_a = {},
|
||||||
lualine_b = { mode, branch },
|
lualine_b = { mode, branch },
|
||||||
lualine_c = { lsp_info, diagnostics, lsp_progress },
|
lualine_c = { lsp_info, diagnostics, lsp_progress },
|
||||||
-- lualine_c = { file_name, lsp_info },
|
-- lualine_c = { file_name, lsp_info },
|
||||||
-- lualine_x = { "encoding", "fileformat", "filetype" },
|
-- lualine_x = { "encoding", "fileformat", "filetype" },
|
||||||
-- lualine_x = { diff, spaces, "encoding", filetype },
|
-- lualine_x = { diff, spaces, "encoding", filetype },
|
||||||
lualine_x = { diff, spaces, filetype },
|
lualine_x = { diff, spaces, filetype },
|
||||||
lualine_y = { location, time },
|
lualine_y = { location, time },
|
||||||
--[[ lualine_z = { progress }, ]]
|
--[[ lualine_z = { progress }, ]]
|
||||||
lualine_z = {},
|
lualine_z = {},
|
||||||
},
|
},
|
||||||
inactive_sections = {
|
inactive_sections = {
|
||||||
lualine_a = {},
|
lualine_a = {},
|
||||||
lualine_b = {},
|
lualine_b = {},
|
||||||
lualine_c = { "filename" },
|
lualine_c = { "filename" },
|
||||||
lualine_x = { "location" },
|
lualine_x = { "location" },
|
||||||
lualine_y = {},
|
lualine_y = {},
|
||||||
lualine_z = {},
|
lualine_z = {},
|
||||||
},
|
},
|
||||||
tabline = {},
|
tabline = {},
|
||||||
extensions = {},
|
extensions = {},
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
lualine.setup({
|
lualine.setup({
|
||||||
options = {
|
options = {
|
||||||
icons_enabled = true,
|
icons_enabled = true,
|
||||||
theme = "auto",
|
theme = "auto",
|
||||||
component_separators = component_separators,
|
component_separators = component_separators,
|
||||||
section_separators = section_separators,
|
section_separators = section_separators,
|
||||||
disabled_filetypes = {
|
disabled_filetypes = {
|
||||||
"TelescopePrompt",
|
"TelescopePrompt",
|
||||||
"packer",
|
"packer",
|
||||||
"alpha",
|
"alpha",
|
||||||
"dashboard",
|
"dashboard",
|
||||||
"NvimTree",
|
"NvimTree",
|
||||||
"Outline",
|
"Outline",
|
||||||
"DressingInput",
|
"DressingInput",
|
||||||
"toggleterm",
|
"toggleterm",
|
||||||
"lazy",
|
"lazy",
|
||||||
"mason",
|
"mason",
|
||||||
"neo-tree",
|
"neo-tree",
|
||||||
},
|
},
|
||||||
always_divide_middle = true,
|
always_divide_middle = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = { mode },
|
lualine_a = { mode },
|
||||||
lualine_b = { branch },
|
lualine_b = { branch },
|
||||||
lualine_c = { lsp_info, diagnostics, lsp_progress },
|
lualine_c = { lsp_info, diagnostics, lsp_progress },
|
||||||
-- lualine_c = { file_name, lsp_info },
|
-- lualine_c = { file_name, lsp_info },
|
||||||
-- lualine_x = { "encoding", "fileformat", "filetype" },
|
-- lualine_x = { "encoding", "fileformat", "filetype" },
|
||||||
-- lualine_x = { diff, spaces, "encoding", filetype },
|
-- lualine_x = { diff, spaces, "encoding", filetype },
|
||||||
lualine_x = { diff, spaces, filetype },
|
lualine_x = { diff, spaces, filetype },
|
||||||
lualine_y = { location },
|
lualine_y = { location },
|
||||||
--[[ lualine_z = { progress }, ]]
|
--[[ lualine_z = { progress }, ]]
|
||||||
lualine_z = { time },
|
lualine_z = { time },
|
||||||
},
|
},
|
||||||
inactive_sections = {
|
inactive_sections = {
|
||||||
lualine_a = {},
|
lualine_a = {},
|
||||||
lualine_b = {},
|
lualine_b = {},
|
||||||
lualine_c = { "filename" },
|
lualine_c = { "filename" },
|
||||||
lualine_x = { "location" },
|
lualine_x = { "location" },
|
||||||
lualine_y = {},
|
lualine_y = {},
|
||||||
lualine_z = {},
|
lualine_z = {},
|
||||||
},
|
},
|
||||||
tabline = {},
|
tabline = {},
|
||||||
extensions = {},
|
extensions = {},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
lualine.setup({
|
lualine.setup({
|
||||||
options = {
|
options = {
|
||||||
icons_enabled = true,
|
icons_enabled = true,
|
||||||
theme = "auto",
|
theme = "auto",
|
||||||
component_separators = component_separators,
|
component_separators = component_separators,
|
||||||
section_separators = section_separators,
|
section_separators = section_separators,
|
||||||
disabled_filetypes = {
|
disabled_filetypes = {
|
||||||
"TelescopePrompt",
|
"TelescopePrompt",
|
||||||
"packer",
|
"packer",
|
||||||
"alpha",
|
"alpha",
|
||||||
"dashboard",
|
"dashboard",
|
||||||
"NvimTree",
|
"NvimTree",
|
||||||
"Outline",
|
"Outline",
|
||||||
"DressingInput",
|
"DressingInput",
|
||||||
"toggleterm",
|
"toggleterm",
|
||||||
"lazy",
|
"lazy",
|
||||||
"mason",
|
"mason",
|
||||||
"neo-tree",
|
"neo-tree",
|
||||||
},
|
},
|
||||||
always_divide_middle = true,
|
always_divide_middle = true,
|
||||||
},
|
},
|
||||||
|
|
||||||
sections = {
|
sections = {
|
||||||
lualine_a = { mode },
|
lualine_a = { mode },
|
||||||
lualine_b = { branch },
|
lualine_b = { branch },
|
||||||
lualine_c = { lsp_info, diagnostics, lsp_progress },
|
lualine_c = { lsp_info, diagnostics, lsp_progress },
|
||||||
-- lualine_c = { file_name, lsp_info },
|
-- lualine_c = { file_name, lsp_info },
|
||||||
-- lualine_x = { "encoding", "fileformat", "filetype" },
|
-- lualine_x = { "encoding", "fileformat", "filetype" },
|
||||||
-- lualine_x = { diff, spaces, "encoding", filetype },
|
-- lualine_x = { diff, spaces, "encoding", filetype },
|
||||||
lualine_x = { diff, spaces, filetype },
|
lualine_x = { diff, spaces, filetype },
|
||||||
lualine_y = { location },
|
lualine_y = { location },
|
||||||
--[[ lualine_z = { progress }, ]]
|
--[[ lualine_z = { progress }, ]]
|
||||||
lualine_z = { time },
|
lualine_z = { time },
|
||||||
},
|
},
|
||||||
inactive_sections = {
|
inactive_sections = {
|
||||||
lualine_a = {},
|
lualine_a = {},
|
||||||
lualine_b = {},
|
lualine_b = {},
|
||||||
lualine_c = { "filename" },
|
lualine_c = { "filename" },
|
||||||
lualine_x = { "location" },
|
lualine_x = { "location" },
|
||||||
lualine_y = {},
|
lualine_y = {},
|
||||||
lualine_z = {},
|
lualine_z = {},
|
||||||
},
|
},
|
||||||
tabline = {},
|
tabline = {},
|
||||||
extensions = {},
|
extensions = {},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- lualine.setup({
|
-- lualine.setup({
|
||||||
-- options = {
|
-- options = {
|
||||||
-- icons_enabled = true,
|
-- icons_enabled = true,
|
||||||
-- theme = "auto",
|
-- theme = "auto",
|
||||||
-- component_separators = component_separators,
|
-- component_separators = component_separators,
|
||||||
-- section_separators = section_separators,
|
-- section_separators = section_separators,
|
||||||
-- disabled_filetypes = {
|
-- disabled_filetypes = {
|
||||||
-- "TelescopePrompt",
|
-- "TelescopePrompt",
|
||||||
-- "packer",
|
-- "packer",
|
||||||
-- "alpha",
|
-- "alpha",
|
||||||
-- "dashboard",
|
-- "dashboard",
|
||||||
-- "NvimTree",
|
-- "NvimTree",
|
||||||
-- "Outline",
|
-- "Outline",
|
||||||
-- "DressingInput",
|
-- "DressingInput",
|
||||||
-- "toggleterm",
|
-- "toggleterm",
|
||||||
-- "lazy",
|
-- "lazy",
|
||||||
-- "mason",
|
-- "mason",
|
||||||
-- "neo-tree",
|
-- "neo-tree",
|
||||||
-- },
|
-- },
|
||||||
-- always_divide_middle = true,
|
-- always_divide_middle = true,
|
||||||
-- },
|
-- },
|
||||||
--
|
--
|
||||||
-- sections = {
|
-- sections = {
|
||||||
-- lualine_a = { mode },
|
-- lualine_a = { mode },
|
||||||
-- lualine_b = { branch },
|
-- lualine_b = { branch },
|
||||||
-- lualine_c = { lsp_info, diagnostics, lsp_progress },
|
-- lualine_c = { lsp_info, diagnostics, lsp_progress },
|
||||||
-- -- lualine_c = { file_name, lsp_info },
|
-- -- lualine_c = { file_name, lsp_info },
|
||||||
-- -- lualine_x = { "encoding", "fileformat", "filetype" },
|
-- -- lualine_x = { "encoding", "fileformat", "filetype" },
|
||||||
-- -- lualine_x = { diff, spaces, "encoding", filetype },
|
-- -- lualine_x = { diff, spaces, "encoding", filetype },
|
||||||
-- lualine_x = { diff, spaces, filetype },
|
-- lualine_x = { diff, spaces, filetype },
|
||||||
-- lualine_y = { location },
|
-- lualine_y = { location },
|
||||||
-- --[[ lualine_z = { progress }, ]]
|
-- --[[ lualine_z = { progress }, ]]
|
||||||
-- lualine_z = { time },
|
-- lualine_z = { time },
|
||||||
-- },
|
-- },
|
||||||
-- inactive_sections = {
|
-- inactive_sections = {
|
||||||
-- lualine_a = {},
|
-- lualine_a = {},
|
||||||
-- lualine_b = {},
|
-- lualine_b = {},
|
||||||
-- lualine_c = { "filename" },
|
-- lualine_c = { "filename" },
|
||||||
-- lualine_x = { "location" },
|
-- lualine_x = { "location" },
|
||||||
-- lualine_y = {},
|
-- lualine_y = {},
|
||||||
-- lualine_z = {},
|
-- lualine_z = {},
|
||||||
-- },
|
-- },
|
||||||
-- tabline = {},
|
-- tabline = {},
|
||||||
-- extensions = {},
|
-- extensions = {},
|
||||||
-- })
|
-- })
|
|
@ -207,8 +207,8 @@ nvim_tree.setup({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
notify = {
|
notify = {
|
||||||
-- threshold = vim.log.levels.INFO,
|
threshold = vim.log.levels.INFO,
|
||||||
threshold = vim.log.levels.ERROR,
|
-- threshold = vim.log.levels.ERROR,
|
||||||
},
|
},
|
||||||
log = {
|
log = {
|
||||||
enable = false,
|
enable = false,
|
||||||
|
|
|
@ -18,7 +18,7 @@ if data_exists then
|
||||||
end
|
end
|
||||||
startify.section.header.val = dash_model
|
startify.section.header.val = dash_model
|
||||||
startify.section.top_buttons.val = {
|
startify.section.top_buttons.val = {
|
||||||
startify.button("f", " Find file", ":Telescope find_files <CR>"),
|
startify.button("F", " Find file", ":Telescope find_files <CR>"),
|
||||||
startify.button("e", " New file", ":ene <BAR> startinsert <CR>"),
|
startify.button("e", " New file", ":ene <BAR> startinsert <CR>"),
|
||||||
startify.button("p", " Find project", ":Telescope projects <CR>"),
|
startify.button("p", " Find project", ":Telescope projects <CR>"),
|
||||||
startify.button("r", " Recently used files", ":Telescope oldfiles <CR>"),
|
startify.button("r", " Recently used files", ":Telescope oldfiles <CR>"),
|
||||||
|
|
1642
lua/user/webdevicons_backup.lua
Normal file
1642
lua/user/webdevicons_backup.lua
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue