feat: fennelize lualine config
This commit is contained in:
parent
80db042c04
commit
d8a313d192
2 changed files with 82 additions and 76 deletions
58
fnl/plugins/lualine.fnl
Normal file
58
fnl/plugins/lualine.fnl
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
{1 :lualine.nvim
|
||||||
|
:after (fn []
|
||||||
|
((. (require :lualine) :setup) {:extensions {}
|
||||||
|
:inactive_sections {:lualine_a {}
|
||||||
|
:lualine_b {}
|
||||||
|
:lualine_c [:filename]
|
||||||
|
:lualine_x [:location]
|
||||||
|
:lualine_y {}
|
||||||
|
:lualine_z {}}
|
||||||
|
:inactive_winbar {}
|
||||||
|
:options {:always_divide_middle true
|
||||||
|
:component_separators {:left ""
|
||||||
|
:right ""}
|
||||||
|
:disabled_filetypes {:statusline [:ministarter]
|
||||||
|
:winbar {}}
|
||||||
|
:globalstatus true
|
||||||
|
:icons_enabled true
|
||||||
|
:ignore_focus {}
|
||||||
|
:refresh {:statusline 1000
|
||||||
|
:tabline 1000
|
||||||
|
:winbar 1000}
|
||||||
|
:section_separators {:left ""
|
||||||
|
:right ""}
|
||||||
|
:theme :auto}
|
||||||
|
:sections {:lualine_a [:branch]
|
||||||
|
:lualine_b [:filetype]
|
||||||
|
:lualine_c [:progress
|
||||||
|
(fn []
|
||||||
|
((. (require :lz.n)
|
||||||
|
:trigger_load) :lsp-progress)
|
||||||
|
((. (require :lsp-progress)
|
||||||
|
:progress)))]
|
||||||
|
:lualine_x [(fn []
|
||||||
|
(local (ok pomo)
|
||||||
|
(pcall require
|
||||||
|
:pomo))
|
||||||
|
(when (not ok)
|
||||||
|
(lua "return \"\""))
|
||||||
|
(local timer
|
||||||
|
(pomo.get_first_to_finish))
|
||||||
|
(when (= timer
|
||||||
|
nil)
|
||||||
|
(lua "return \"\""))
|
||||||
|
(.. " "
|
||||||
|
(tostring timer)))
|
||||||
|
:encoding
|
||||||
|
:fileformat]
|
||||||
|
:lualine_y [:diff
|
||||||
|
:diagnostics]
|
||||||
|
:lualine_z [:location]}
|
||||||
|
:tabline {}
|
||||||
|
:winbar {}})
|
||||||
|
(vim.api.nvim_create_augroup :lualine_augroup {:clear true})
|
||||||
|
(vim.api.nvim_create_autocmd :User
|
||||||
|
{:callback (. (require :lualine)
|
||||||
|
:refresh)
|
||||||
|
:group :lualine_augroup
|
||||||
|
:pattern :LspProgressStatusUpdated}))}
|
100
lua/plugins/lualine.lua
generated
100
lua/plugins/lualine.lua
generated
|
@ -1,76 +1,24 @@
|
||||||
return {
|
-- [nfnl] Compiled from ./fnl/plugins/lualine.fnl by https://github.com/Olical/nfnl, do not edit.
|
||||||
"lualine.nvim",
|
local function _1_()
|
||||||
after = function()
|
local function _2_()
|
||||||
require("lualine").setup({
|
require("lz.n").trigger_load("lsp-progress")
|
||||||
options = {
|
return require("lsp-progress").progress()
|
||||||
icons_enabled = true,
|
end
|
||||||
theme = "auto",
|
local function _3_()
|
||||||
component_separators = { left = "", right = "" },
|
local ok, pomo = pcall(require, "pomo")
|
||||||
section_separators = { left = "", right = "" },
|
if not ok then
|
||||||
disabled_filetypes = {
|
return ""
|
||||||
statusline = { "ministarter" },
|
else
|
||||||
winbar = {},
|
end
|
||||||
},
|
local timer = pomo.get_first_to_finish()
|
||||||
ignore_focus = {},
|
if (timer == nil) then
|
||||||
always_divide_middle = true,
|
return ""
|
||||||
globalstatus = true,
|
else
|
||||||
refresh = {
|
end
|
||||||
statusline = 1000,
|
return ("\243\176\132\137 " .. tostring(timer))
|
||||||
tabline = 1000,
|
end
|
||||||
winbar = 1000,
|
require("lualine").setup({extensions = {}, inactive_sections = {lualine_a = {}, lualine_b = {}, lualine_c = {"filename"}, lualine_x = {"location"}, lualine_y = {}, lualine_z = {}}, inactive_winbar = {}, options = {always_divide_middle = true, component_separators = {left = "\238\130\177", right = "\238\130\179"}, disabled_filetypes = {statusline = {"ministarter"}, winbar = {}}, globalstatus = true, icons_enabled = true, ignore_focus = {}, refresh = {statusline = 1000, tabline = 1000, winbar = 1000}, section_separators = {left = "\238\130\180", right = "\238\130\182"}, theme = "auto"}, sections = {lualine_a = {"branch"}, lualine_b = {"filetype"}, lualine_c = {"progress", _2_}, lualine_x = {_3_, "encoding", "fileformat"}, lualine_y = {"diff", "diagnostics"}, lualine_z = {"location"}}, tabline = {}, winbar = {}})
|
||||||
},
|
vim.api.nvim_create_augroup("lualine_augroup", {clear = true})
|
||||||
},
|
return vim.api.nvim_create_autocmd("User", {callback = require("lualine").refresh, group = "lualine_augroup", pattern = "LspProgressStatusUpdated"})
|
||||||
sections = {
|
end
|
||||||
lualine_a = { "branch" },
|
return {"lualine.nvim", after = _1_}
|
||||||
lualine_b = {
|
|
||||||
"filetype",
|
|
||||||
},
|
|
||||||
lualine_c = {
|
|
||||||
"progress",
|
|
||||||
function()
|
|
||||||
require("lz.n").trigger_load("lsp-progress")
|
|
||||||
return require("lsp-progress").progress()
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
lualine_x = {
|
|
||||||
function()
|
|
||||||
local ok, pomo = pcall(require, "pomo")
|
|
||||||
if not ok then
|
|
||||||
return ""
|
|
||||||
end
|
|
||||||
|
|
||||||
local timer = pomo.get_first_to_finish()
|
|
||||||
if timer == nil then
|
|
||||||
return ""
|
|
||||||
end
|
|
||||||
|
|
||||||
return " " .. tostring(timer)
|
|
||||||
end,
|
|
||||||
"encoding",
|
|
||||||
"fileformat",
|
|
||||||
},
|
|
||||||
lualine_y = { "diff", "diagnostics" },
|
|
||||||
lualine_z = { "location" },
|
|
||||||
},
|
|
||||||
inactive_sections = {
|
|
||||||
lualine_a = {},
|
|
||||||
lualine_b = {},
|
|
||||||
lualine_c = { "filename" },
|
|
||||||
lualine_x = { "location" },
|
|
||||||
lualine_y = {},
|
|
||||||
lualine_z = {},
|
|
||||||
},
|
|
||||||
tabline = {},
|
|
||||||
winbar = {},
|
|
||||||
inactive_winbar = {},
|
|
||||||
extensions = {},
|
|
||||||
})
|
|
||||||
-- listen lsp-progress event and refresh lualine
|
|
||||||
vim.api.nvim_create_augroup("lualine_augroup", { clear = true })
|
|
||||||
vim.api.nvim_create_autocmd("User", {
|
|
||||||
group = "lualine_augroup",
|
|
||||||
pattern = "LspProgressStatusUpdated",
|
|
||||||
callback = require("lualine").refresh,
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue