add: lualine status mode config

This commit is contained in:
asep.komarudin 2024-05-29 16:15:20 +07:00
parent b626bce72a
commit ffbb97621d
3 changed files with 73 additions and 8 deletions

View file

@ -10,7 +10,7 @@
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"code_runner.nvim": { "branch": "main", "commit": "6c5bfe44a6c7523350cd706e6b3b8101166eed99" }, "code_runner.nvim": { "branch": "main", "commit": "6c5bfe44a6c7523350cd706e6b3b8101166eed99" },
"codeium.vim": { "branch": "main", "commit": "289eb724e5d6fab2263e94a1ad6e54afebefafb2" }, "codeium.vim": { "branch": "main", "commit": "289eb724e5d6fab2263e94a1ad6e54afebefafb2" },
"darcula-dark.nvim": { "branch": "main", "commit": "d2b0fc7a27770e5598e5d8a1f60df48e165c9c4e" }, "darcula-dark.nvim": { "branch": "main", "commit": "39f574b3e3efed83812d5c14dce086fee4888edd" },
"dressing.nvim": { "branch": "master", "commit": "572314728cb1ce012e825fd66331f52c94acac12" }, "dressing.nvim": { "branch": "master", "commit": "572314728cb1ce012e825fd66331f52c94acac12" },
"friendly-snippets": { "branch": "main", "commit": "d0610077b6129cf9f7f78afbe3a1425d60f6e2f1" }, "friendly-snippets": { "branch": "main", "commit": "d0610077b6129cf9f7f78afbe3a1425d60f6e2f1" },
"gitsigns.nvim": { "branch": "main", "commit": "76927d14d3fbd4ba06ccb5246e79d93b5442c188" }, "gitsigns.nvim": { "branch": "main", "commit": "76927d14d3fbd4ba06ccb5246e79d93b5442c188" },
@ -37,7 +37,7 @@
"nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" }, "nvim-notify": { "branch": "master", "commit": "d333b6f167900f6d9d42a59005d82919830626bf" },
"nvim-scrollview": { "branch": "main", "commit": "c29c5f69d37040a1fac88cbea7f5e6f06f0aff4d" }, "nvim-scrollview": { "branch": "main", "commit": "c29c5f69d37040a1fac88cbea7f5e6f06f0aff4d" },
"nvim-tree.lua": { "branch": "master", "commit": "2bc725a3ebc23f0172fb0ab4d1134b81bcc13812" }, "nvim-tree.lua": { "branch": "master", "commit": "2bc725a3ebc23f0172fb0ab4d1134b81bcc13812" },
"nvim-treesitter": { "branch": "master", "commit": "ea2b137f35fb1e87a6471ec311805920fdf45745" }, "nvim-treesitter": { "branch": "master", "commit": "b91ae14fc3bb801c7ea69bc283fe860b32b5163d" },
"nvim-treesitter-textobjects": { "branch": "master", "commit": "3557e41418b4a6c5b85d5d64abe94c9c50fa9b14" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "3557e41418b4a6c5b85d5d64abe94c9c50fa9b14" },
"nvim-ts-autotag": { "branch": "main", "commit": "8ae54b90e36ef1fc5267214b30c2cbff71525fe4" }, "nvim-ts-autotag": { "branch": "main", "commit": "8ae54b90e36ef1fc5267214b30c2cbff71525fe4" },
"nvim-ts-context-commentstring": { "branch": "main", "commit": "cb064386e667def1d241317deed9fd1b38f0dc2e" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "cb064386e667def1d241317deed9fd1b38f0dc2e" },
@ -49,7 +49,7 @@
"smart-splits.nvim": { "branch": "master", "commit": "2179ec0d26aacd4f40c766c79f6ebc83b7001e48" }, "smart-splits.nvim": { "branch": "master", "commit": "2179ec0d26aacd4f40c766c79f6ebc83b7001e48" },
"statuscol.nvim": { "branch": "main", "commit": "483b9a596dfd63d541db1aa51ee6ee9a1441c4cc" }, "statuscol.nvim": { "branch": "main", "commit": "483b9a596dfd63d541db1aa51ee6ee9a1441c4cc" },
"tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" }, "tailwindcss-colorizer-cmp.nvim": { "branch": "main", "commit": "3d3cd95e4a4135c250faf83dd5ed61b8e5502b86" },
"telescope.nvim": { "branch": "master", "commit": "2df52609a1632de5d77a0b2416db6ad9cf32e463" }, "telescope.nvim": { "branch": "master", "commit": "90143d31f20e65179308198940f5c5caf4ecdbdf" },
"toggleterm.nvim": { "branch": "main", "commit": "fee58a0473fd92b28c34f8f724e4918b15ba30a3" }, "toggleterm.nvim": { "branch": "main", "commit": "fee58a0473fd92b28c34f8f724e4918b15ba30a3" },
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
"vim-startuptime": { "branch": "master", "commit": "97a88e688482a09c3c4b777d07b509b328a5ec29" }, "vim-startuptime": { "branch": "master", "commit": "97a88e688482a09c3c4b777d07b509b328a5ec29" },

