From 7f1637b6e8263e1a45d8ff3b41b660aa114c54e4 Mon Sep 17 00:00:00 2001 From: "asep.komarudin" Date: Thu, 23 May 2024 18:08:15 +0700 Subject: [PATCH] add: lualine template --- lazy-lock.json | 4 +-- lua/custom/default.lua | 4 ++- lua/plugins/lualine.lua | 4 +++ lua/user/utils/lualine_component.lua | 45 +++++++++++++++++++++++++++- lua/user/utils/lualine_template.lua | 38 ++++++++++++++++++++++- 5 files changed, 90 insertions(+), 5 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index a324515..1a72a84 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -14,7 +14,7 @@ "dressing.nvim": { "branch": "master", "commit": "572314728cb1ce012e825fd66331f52c94acac12" }, "friendly-snippets": { "branch": "main", "commit": "dd2fd1281d4b22e7b4a5bfafa3e142d958e251f2" }, "gitsigns.nvim": { "branch": "main", "commit": "76927d14d3fbd4ba06ccb5246e79d93b5442c188" }, - "indent-blankline.nvim": { "branch": "master", "commit": "ece00d5fb44d196680a81fd2761062d2fa44663b" }, + "indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" }, "lazy.nvim": { "branch": "main", "commit": "8f19915175395680808de529e4220da8dafc0759" }, "lsp-progress.nvim": { "branch": "main", "commit": "55a04895ea20c365b670051a3128265d43bdfa3d" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, @@ -37,7 +37,7 @@ "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, "nvim-scrollview": { "branch": "main", "commit": "c29c5f69d37040a1fac88cbea7f5e6f06f0aff4d" }, "nvim-tree.lua": { "branch": "master", "commit": "2bc725a3ebc23f0172fb0ab4d1134b81bcc13812" }, - "nvim-treesitter": { "branch": "master", "commit": "30de5e7e9486fb1b1b8c2a1e71052b13f94f1cb0" }, + "nvim-treesitter": { "branch": "master", "commit": "3e454836ce8350d1f7b780a1a34e5cbfc9ecf715" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "3557e41418b4a6c5b85d5d64abe94c9c50fa9b14" }, "nvim-ts-autotag": { "branch": "main", "commit": "8ae54b90e36ef1fc5267214b30c2cbff71525fe4" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "cb064386e667def1d241317deed9fd1b38f0dc2e" }, diff --git a/lua/custom/default.lua b/lua/custom/default.lua index ea9dbf8..cd585d5 100644 --- a/lua/custom/default.lua +++ b/lua/custom/default.lua @@ -30,8 +30,10 @@ vim.g.pcode_transparent_mode = 0 -- roundedall -- square -- triangle +-- parallelogram +-- transparent -- default -vim.g.pcode_lualinetheme = "roundedall" +vim.g.pcode_lualinetheme = "transparent" -- 0 disable progress -- 1 lualine lsp progress -- 2 fidget progress diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index 845bf9a..7b54e6b 100644 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -52,8 +52,12 @@ return { 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 diff --git a/lua/user/utils/lualine_component.lua b/lua/user/utils/lualine_component.lua index 6c34922..d9523e0 100644 --- a/lua/user/utils/lualine_component.lua +++ b/lua/user/utils/lualine_component.lua @@ -145,11 +145,19 @@ return { return icons.ui.Neovim .. " " .. str end, }, + mode_parallelogram = { + "mode", + padding = 1, + separator = { left = " ", right = "" }, + fmt = function(str) + return icons.ui.Neovim .. " " .. str + end, + }, mode_square = { "mode", padding = 1, - separator = { left = "" }, + separator = { left = " " }, fmt = function(str) return icons.ui.Neovim .. " " .. str end, @@ -215,4 +223,39 @@ return { }, } 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 index 96b86ac..300239d 100644 --- a/lua/user/utils/lualine_template.lua +++ b/lua/user/utils/lualine_template.lua @@ -98,6 +98,7 @@ M.roundedall = function(colorscheme) extensions = {}, } end + M.triangle = function(colorscheme) local mode = component.mode_triangle return { @@ -133,6 +134,41 @@ M.triangle = function(colorscheme) } 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, 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 { @@ -152,7 +188,7 @@ M.square = function(colorscheme) lualine_x = { diagnostics, spaces, treesitter, "filetype" }, lualine_y = { "progress" }, lualine_z = { - { "location", separator = { right = "" }, padding = 1 }, + { "location", separator = { right = " " }, padding = 1 }, }, }, inactive_sections = {