diff --git a/lazy-lock.json b/lazy-lock.json index 33e797f..b5f1793 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -3,11 +3,13 @@ "Eva-Theme.nvim": { "branch": "master", "commit": "902dd17975a7710e544d409ea856dbecc9d64997" }, "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, "alpha-nvim": { "branch": "main", "commit": "bf3c8bb8c02ed3d9644cc5bbc48e2bdc39349cd7" }, + "auto-bufferline.nvim": { "branch": "main", "commit": "5bade2069c8385938c4e6648e3e82317d3be8c57" }, "auto-conform.nvim": { "branch": "main", "commit": "d04389f955dd0990e85a269b226199f458de32a6" }, "auto-lint.nvim": { "branch": "main", "commit": "aff13cb8eaa055e66e940d43b7d83166397e5413" }, "auto-lsp.nvim": { "branch": "main", "commit": "420bd7165d0afd396e05a3ad67ae228c36e2f044" }, + "auto-lualine.nvim": { "branch": "main", "commit": "23aca3375e0bd40dc7ef893167337469de5e82a8" }, "bigfile.nvim": { "branch": "main", "commit": "33eb067e3d7029ac77e081cfe7c45361887a311a" }, - "bufferline.nvim": { "branch": "main", "commit": "0b2fd861eee7595015b6561dade52fb060be10c4" }, + "bufferline.nvim": { "branch": "main", "commit": "5c528bee3dd797d5bd6bae5f229411939b25b203" }, "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, @@ -32,7 +34,7 @@ "noice.nvim": { "branch": "main", "commit": "df448c649ef6bc5a6a633a44f2ad0ed8d4442499" }, "nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" }, "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, - "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" }, "nvim-colorizer.lua": { "branch": "master", "commit": "0671e0eabc6842676d3310370e8fae4e1c51d7f9" }, "nvim-lint": { "branch": "master", "commit": "16b21a7d04d06661f92f273a0744fd81fb19e09e" }, "nvim-lspconfig": { "branch": "master", "commit": "056f569f71e4b726323b799b9cfacc53653bceb3" }, @@ -41,7 +43,7 @@ "nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" }, "nvim-scrollview": { "branch": "main", "commit": "bc37a942debe191fffd072f0f1f2ec7c56c54b17" }, "nvim-tree.lua": { "branch": "master", "commit": "4a9e82d10a3715d0c3845e1d2f66ddfb8b711253" }, - "nvim-treesitter": { "branch": "master", "commit": "a3ca2e60563064cea008555d0b7d031430305b09" }, + "nvim-treesitter": { "branch": "master", "commit": "9210b9a4fa106247333495e19c843710f4d62102" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "0d79d169fcd45a8da464727ac893044728f121d4" }, "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "9c74db656c3d0b1c4392fc89a016b1910539e7c0" }, diff --git a/lua/custom/dashboard.lua b/lua/custom/dashboard.lua index 27076fc..36ede69 100644 --- a/lua/custom/dashboard.lua +++ b/lua/custom/dashboard.lua @@ -8,6 +8,8 @@ pcode.header1 = { [[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]], [[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]], [[ /_/ |___/ ]], + [[ ]], + [[  Powered By  eovim ]], } -- pcode.header2 = { diff --git a/lua/custom/default.lua b/lua/custom/default.lua index f2192bc..9bcfe30 100644 --- a/lua/custom/default.lua +++ b/lua/custom/default.lua @@ -15,7 +15,7 @@ -- darcula-dark -- juliana -- Eva-Dark, Eva-Dark-Italic, Eva-Dark-Bold -pcode.colorscheme = "Eva-Dark-Italic" +pcode.colorscheme = "Eva-Dark" -- 0 =off 1= on pcode.transparent_mode = 0 diff --git a/lua/plugins/_lsp.lua b/lua/plugins/_lsp.lua index b0cebaf..6a10886 100644 --- a/lua/plugins/_lsp.lua +++ b/lua/plugins/_lsp.lua @@ -33,9 +33,9 @@ return { -- border = "none", border = icons.Border, icons = { - package_pending = icons.DotCircle, + package_pending = icons.Pending, package_installed = icons.CheckCircle, - package_uninstalled = icons.BlankCircle, + package_uninstalled = icons.DotCircle, }, keymaps = { -- Keymap to expand a server in the UI diff --git a/lua/plugins/bufferline.lua b/lua/plugins/bufferline.lua index 2865427..188606d 100644 --- a/lua/plugins/bufferline.lua +++ b/lua/plugins/bufferline.lua @@ -2,187 +2,11 @@ return { "akinsho/bufferline.nvim", branch = "main", event = { "BufRead", "InsertEnter", "BufNewFile" }, + dependencies = "pojokcodeid/auto-bufferline.nvim", config = function() - local status_ok, bufferline = pcall(require, "bufferline") - if not status_ok then - return - end - - local icons = pcode.icons - local use_icons = true - - -- get folder name from current directory - local _get_folder_name = function() - local str = vim.fn.fnamemodify(vim.fn.getcwd(), ":t") - return " " .. icons.ui.ProjekFolder .. " " .. str:lower():gsub("^%l", string.upper) .. " " - end - - local function diagnostics_indicator(num, _, diagnostics, _) - local result - local symbols = { - error = icons.diagnostics.Error, - warning = icons.diagnostics.Warning, - info = icons.diagnostics.Information, - } - if not use_icons then - return "(" .. num .. ")" - end - for name, count in pairs(diagnostics) do - if symbols[name] and count > 0 then - table.insert(result, symbols[name] .. " " .. count) - end - end - result = table.concat(result, " ") - return #result > 0 and result or "" - end - vim.opt.termguicolors = true - - bufferline.setup({ - options = { - color_icons = true, - numbers = "none", -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string, - close_command = function(bufnum) - require("user.utils.bufferline").bufremove(bufnum) - end, - right_mouse_command = function(bufnum) - require("user.utils.bufferline").bufremove(bufnum) - end, - -- close_command = "bdelete! %d", - -- right_mouse_command = "bdelete! %d", - left_mouse_command = "buffer %d", - middle_mouse_command = nil, - - indicator_icon = nil, - indicator = { style = "icon", icon = icons.ui.BoldLineLeft }, - buffer_close_icon = icons.ui.Close, - modified_icon = icons.ui.Circle, - close_icon = icons.ui.BoldClose, - left_trunc_marker = icons.ui.ArrowCircleLeft, - right_trunc_marker = icons.ui.ArrowCircleRight, - max_name_length = 30, - max_prefix_length = 30, - tab_size = 21, - diagnostics = false, -- | "nvim_lsp" | "coc", - diagnostics_update_in_insert = false, - diagnostics_indicator = diagnostics_indicator, - offsets = { - { - filetype = "NvimTree", - text = _get_folder_name(), - highlight = "Directory", - text_align = "left", - padding = 1, - }, - { - filetype = "neo-tree", - text = _get_folder_name(), - highlight = "Directory", - text_align = "left", - padding = 1, - }, - { - filetype = "dbui", - text = "", - highlight = "Directory", - text_align = "left", - padding = 1, - }, - }, - show_buffer_icons = true, - show_buffer_close_icons = true, - show_close_icon = true, - show_tab_indicators = true, - persist_buffer_sort = true, -- whether or not custom sorted buffers should persist - separator_style = { "", "" }, -- | "thick" | "thin" | { 'any', 'any' }, - enforce_regular_tabs = true, - always_show_bufferline = true, - }, - highlights = { - fill = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "none", highlight = "TabLine" }, - }, - background = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "none", highlight = "TabLine" }, - }, - buffer_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "none", highlight = "TabLine" }, - }, - close_button = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "none", highlight = "TabLine" }, - }, - close_button_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "none", highlight = "TabLine" }, - }, - tab_selected = { - fg = { attribute = "fg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - tab = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - tab_close = { - -- fg = {attribute='fg',highlight='LspDiagnosticsDefaultError'}, - fg = { attribute = "fg", highlight = "TabLineSel" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - duplicate_selected = { - fg = { attribute = "fg", highlight = "TabLineSel" }, - bg = { attribute = "bg", highlight = "TabLineSel" }, - underline = true, - }, - duplicate_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - underline = true, - }, - duplicate = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - underline = true, - }, - - modified = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - modified_selected = { - fg = { attribute = "fg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - modified_visible = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - - separator = { - fg = { attribute = "bg", highlight = "TabLine" }, - bg = { attribute = "bg", highlight = "TabLine" }, - }, - trunc_marker = { - fg = { attribute = "fg", highlight = "TabLine" }, - bg = { attribute = "none", highlight = "TabLine" }, - }, - separator_selected = { - fg = { attribute = "bg", highlight = "Normal" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - indicator_selected = { - fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - indicator_visible = { - fg = { attribute = "fg", highlight = "LspDiagnosticsDefaultHint" }, - bg = { attribute = "bg", highlight = "Normal" }, - }, - }, - }) + local config = require("auto-bufferline").config() + require("bufferline").setup(config) end, keys = { { "b", "", desc = "  Buffers", mode = "n" }, @@ -197,7 +21,7 @@ return { { "bc", function() - require("user.utils.bufferline").bufremove() + require("auto-bufferline.configs.utils").bufremove() end, desc = "Close current buffer", mode = "n", diff --git a/lua/plugins/database.lua b/lua/plugins/database.lua index 253bf8f..6382ca7 100644 --- a/lua/plugins/database.lua +++ b/lua/plugins/database.lua @@ -51,7 +51,7 @@ if pcode.database then { "D", "", desc = " 󰆼 DBUI" }, { "Dd", "AlphaNvimTreeCloseDBUI", desc = "󰆼 DBUI Open" }, { "Dq", - "DBUICloseBufferLineCloseOthersbd!lua require('user.utils.bufferline').bufremove()Alpha", + "DBUICloseBufferLineCloseOthersbd!lua require('auto-bufferline.configs.utils').bufremove()Alpha", desc = "󰅙 DBUI Close", }, }, diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index b1072b0..8af2b2b 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -1,102 +1,44 @@ return { { - "nvim-lualine/lualine.nvim", + "pojokcodeid/auto-lualine.nvim", event = { "InsertEnter", "BufRead", "BufNewFile" }, + dependencies = { "nvim-lualine/lualine.nvim" }, config = function() - local component = require("user.utils.lualine_component") - local colors = component.colors - - -- check config for theme - local set_theme = "auto" - local bubbles_theme - local color = pcode.colorscheme - switch(color, { - ["tokyonight"] = function() - set_theme = "auto" - end, - ["tokyonight-night"] = function() - set_theme = "auto" - end, - ["tokyonight-storm"] = function() - set_theme = "auto" - end, - ["tokyonight-day"] = function() - set_theme = "auto" - end, - ["tokyonight-moon"] = function() - set_theme = "auto" - end, - ["dracula"] = function() - local clr = require("dracula").colors() - colors.blue = clr.green - colors.black = clr.black - colors.cyan = clr.yellow - set_theme = "bubbles_theme" - end, - ["Eva-Dark"] = function() - colors.skyblue_1 = "#56B7C3" - colors.grey = "#3b4261" - colors.blue = "#98C379" - colors.cyan = "#B0B7C3" - colors.yellow = "#EF973A" - colors.green1 = "#6495EE" - colors.red = "#E06C75" - set_theme = "bubbles_theme" - end, - ["Eva-Dark-Italic"] = function() - colors.skyblue_1 = "#598DEF" - colors.grey = "#3b4261" - colors.blue = "#98C379" - colors.cyan = "#B0B7C3" - colors.yellow = "#EF973A" - colors.green1 = "#56B7C3" - colors.red = "#E06C75" - set_theme = "bubbles_theme" - end, - ["Eva-Dark-Bold"] = function() - colors.skyblue_1 = "#598DEF" - colors.grey = "#3b4261" - colors.blue = "#98C379" - colors.cyan = "#B0B7C3" - colors.yellow = "#EF973A" - colors.green1 = "#56B7C3" - colors.red = "#E06C75" - set_theme = "bubbles_theme" - end, - default = function() - set_theme = "auto" - end, - }) - - bubbles_theme = component.bubbles_theme(colors) - if set_theme == "auto" then - bubbles_theme = vim.fn.fnamemodify("auto", ":t") - end - - local gettheme = require("user.utils.lualine_template") - local theme_option = pcode.lualinetheme or "rounded" - local theme = gettheme.rounded(bubbles_theme) - if theme_option == "rounded" then - theme = gettheme.rounded(bubbles_theme) - elseif theme_option == "roundedall" then - theme = gettheme.roundedall(bubbles_theme) - elseif theme_option == "square" then - theme = gettheme.square(bubbles_theme) - elseif theme_option == "transparent" then - theme = gettheme.square(component.transparent(colors)) - elseif theme_option == "triangle" then - theme = gettheme.triangle(bubbles_theme) - elseif theme_option == "parallelogram" then - theme = gettheme.parallelogram(bubbles_theme) - elseif theme_option == "default" then - theme = {} - end - require("lualine").setup({ - options = theme.options, - sections = theme.sections, - inactive_sections = theme.inactive_sections, - tabline = theme.tabline, - extensions = theme.extensions, + local lualine = require("auto-lualine") + -- tokyonight, tokyonight-night, tokyonight-storm, tokyonight-day, tokyonight-moon + -- gruvbox-baby (default) + -- sonokai, sonokai_atlantis, + -- sonokai_andromeda,sonokai_shusia,sonokai_maia,sonokai_espresso + -- material, material_deepocean, material_palenight, material_lighter, material_darker + -- onedark, onedark_vivid, onedark_dark + -- nord + -- catppuccin, catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha + -- dracula + -- nightfox, dayfox, dawnfox, duskfox, nordfox, terafox, carbonfox + -- github_dark, github_dark_default, github_dark_colorblind, github_dark_dimmed + -- solarized-osaka + -- darcula-dark + -- juliana + -- Eva-Dark, Eva-Dark-Italic, Eva-Dark-Bold + local color = pcode.colorscheme or "auto" + -- rounded + -- roundedall + -- square + -- triangle + -- parallelogram + -- transparent + -- default + local options = pcode.lualinetheme or "roundedall" + -- 0 = on full text mode info, + -- 1 = on initial mode + logo + -- 2 = logo only + -- 3 = initial only + -- 4 = off + local show_mode = pcode.show_mode or 0 + lualine.setup({ + setColor = color, + setOption = options, + setMode = show_mode, }) end, }, diff --git a/lua/user/icons.lua b/lua/user/icons.lua index 5f790df..94d2bff 100644 --- a/lua/user/icons.lua +++ b/lua/user/icons.lua @@ -147,6 +147,7 @@ return { TriangleShortArrowRight = "", TriangleShortArrowUp = "", Neovim = "", + Pending = " ", BlankCircle = " ", CheckCircle = " ", DotCircle = " ", diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index 23c0311..d933d1b 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -13,7 +13,7 @@ end function _CLOSE_BUFFER() local buf = vim.api.nvim_get_current_buf() -- delete current buffer - require("user.utils.bufferline").bufremove(buf) + require("auto-bufferline.configs.utils").bufremove(buf) end function _OPEN_ALACRITTY() diff --git a/lua/user/lsp/config.lua b/lua/user/lsp/config.lua deleted file mode 100644 index d4fe5c7..0000000 --- a/lua/user/lsp/config.lua +++ /dev/null @@ -1,34 +0,0 @@ --- local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer") --- if not status_ok then --- return --- end --- --- local lspconfig = require("lspconfig") --- --- -- local servers = { "jsonls", "sumneko_lua","html","cssls","tsserver"} --- -- local servers = { "jdtls", "yamlls" } --- local servers = {} --- local installer = pcode.lsp_installer or {} --- for _, client in pairs(installer) do --- table.insert(servers, client) --- end --- --- lsp_installer.setup({ --- ensure_installed = servers, --- }) --- --- for _, server in pairs(servers) do --- local opts = { --- on_attach = require("user.lsp.handlers").on_attach, --- capabilities = require("user.lsp.handlers").capabilities, --- } --- local has_custom_opts, server_custom_opts = pcall(require, "user.lsp.settings." .. server) --- if has_custom_opts then --- opts = vim.tbl_deep_extend("force", opts, server_custom_opts) --- end --- lspconfig[server].setup(opts) --- end --- --- -- lspconfig.yamlls.setup({ --- -- fletype = { "yaml", "yaml.docker-compose" }, --- -- }) diff --git a/lua/user/lsp/handlers.lua b/lua/user/lsp/handlers.lua deleted file mode 100644 index 4276cbd..0000000 --- a/lua/user/lsp/handlers.lua +++ /dev/null @@ -1,147 +0,0 @@ --- local M = {} --- --- local status_cmp_ok, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp") --- if not status_cmp_ok then --- return --- end --- --- local lspvitualtext = pcode.lsp_virtualtext or false --- local icons = pcode.icons --- --- M.capabilities = vim.lsp.protocol.make_client_capabilities() --- M.capabilities.textDocument.completion.completionItem.snippetSupport = true --- M.capabilities = cmp_nvim_lsp.default_capabilities(M.capabilities) --- --- M.setup = function() --- local signs = { --- { name = "DiagnosticSignError", text = icons.diagnostics.Error }, --- { name = "DiagnosticSignWarn", text = icons.diagnostics.Warning }, --- { name = "DiagnosticSignHint", text = icons.diagnostics.Hint }, --- { name = "DiagnosticSignInfo", text = icons.diagnostics.Info }, --- } --- --- for _, sign in ipairs(signs) do --- vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = "" }) --- end --- --- local config = { --- virtual_text = lspvitualtext, -- disable virtual text --- signs = { --- active = signs, -- show signs --- }, --- update_in_insert = true, --- underline = true, --- severity_sort = true, --- float = { --- focusable = true, --- style = "minimal", --- border = "rounded", --- source = "always", --- header = "", --- prefix = "", --- }, --- } --- --- vim.diagnostic.config(config) --- --- vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { --- border = "rounded", --- }) --- --- vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { --- border = "rounded", --- }) --- end --- --- local function attach_navic(client, bufnr) --- vim.g.navic_silence = true --- local status_ok, navic = pcall(require, "nvim-navic") --- if not status_ok then --- return --- end --- navic.attach(client, bufnr) --- end --- --- function FORMAT_FILTER(client) --- local filetype = vim.bo.filetype --- local n = require("null-ls") --- local s = require("null-ls.sources") --- local method = n.methods.FORMATTING --- local available_formatters = s.get_available(filetype, method) --- --- if #available_formatters > 0 then --- return client.name == "null-ls" --- elseif client.supports_method("textDocument/formatting") then --- return true --- else --- return false --- end --- end --- --- -- stylua: ignore --- local function lsp_keymaps(bufnr, on_save) --- local opts = { noremap = true, silent = true } --- local keymap = vim.api.nvim_buf_set_keymap --- keymap(bufnr, "n", "gD", "lua vim.lsp.buf.declaration()", opts) --- keymap(bufnr, "n", "gd", "lua vim.lsp.buf.definition()", opts) --- keymap(bufnr, "n", "K", "lua vim.lsp.buf.hover()", opts) --- keymap(bufnr, "n", "gI", "lua vim.lsp.buf.implementation()", opts) --- keymap(bufnr, "n", "gr", "lua vim.lsp.buf.references()", opts) --- keymap(bufnr, "n", "gl", "lua vim.diagnostic.open_float()", opts) --- keymap(bufnr, "n", "lf", "lua vim.lsp.buf.format{ async = true }", opts) --- keymap(bufnr, "n", "li", "LspInfo", opts) --- keymap(bufnr, "n", "lI", "Mason", opts) --- keymap(bufnr, "n", "la", "lua vim.lsp.buf.code_action()", opts) --- keymap(bufnr, "n", "lj", "lua vim.diagnostic.goto_next({buffer=0})", opts) --- keymap(bufnr, "n", "lk", "lua vim.diagnostic.goto_prev({buffer=0})", opts) --- keymap(bufnr, "n", "lr", "lua vim.lsp.buf.rename()", opts) --- keymap(bufnr, "n", "ls", "lua vim.lsp.buf.signature_help()", opts) --- keymap(bufnr, "n", "lq", "lua vim.diagnostic.setloclist()", opts) --- if on_save then --- local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) --- vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) --- vim.api.nvim_create_autocmd("BufWritePre", { --- group = augroup, --- buffer = bufnr, --- callback = function() --- vim.lsp.buf.format({ bufnr = bufnr, timeout_ms = pcode.format_timeout_ms or 5000, filter = FORMAT_FILTER }) --- end, --- }) --- else --- vim.schedule(function() --- pcall(function() --- vim.api.nvim_clear_autocmds({ group = "LspFormatting" }) --- end) --- end) --- end --- end --- M.on_attach = function(client, bufnr) --- attach_navic(client, bufnr) --- if client.name == "tsserver" then --- client.server_capabilities.documentFormattingProvider = false --- end --- --- if client.name == "lua_ls" then --- client.server_capabilities.documentFormattingProvider = false --- end --- --- if client.supports_method("textDocument/inlayHint") then --- -- vim.lsp.inlay_hint.enable(bufnr, true) --- vim.lsp.inlay_hint.enable(true) --- end --- --- local on_save = pcode.format_on_save or false --- -- disable if conform active --- local status, _ = pcall(require, "conform") --- if status then --- on_save = false --- end --- lsp_keymaps(bufnr, on_save) --- local status_ok, illuminate = pcall(require, "illuminate") --- if not status_ok then --- return --- end --- illuminate.on_attach(client) --- end --- --- return M diff --git a/lua/user/lsp/settings_backup/clangd.lua b/lua/user/lsp/settings_backup/clangd.lua deleted file mode 100644 index 93ddd8b..0000000 --- a/lua/user/lsp/settings_backup/clangd.lua +++ /dev/null @@ -1,12 +0,0 @@ -return { - root_dir = require("lspconfig.util").root_pattern( - "build", - "compile_commands.json", - ".git", - "mvnw", - "gradlew", - "pom.xml", - "build.gradle" - ) or vim.loop.cwd() or vim.fn.getcwd(), - singe_file_support = true, -} diff --git a/lua/user/lsp/settings_backup/denols.lua b/lua/user/lsp/settings_backup/denols.lua deleted file mode 100644 index 79765fd..0000000 --- a/lua/user/lsp/settings_backup/denols.lua +++ /dev/null @@ -1,35 +0,0 @@ -return { - -- add cmd - cmd = { "deno", "lsp" }, - -- add file type support - filetypes = { - "javascript", - "javascriptreact", - "javascript.jsx", - "typescript", - "typescriptreact", - "typescript.tsx", - }, - -- add root dir support - root_dir = require("lspconfig.util").root_pattern( - "package.json", - "tsconfig.json", - "jsconfig.json", - "deno.json", - "deno.jsonc", - ".git" - ), - -- add settings - settings = { - deno = { - enable = true, - suggest = { - imports = { - hosts = { - ["https://deno.land"] = true, - }, - }, - }, - }, - }, -} diff --git a/lua/user/lsp/settings_backup/emmet_ls.lua b/lua/user/lsp/settings_backup/emmet_ls.lua deleted file mode 100644 index ae99f39..0000000 --- a/lua/user/lsp/settings_backup/emmet_ls.lua +++ /dev/null @@ -1,24 +0,0 @@ -return { - cmd = { "emmet-ls", "-c", "--stdio" }, - -- add file type support - -- filetypes = { - -- "javascript", - -- "javascriptreact", - -- "javascript.jsx", - -- "typescript", - -- "typescriptreact", - -- "typescript.tsx", - -- "astro", - -- "css", - -- "eruby", - -- "html", - -- "htmldjango", - -- "less", - -- "pug", - -- "sass", - -- "scss", - -- "svelte", - -- "vue" -- }, - -- add dynamic root dir support - root_dir = require("lspconfig.util").root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"), -} diff --git a/lua/user/lsp/settings_backup/eslint.lua b/lua/user/lsp/settings_backup/eslint.lua deleted file mode 100644 index 0f6e237..0000000 --- a/lua/user/lsp/settings_backup/eslint.lua +++ /dev/null @@ -1,20 +0,0 @@ -return { - -- cmd = { "vscode-eslint-language-server", "--stdio" }, -- add file type support - -- filetypes = { - -- "javascript", - -- "javascriptreact", - -- "javascript.jsx", - -- "typescript", - -- "typescriptreact", - -- "typescript.tsx", - -- }, - -- -- add dynamic root dir support - -- root_dir = require("lspconfig.util").root_pattern( - -- "package.json", - -- "tsconfig.json", - -- "jsconfig.json", - -- ".eslintrc.json", - -- ".eslintrc.js", - -- ".eslintrc.cjs" - -- ), -} diff --git a/lua/user/lsp/settings_backup/intelephense.lua b/lua/user/lsp/settings_backup/intelephense.lua deleted file mode 100644 index f4a7dba..0000000 --- a/lua/user/lsp/settings_backup/intelephense.lua +++ /dev/null @@ -1,6 +0,0 @@ -return { - cmd = { "intelephense", "--stdio" }, - filetypes = { "php" }, - root_dir = require("lspconfig.util").root_pattern("composer.json", ".git") or vim.loop.cwd() or vim.fn.getcwd(), - single_file_support = true, -} diff --git a/lua/user/lsp/settings_backup/jdtls.lua b/lua/user/lsp/settings_backup/jdtls.lua deleted file mode 100644 index 9a93c4b..0000000 --- a/lua/user/lsp/settings_backup/jdtls.lua +++ /dev/null @@ -1,22 +0,0 @@ -return { - cmd = { - "jdtls", - "-configuration", - vim.fn.stdpath("cache") .. "/jdtls/config", - "-data", - vim.fn.stdpath("cache") .. "/jdtls/workspace", - }, - filetypes = { "java" }, - root_dir = require("lspconfig.util").root_pattern( - -- Single-module projects - { - "build.xml", -- Ant - "pom.xml", -- Maven - "settings.gradle", -- Gradle - "settings.gradle.kts", -- Gradle - }, - -- Multi-module projects - { "build.gradle", "build.gradle.kts" } - ) or vim.fn.getcwd(), - singe_file_support = true, -} diff --git a/lua/user/lsp/settings_backup/jsonls.lua b/lua/user/lsp/settings_backup/jsonls.lua deleted file mode 100644 index 16d1873..0000000 --- a/lua/user/lsp/settings_backup/jsonls.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - settings = { - json = { - schemas = require("schemastore").json.schemas(), - }, - }, - setup = { - commands = { - Format = { - function() - vim.lsp.buf.range_formatting({}, { 0, 0 }, { vim.fn.line("$"), 0 }) - end, - }, - }, - }, - init_options = { - provideFormatter = false, - }, -} diff --git a/lua/user/lsp/settings_backup/kotlin_language_server.lua b/lua/user/lsp/settings_backup/kotlin_language_server.lua deleted file mode 100644 index fc80c4e..0000000 --- a/lua/user/lsp/settings_backup/kotlin_language_server.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - cmd = { "kotlin-language-server" }, - filetypes = { "kotlin" }, - root_dir = require("lspconfig.util").root_pattern( - "build.gradle.kts", - "build.gradle", - "settings.gradle", - "gradlew", - "pom.xml", - "build.gradle.kts", - "build.kts", - ".git" - ), - singe_file_support = true, -} diff --git a/lua/user/lsp/settings_backup/lua_ls.lua b/lua/user/lsp/settings_backup/lua_ls.lua deleted file mode 100644 index f711a41..0000000 --- a/lua/user/lsp/settings_backup/lua_ls.lua +++ /dev/null @@ -1,41 +0,0 @@ --- https://luals.github.io/wiki/settings/ -return { - settings = { - Lua = { - format = { - enable = false, - }, - diagnostics = { - globals = { "vim", "spec" }, - }, - runtime = { - version = "LuaJIT", - special = { - spec = "require", - }, - }, - -- workspace = { - -- checkThirdParty = false, - -- library = { - -- [vim.fn.expand("$VIMRUNTIME/lua")] = true, - -- [vim.fn.stdpath("config") .. "/lua"] = true, - -- }, - -- }, - workspace = { - checkThirdParty = false, - }, - hint = { - enable = false, - arrayIndex = "Disable", -- "Enable" | "Auto" | "Disable" - await = true, - paramName = "Disable", -- "All" | "Literal" | "Disable" - paramType = true, - semicolon = "All", -- "All" | "SameLine" | "Disable" - setType = false, - }, - telemetry = { - enable = false, - }, - }, - }, -} diff --git a/lua/user/lsp/settings_backup/pyright.lua b/lua/user/lsp/settings_backup/pyright.lua deleted file mode 100644 index c2a518d..0000000 --- a/lua/user/lsp/settings_backup/pyright.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - settings = { - python = { - analysis = { - typeCheckingMode = "off", - }, - }, - }, -} diff --git a/lua/user/lsp/settings_backup/sqlls.lua b/lua/user/lsp/settings_backup/sqlls.lua deleted file mode 100644 index 8dfeaaa..0000000 --- a/lua/user/lsp/settings_backup/sqlls.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - -- cmd = { "sql-language-server", "up", "--method", "stdio" }, - -- filetypes = { "sql", "mysql" }, - -- -- add root dir support - -- root_dir = require("lspconfig.util").root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git") - -- or vim.loop.cwd() - -- or vim.fn.getcwd(), -} diff --git a/lua/user/lsp/settings_backup/stimulus_ls.lua b/lua/user/lsp/settings_backup/stimulus_ls.lua deleted file mode 100644 index 682198d..0000000 --- a/lua/user/lsp/settings_backup/stimulus_ls.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - filetypes = { "blade" }, - root_dir = require("lspconfig.util").root_pattern("composer.json", ".git") or vim.loop.cwd() or vim.fn.getcwd(), - singe_file_support = true, -} diff --git a/lua/user/lsp/settings_backup/tailwindcss.lua b/lua/user/lsp/settings_backup/tailwindcss.lua deleted file mode 100644 index 36d5cf9..0000000 --- a/lua/user/lsp/settings_backup/tailwindcss.lua +++ /dev/null @@ -1,92 +0,0 @@ -return { - -- cmd = { "tailwindcss-language-server", "--stdio" }, - -- filetypes = { - -- "aspnetcorerazor", - -- "astro", - -- "astro-markdown", - -- "blade", - -- "clojure", - -- "django-html", - -- "htmldjango", - -- "edge", - -- "eelixir", - -- "elixir", - -- "ejs", - -- "erb", - -- "eruby", - -- "gohtml", - -- "gohtmltmpl", - -- "haml", - -- "handlebars", - -- "hbs", - -- "html", - -- "html-eex", - -- "heex", - -- "jade", - -- "leaf", - -- "liquid", - -- "markdown", - -- "mdx", - -- "mustache", - -- "njk", - -- "nunjucks", - -- "php", - -- "razor", - -- "slim", - -- "twig", - -- "css", - -- "less", - -- "postcss", - -- "sass", - -- "scss", - -- "stylus", - -- "sugarss", - -- "javascript", - -- "javascriptreact", - -- "reason", - -- "rescript", - -- "typescript", - -- "typescriptreact", - -- "vue", - -- "svelte", - -- "templ", - -- }, - -- -- init options - -- init_options = { - -- userLanguages = { - -- eelixir = "html-eex", - -- eruby = "erb", - -- templ = "html", - -- }, - -- }, - -- -- root dir - -- root_dir = root_pattern( - -- "tailwind.config.js", - -- "tailwind.config.cjs", - -- "tailwind.config.mjs", - -- "tailwind.config.ts", - -- "postcss.config.js", - -- "postcss.config.cjs", - -- "postcss.config.mjs", - -- "postcss.config.ts", - -- "package.json", - -- "node_modules", - -- ".git" - -- ), - -- -- settings - -- settings = { - -- tailwindCSS = { - -- classAttributes = { "class", "className", "class:list", "classList", "ngClass" }, - -- lint = { - -- cssConflict = "warning", - -- invalidApply = "error", - -- invalidConfigPath = "error", - -- invalidScreen = "error", - -- invalidTailwindDirective = "error", - -- invalidVariant = "error", - -- recommendedVariantOrder = "warning", - -- }, - -- validate = true, - -- }, - -- }, -} diff --git a/lua/user/lsp/settings_backup/tsserver.lua b/lua/user/lsp/settings_backup/tsserver.lua deleted file mode 100644 index fc2aad7..0000000 --- a/lua/user/lsp/settings_backup/tsserver.lua +++ /dev/null @@ -1,18 +0,0 @@ -return { - -- add cmd - cmd = { "typescript-language-server", "--stdio" }, - -- add file type support - filetypes = { - "javascript", - "javascriptreact", - "javascript.jsx", - "typescript", - "typescriptreact", - "typescript.tsx", - }, - -- add dynamic root dir support - root_dir = require("lspconfig.util").root_pattern("package.json", "tsconfig.json", "jsconfig.json", ".git"), - init_options = { - hostInfo = "neovim", - }, -} diff --git a/lua/user/lsp/settings_backup/vuels.lua b/lua/user/lsp/settings_backup/vuels.lua deleted file mode 100644 index 7785af8..0000000 --- a/lua/user/lsp/settings_backup/vuels.lua +++ /dev/null @@ -1,25 +0,0 @@ -local opts = { - setup = { - root_dir = require("lspconfig.util").root_pattern("package.json", "vue.config.js") - or vim.loop.cwd() - or vim.fn.getcwd(), - init_options = { - config = { - vetur = { - completion = { - autoImport = true, - tagCasing = "kebab", - useScaffoldSnippets = true, - }, - useWorkspaceDependencies = true, - validation = { - script = true, - style = true, - template = true, - }, - }, - }, - }, - }, -} -return opts diff --git a/lua/user/lsp/settings_backup/yamlls.lua b/lua/user/lsp/settings_backup/yamlls.lua deleted file mode 100644 index 1f94e4e..0000000 --- a/lua/user/lsp/settings_backup/yamlls.lua +++ /dev/null @@ -1,16 +0,0 @@ -local opts = { - settings = { - yaml = { - hover = true, - completion = true, - validate = true, - schemaStore = { - enable = true, - url = "https://www.schemastore.org/api/json/catalog.json", - }, - schemas = require("schemastore").yaml.schemas(), - }, - }, -} - -return opts diff --git a/lua/user/startify.lua b/lua/user/startify.lua index a40cbf8..305d9fc 100644 --- a/lua/user/startify.lua +++ b/lua/user/startify.lua @@ -7,6 +7,7 @@ dash_model = { [[ / _ / _ \ / / _ \/ '_/ / __/ _ / _ / -_) ]], [[ / .__\_____/ /\___/_/\_\ \__/\___\_,_/\__/ ]], [[ /_/ |___/ ]], + [[  Powered By  eovim ]], } local board = pcode.header1 @@ -53,7 +54,21 @@ vim.api.nvim_create_autocmd("User", { startify.section.footer.val = { { type = "text", - val = { footer_text .. " " .. stats.loaded .. "/" .. stats.count .. " plugins  in " .. ms .. "ms" }, + val = { + "───────────────────────────────────────────────", + }, + }, + { + type = "text", + val = { + " " .. footer_text .. " " .. stats.loaded .. "/" .. stats.count .. " plugins  in " .. ms .. "ms", + }, + }, + { + type = "text", + val = { + "───────────────────────────────────────────────", + }, }, } pcall(vim.cmd.AlphaRedraw) diff --git a/lua/user/utils/formatter.lua b/lua/user/utils/formatter.lua deleted file mode 100644 index 1fba9cb..0000000 --- a/lua/user/utils/formatter.lua +++ /dev/null @@ -1,20 +0,0 @@ -local ok, null_ls = pcall(require, "null-ls") -local M = {} - -M.list_registered = function(filetype) - if ok then - local method = null_ls.methods.FORMATTING - local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype) - return registered_providers[method] or {} - else - return {} - end -end - -M.list_registered_all = function() - local registered_providers = require("user.utils.lsp").list_all_registerd() - local method = null_ls.methods.FORMATTING - return registered_providers[method] or {} -end - -return M diff --git a/lua/user/utils/linter.lua b/lua/user/utils/linter.lua deleted file mode 100644 index 5fbb7b5..0000000 --- a/lua/user/utils/linter.lua +++ /dev/null @@ -1,27 +0,0 @@ -local ok, null_ls = pcall(require, "null-ls") -local M = {} - -if ok then - M.alternative_methods = { - null_ls.methods.DIAGNOSTICS, - null_ls.methods.DIAGNOSTICS_ON_OPEN, - null_ls.methods.DIAGNOSTICS_ON_SAVE, - } -else - M.alternative_methods = {} -end - -M.linter_list_registered = function(filetype) - if ok then - local registered_providers = require("user.utils.lsp").list_registered_providers_names(filetype) - local providers_for_methods = vim.iter(vim.tbl_map(function(m) - return registered_providers[m] or {} - end, M.alternative_methods)) - - return providers_for_methods - else - return {} - end -end - -return M diff --git a/lua/user/utils/lsp.lua b/lua/user/utils/lsp.lua deleted file mode 100644 index 7f5cdd7..0000000 --- a/lua/user/utils/lsp.lua +++ /dev/null @@ -1,29 +0,0 @@ -local M = {} - -M.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 - -M.list_all_registerd = function() - local s = require("null-ls.sources") - local available_sources = s.get_all() - 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 - -return M diff --git a/lua/user/utils/lualine_component.lua b/lua/user/utils/lualine_component.lua deleted file mode 100644 index 1781a4d..0000000 --- a/lua/user/utils/lualine_component.lua +++ /dev/null @@ -1,398 +0,0 @@ -local hide_in_width = function() - return vim.fn.winwidth(0) > 75 -end -local icons = require("user.icons") -local formatter = require("user.utils.formatter") -local linter = require("user.utils.linter") - -local getLeftSubstring = function(word, length) - if #word > length then - return string.sub(word, 1, length) .. "..." - else - return word - end -end - -local unique_list = function(list) - local seen = {} - local result = {} - - for _, val in ipairs(list) do - if not seen[val] then - table.insert(result, val) - seen[val] = true - end - end - - return result -end - -local mode_map = { - ["NORMAL"] = "N", - ["INSERT"] = "I", - ["VISUAL"] = "V", - ["REPLACE"] = "R", - ["COMMAND"] = "C", - ["O-PENDING"] = "O", -} - -return { - -- treesitter info - treesitter = { - function() - -- return icons.ui.Paint .. " TS" - return icons.ui.Tree - end, - color = function() - local buf = vim.api.nvim_get_current_buf() - local ts = vim.treesitter.highlighter.active[buf] - return { fg = ts and not vim.tbl_isempty(ts) and "#98C379" or "#E06C75" } - end, - cond = hide_in_width, - }, - - codeium = { - function() - if pcode.codeium then - local codeium = all_trim(vim.api.nvim_call_function("codeium#GetStatusString", {})) - if codeium then - if codeium == "OFF" then - return icons.kind.CopilotOff - else - return icons.kind.Copilot - end - else - return "" - end - else - return "" - end - end, - color = function() - if pcode.codeium then - local codeium = all_trim(vim.api.nvim_call_function("codeium#GetStatusString", {})) - return { fg = codeium == "OFF" and "#3E4452" or "#98C379" } - else - return {} - end - end, - cond = hide_in_width, - }, - - -- Lsp info - lsp_info = { - function() - local msg = "LSP Inactive" - local buf_ft = vim.bo.filetype - -- start register - local buf_clients = {} - buf_clients = vim.lsp.get_clients({ bufnr = 0 }) - 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 "LSP Inactive" - end - -- return msg - table.insert(buf_client_names, 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 = formatter.list_registered(buf_ft) - vim.list_extend(buf_client_names, supported_formatters) - - -- add conform.nvim - local status, conform = pcall(require, "conform") - if status and supported_formatters and #supported_formatters == 0 then - local formatters = conform.list_formatters_for_buffer() - if formatters and #formatters > 0 then - vim.list_extend(buf_client_names, formatters) - elseif supported_formatters and #supported_formatters == 0 then - -- check if lspformat - local lsp_format = require("conform.lsp_format") - local bufnr = vim.api.nvim_get_current_buf() - local lsp_clients = lsp_format.get_format_clients({ bufnr = bufnr }) - - if not vim.tbl_isempty(lsp_clients) then - table.insert(buf_client_names, "lsp_fmt") - end - end - elseif not status and supported_formatters and #supported_formatters == 0 then - table.insert(buf_client_names, "lsp_fmt") - end - - -- add linter - local supported_linters = linter.linter_list_registered(buf_ft) - vim.list_extend(buf_client_names, supported_linters) - - -- cek nvimlint - local lint_s, lint = pcall(require, "lint") - if lint_s then - for ft_k, ft_v in pairs(lint.linters_by_ft) do - if type(ft_v) == "table" then - for _, ltr in ipairs(ft_v) do - if buf_ft == ft_k then - table.insert(buf_client_names, ltr) - end - end - elseif type(ft_v) == "string" then - if buf_ft == ft_k then - table.insert(buf_client_names, ft_v) - end - end - end - end - - -- decomple - -- local unique_client_names = vim.fn.uniq(buf_client_names) - local unique_client_names = unique_list(buf_client_names) - msg = table.concat(unique_client_names, ", ") - return msg - end, - icon = icons.ui.Gear .. "", - padding = 1, - cond = hide_in_width, - }, - - -- diagnostics info - diagnostics = { - "diagnostics", - sources = { "nvim_diagnostic" }, - sections = { "error", "warn" }, - symbols = { - error = icons.diagnostics.BoldError .. " ", - warn = icons.diagnostics.BoldWarning .. " ", - }, - colored = true, - update_in_insert = false, - always_visible = false, - }, - - -- git info - diff = { - "diff", - colored = true, - symbols = { - added = icons.git.LineAdded .. " ", - modified = icons.git.LineModified .. " ", - removed = icons.git.LineRemoved .. " ", - }, - cond = hide_in_width, - }, - - -- tab info - spaces = { - function() - -- local shiftwidth = vim.api.nvim_buf_get_option(0, "shiftwidth") - -- local shiftwidth = vim.api.nvim_get_option_value("shiftwidth", { scope = "buf", bufnr = 0 }) - local shiftwidth = vim.fn.shiftwidth() - return icons.ui.Tab .. " " .. shiftwidth - end, - padding = 1, - }, - - -- nvim mode info - mode_rounded = { - "mode", - padding = 1, - separator = { left = " " }, - fmt = function(str) - if pcode.show_mode == 1 then - return icons.ui.Neovim .. " " .. (mode_map[str] or str) - elseif pcode.show_mode == 2 then - return icons.ui.Neovim - elseif pcode.show_mode == 3 then - return (mode_map[str] or str) - elseif pcode.show_mode == 4 then - return nil - else - return icons.ui.Neovim .. " " .. str - end - end, - }, - mode_roundedall = { - "mode", - padding = 1, - separator = { left = " ", right = "" }, - fmt = function(str) - if pcode.show_mode == 1 then - return icons.ui.Neovim .. " " .. str:sub(1, 1) - elseif pcode.show_mode == 2 then - return icons.ui.Neovim - elseif pcode.show_mode == 3 then - return str:sub(1, 1) - elseif pcode.show_mode == 4 then - return nil - else - return icons.ui.Neovim .. " " .. str - end - end, - }, - mode_triangle = { - "mode", - padding = 1, - separator = { left = " ", right = "" }, - fmt = function(str) - if pcode.show_mode == 1 then - return icons.ui.Neovim .. " " .. (mode_map[str] or str) - elseif pcode.show_mode == 2 then - return icons.ui.Neovim - elseif pcode.show_mode == 3 then - return (mode_map[str] or str) - elseif pcode.show_mode == 4 then - return nil - else - return icons.ui.Neovim .. " " .. str - end - end, - }, - mode_parallelogram = { - "mode", - padding = 1, - separator = { left = " ", right = "" }, - fmt = function(str) - if pcode.show_mode == 1 then - return icons.ui.Neovim .. " " .. (mode_map[str] or str) - elseif pcode.show_mode == 2 then - return icons.ui.Neovim - elseif pcode.show_mode == 3 then - return (mode_map[str] or str) - elseif pcode.show_mode == 4 then - return nil - else - return icons.ui.Neovim .. " " .. str - end - end, - }, - - mode_square = { - "mode", - padding = 1, - separator = { left = " " }, - fmt = function(str) - if pcode.show_mode == 1 then - return icons.ui.Neovim .. " " .. (mode_map[str] or str) - elseif pcode.show_mode == 2 then - return icons.ui.Neovim - elseif pcode.show_mode == 3 then - return (mode_map[str] or str) - elseif pcode.show_mode == 4 then - return nil - else - return icons.ui.Neovim .. " " .. str - end - end, - }, - - path = { - "filename", - file_status = true, - path = 1, - fmt = function(str) - return "[" .. str .. "]" - end, - cond = hide_in_width, - }, - - -- git branch info - get_branch = function() - if vim.b.gitsigns_head ~= nil then - return icons.git.Branch3 .. " " .. getLeftSubstring(vim.b.gitsigns_head, 6) - else - return icons.git.NoBranch .. vim.fn.fnamemodify("", ":t") - end - end, - - -- default colorscheme - 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", - }, - - -- default lualine theme - bubbles_theme = function(colors) - return { - normal = { - a = { fg = colors.black, bg = colors.skyblue_1 }, - b = { fg = colors.skyblue_1, 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 }, - }, - } - end, - transparent = function(colors) - return { - normal = { - a = { fg = colors.skyblue_1, bg = colors.black_transparant }, - b = { fg = colors.white, bg = colors.black_transparant }, - c = { fg = colors.white, bg = colors.black_transparant }, - }, - - insert = { - a = { fg = colors.blue, bg = colors.black_transparant }, - b = { fg = colors.white, bg = colors.black_transparant }, - }, - visual = { - a = { fg = colors.cyan, bg = colors.black_transparant }, - b = { fg = colors.white, bg = colors.black_transparant }, - }, - replace = { - a = { bg = colors.black_transparant, fg = colors.red }, - b = { bg = colors.black_transparant, fg = colors.white }, - }, - command = { - a = { bg = colors.black_transparant, fg = colors.yellow }, - b = { bg = colors.black_transparant, fg = colors.white }, - }, - terminal = { - a = { bg = colors.black_transparant, fg = colors.green1 }, - b = { bg = colors.black_transparant, fg = colors.white }, - }, - 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 }, - }, - } - end, -} diff --git a/lua/user/utils/lualine_template.lua b/lua/user/utils/lualine_template.lua deleted file mode 100644 index adf845c..0000000 --- a/lua/user/utils/lualine_template.lua +++ /dev/null @@ -1,212 +0,0 @@ -local M = {} - -local component = require("user.utils.lualine_component") -local treesitter = component.treesitter -local lsp_info = component.lsp_info -local diagnostics = component.diagnostics -local diff = component.diff -local spaces = component.spaces -local get_branch = component.get_branch -local lsp_progress = {} -local data_ok, lspprogress = pcall(require, "lsp-progress") -if data_ok then - lsp_progress = lspprogress.progress -end -local codeium = component.codeium - -M.filetype = { - "TelescopePrompt", - "packer", - "alpha", - "dashboard", - "NvimTree", - "Outline", - "DressingInput", - "toggleterm", - "lazy", - "mason", - "neo-tree", - "startuptime", - "crunner", - "lspinfo", - "mysql", - "dbui", - "dbout", -} - -M.rounded = function(colorscheme) - local mode = component.mode_rounded - return { - options = { - theme = colorscheme, - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = M.filetype, - always_divide_middle = true, - }, - sections = { - lualine_a = { - mode, - }, - lualine_b = { get_branch }, - lualine_c = { diff, lsp_info, lsp_progress }, - lualine_x = { diagnostics, spaces, codeium, treesitter, "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 - -M.roundedall = function(colorscheme) - local mode = component.mode_roundedall - return { - options = { - theme = colorscheme, - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = M.filetype, - always_divide_middle = true, - }, - sections = { - lualine_a = { - mode, - }, - lualine_b = { get_branch }, - lualine_c = { diff, lsp_info, lsp_progress }, - lualine_x = { diagnostics, spaces, codeium, treesitter, "filetype" }, - lualine_y = { "progress" }, - lualine_z = { - { "location", separator = { right = " ", left = "" }, padding = 1 }, - }, - }, - inactive_sections = { - lualine_a = { "filename" }, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = { "location" }, - }, - tabline = {}, - extensions = {}, - } -end - -M.triangle = function(colorscheme) - local mode = component.mode_triangle - return { - options = { - theme = colorscheme, - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = M.filetype, - always_divide_middle = true, - }, - sections = { - lualine_a = { - mode, - }, - lualine_b = { get_branch }, - lualine_c = { diff, lsp_info, lsp_progress }, - lualine_x = { diagnostics, spaces, codeium, treesitter, "filetype" }, - lualine_y = { "progress" }, - lualine_z = { - { "location", separator = { right = " ", left = "" }, padding = 1 }, - }, - }, - inactive_sections = { - lualine_a = { "filename" }, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = { "location" }, - }, - tabline = {}, - extensions = {}, - } -end - -M.parallelogram = function(colorscheme) - local mode = component.mode_parallelogram - return { - options = { - theme = colorscheme, - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = M.filetype, - always_divide_middle = true, - }, - sections = { - lualine_a = { - mode, - }, - lualine_b = { get_branch }, - lualine_c = { diff, lsp_info, lsp_progress }, - lualine_x = { diagnostics, spaces, codeium, treesitter, "filetype" }, - lualine_y = { "progress" }, - lualine_z = { - { "location", separator = { right = " ", left = "" }, padding = 1 }, - }, - }, - inactive_sections = { - lualine_a = { "filename" }, - lualine_b = {}, - lualine_c = {}, - lualine_x = {}, - lualine_y = {}, - lualine_z = { "location" }, - }, - tabline = {}, - extensions = {}, - } -end - -M.square = function(colorscheme) - local mode = component.mode_square - return { - options = { - theme = colorscheme, - component_separators = { left = "", right = "" }, - section_separators = { left = "", right = "" }, - disabled_filetypes = M.filetype, - always_divide_middle = true, - }, - sections = { - lualine_a = { - mode, - }, - lualine_b = { get_branch }, - lualine_c = { diff, lsp_info, lsp_progress }, - lualine_x = { diagnostics, spaces, codeium, treesitter, "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 - -return M diff --git a/lua/user/utils/whichkey.lua b/lua/user/utils/whichkey.lua index ea6a98b..c9529b8 100644 --- a/lua/user/utils/whichkey.lua +++ b/lua/user/utils/whichkey.lua @@ -74,7 +74,7 @@ end function M._CLOSE_BUFFER() local buf = vim.api.nvim_get_current_buf() -- delete current buffer - require("user.utils.bufferline").bufremove(buf) + require("auto-bufferline.configs.utils").bufremove(buf) end -- function for close all bufferline @@ -83,7 +83,7 @@ function M._CLOSE_ALL_BUFFER() local bufs = vim.api.nvim_list_bufs() -- loop through all buffer for _, buf in pairs(bufs) do - require("user.utils.bufferline").bufremove(buf) + require("auto-bufferline.configs.utils").bufremove(buf) end end