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 {
|
||||
"lualine.nvim",
|
||||
after = function()
|
||||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = "auto",
|
||||
component_separators = { left = "", right = "" },
|
||||
section_separators = { left = "", right = "" },
|
||||
disabled_filetypes = {
|
||||
statusline = { "ministarter" },
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = true,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { "branch" },
|
||||
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,
|
||||
}
|
||||
-- [nfnl] Compiled from ./fnl/plugins/lualine.fnl by https://github.com/Olical/nfnl, do not edit.
|
||||
local function _1_()
|
||||
local function _2_()
|
||||
require("lz.n").trigger_load("lsp-progress")
|
||||
return require("lsp-progress").progress()
|
||||
end
|
||||
local function _3_()
|
||||
local ok, pomo = pcall(require, "pomo")
|
||||
if not ok then
|
||||
return ""
|
||||
else
|
||||
end
|
||||
local timer = pomo.get_first_to_finish()
|
||||
if (timer == nil) then
|
||||
return ""
|
||||
else
|
||||
end
|
||||
return ("\243\176\132\137 " .. tostring(timer))
|
||||
end
|
||||
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"})
|
||||
end
|
||||
return {"lualine.nvim", after = _1_}
|
||||
|
|
Loading…
Reference in a new issue