forked from abzcoding/lvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfidget_spinner.lua
More file actions
83 lines (80 loc) · 2.22 KB
/
fidget_spinner.lua
File metadata and controls
83 lines (80 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
local M = {}
M.config = function()
local status_ok, fidget = pcall(require, "fidget")
if not status_ok then
return
end
local relative = "editor"
if lvim.builtin.global_statusline then
relative = "win"
end
fidget.setup {
text = {
spinner = {
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
},
done = "", -- character shown when all tasks are complete
commenced = " ", -- message shown when task starts
completed = " ", -- message shown when task completes
},
align = {
bottom = true, -- align fidgets along bottom edge of buffer
right = true, -- align fidgets along right edge of buffer
},
timer = {
spinner_rate = 100, -- frame rate of spinner animation, in ms
fidget_decay = 500, -- how long to keep around empty fidget, in ms
task_decay = 300, -- how long to keep around completed task, in ms
},
window = {
relative = relative, -- where to anchor the window, either `"win"` or `"editor"`
blend = 100, -- `&winblend` for the window
zindex = nil, -- the `zindex` value for the window
},
fmt = {
leftpad = true, -- right-justify text in fidget box
stack_upwards = true, -- list of tasks grows upwards
max_width = 0, -- maximum width of the fidget box
-- function to format fidget title
fidget = function(fidget_name, spinner)
return string.format("%s %s", spinner, fidget_name)
end,
-- function to format each task line
task = function(task_name, message, percentage)
return string.format("%s%s [%s]", message, percentage and string.format(" (%s%%)", percentage) or "", task_name)
end,
},
debug = {
logging = false, -- whether to enable logging, for debugging
strict = false, -- whether to interpret LSP strictly
},
}
end
return M