зеркало из
https://github.com/iharh/notes.git
synced 2025-10-29 12:46:06 +02:00
61 строка
2.0 KiB
Plaintext
61 строка
2.0 KiB
Plaintext
https://github.com/NvChad/ui/blob/v2.5/lua/nvchad/stl
|
|
https://github.com/NvChad/ui/blob/v2.5/lua/nvchad/stl/utils.lua
|
|
|
|
Current line and column in status line
|
|
https://github.com/NvChad/NvChad/issues/1562
|
|
https://github.com/NvChad/NvChad/issues/863
|
|
https://github.com/NvChad/ui/issues/121
|
|
|
|
~/.local/share/nvim/lazy/
|
|
base46/lua/base46/integrations/statusline/default.lua
|
|
colors only
|
|
ui/lua/nvchad/stl/default.lua
|
|
...
|
|
M.cursor = "%#St_pos_sep#" .. sep_l .. "%#St_pos_icon# %#St_pos_text# %p %% "
|
|
|
|
|
|
M.ui = {
|
|
theme = "onedark",
|
|
-- theme = "gruvchad",
|
|
|
|
statusline = {
|
|
overriden_modules = function()
|
|
-- local st_modules = require "nvchad_ui.statusline.default"
|
|
local fn = vim.fn
|
|
-- local sep_l = "->"
|
|
local sep_l = "-->"
|
|
|
|
return {
|
|
cursor_position = function()
|
|
-- local line = vim.fn.line "."
|
|
-- local col = vim.fn.virtcol "."
|
|
|
|
-- -- lets store current logs
|
|
-- local cp = st_modules.cursor_position()
|
|
|
|
-- return cp .. string.format("%3d:%-2d", line, col)
|
|
|
|
local line = fn.line "."
|
|
local col = fn.virtcol "."
|
|
|
|
local chad = string.format(" %d:%d", line, col) .. " │ "
|
|
|
|
-- default cursor_position module
|
|
local left_sep = "%#St_pos_sep#" .. sep_l .. "%#St_pos_icon#" .. " "
|
|
|
|
local current_line = fn.line "."
|
|
local total_line = fn.line "$"
|
|
local text = math.modf((current_line / total_line) * 100) .. tostring "%%"
|
|
text = string.format("%4s", text)
|
|
|
|
text = (current_line == 1 and "Top") or text
|
|
text = (current_line == total_line and "Bot") or text
|
|
|
|
local result = left_sep .. "%#St_pos_text#" .. chad .. text .. " "
|
|
return result
|
|
end,
|
|
}
|
|
end,
|
|
},
|
|
}
|