View file

@ -31,6 +31,13 @@ vim.g.pcode_lualinetheme = "roundedall"
-- 2 fidget progress -- 2 fidget progress
vim.g.pcode_progress = 1 vim.g.pcode_progress = 1
-- 0 = on full text mode info,
-- 1 = on initial mode + logo
-- 2 = logo only
-- 3 = initial only
-- 4 = off
vim.g.pcode_show_mode = 3
-- 1 ( format jalan) 0 (fromat off) -- 1 ( format jalan) 0 (fromat off)
vim.g.pcode_format_on_save = 1 vim.g.pcode_format_on_save = 1

View file

@ -27,6 +27,14 @@ local unique_list = function(list)
return result return result
end end
local mode_map = {
["NORMAL"] = "N",
["INSERT"] = "I",
["VISUAL"] = "V",
["REPLACE"] = "R",
["COMMAND"] = "C",
}
return { return {
-- treesitter info -- treesitter info
treesitter = { treesitter = {
@ -127,7 +135,17 @@ return {
padding = 1, padding = 1,
separator = { left = "" }, separator = { left = "" },
fmt = function(str) fmt = function(str)
if vim.g.pcode_show_mode == 1 then
return icons.ui.Neovim .. " " .. (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 2 then
return icons.ui.Neovim
elseif vim.g.pcode_show_mode == 3 then
return (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 4 then
return nil
else
return icons.ui.Neovim .. " " .. str return icons.ui.Neovim .. " " .. str
end
end, end,
}, },
mode_roundedall = { mode_roundedall = {
@ -135,7 +153,17 @@ return {
padding = 1, padding = 1,
separator = { left = "", right = "" }, separator = { left = "", right = "" },
fmt = function(str) fmt = function(str)
if vim.g.pcode_show_mode == 1 then
return icons.ui.Neovim .. " " .. (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 2 then
return icons.ui.Neovim
elseif vim.g.pcode_show_mode == 3 then
return (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 4 then
return nil
else
return icons.ui.Neovim .. " " .. str return icons.ui.Neovim .. " " .. str
end
end, end,
}, },
mode_triangle = { mode_triangle = {
@ -143,7 +171,17 @@ return {
padding = 1, padding = 1,
separator = { left = " ", right = "" }, separator = { left = " ", right = "" },
fmt = function(str) fmt = function(str)
if vim.g.pcode_show_mode == 1 then
return icons.ui.Neovim .. " " .. (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 2 then
return icons.ui.Neovim
elseif vim.g.pcode_show_mode == 3 then
return (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 4 then
return nil
else
return icons.ui.Neovim .. " " .. str return icons.ui.Neovim .. " " .. str
end
end, end,
}, },
mode_parallelogram = { mode_parallelogram = {
@ -151,7 +189,17 @@ return {
padding = 1, padding = 1,
separator = { left = "", right = "" }, separator = { left = "", right = "" },
fmt = function(str) fmt = function(str)
if vim.g.pcode_show_mode == 1 then
return icons.ui.Neovim .. " " .. (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 2 then
return icons.ui.Neovim
elseif vim.g.pcode_show_mode == 3 then
return (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 4 then
return nil
else
return icons.ui.Neovim .. " " .. str return icons.ui.Neovim .. " " .. str
end
end, end,
}, },
@ -160,7 +208,17 @@ return {
padding = 1, padding = 1,
separator = { left = " " }, separator = { left = " " },
fmt = function(str) fmt = function(str)
if vim.g.pcode_show_mode == 1 then
return icons.ui.Neovim .. " " .. (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 2 then
return icons.ui.Neovim
elseif vim.g.pcode_show_mode == 3 then
return (mode_map[str] or str)
elseif vim.g.pcode_show_mode == 4 then
return nil
else
return icons.ui.Neovim .. " " .. str return icons.ui.Neovim .. " " .. str
end
end, end,
}, },