-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathfidget.txt
335 lines (251 loc) · 14.1 KB
/
fidget.txt
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
*fidget.txt* Extensible UI for Neovim notifications and LSP progress messages.
==============================================================================
Table of Contents *fidget-table-of-contents*
1. Getting Started |fidget-getting-started|
- Requirements |fidget-getting-started-requirements|
- Installation |fidget-getting-started-installation|
- Versioning |fidget-getting-started-versioning|
2. Options |fidget-options|
3. Lua API |fidget-lua-api|
4. Commands |fidget-commands|
5. Highlights |fidget-highlights|
6. Related Work |fidget-related-work|
- Acknowledgements |fidget-related-work-acknowledgements|
==============================================================================
1. Getting Started *fidget-getting-started*
REQUIREMENTS *fidget-getting-started-requirements*
Fidget requires Neovim v0.9.0+.
If you would like to see progress notifications, you must have configured
Neovim with an LSP server that uses the `$/progress`
<https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#progress>
handler. For an up-to-date list of LSP servers this plugin is known to work
with, see this Wiki page
<https://github.com/j-hui/fidget.nvim/wiki/Known-compatible-LSP-servers>.
INSTALLATION *fidget-getting-started-installation*
Install this plugin using your favorite plugin manager.
See the |fidget-documentation| for `setup()` options.
LAZY ~
>lua
{
"j-hui/fidget.nvim",
opts = {
-- options
},
}
<
VIM-PLUG ~
>vim
Plug 'j-hui/fidget.nvim'
" Make sure the plugin is installed using :PlugInstall. Then, somewhere after plug#end():
lua <<EOF
require("fidget").setup {
-- options
}
EOF
<
ROCKS.NVIM ~
>vim
:Rocks install fidget.nvim
<
VERSIONING *fidget-getting-started-versioning*
Fidget is actively developed on the `main` branch, and may occasionally undergo
breaking changes.
If you would like to ensure configuration/API stability, you can pin your tag
to one of the release tags <https://github.com/j-hui/fidget.nvim/releases/>.
For instance, using Lazy <https://github.com/folke/lazy.nvim>
>lua
{
"j-hui/fidget.nvim",
tag = "v1.0.0", -- Make sure to update this to something recent!
opts = {
-- options
},
}
<
==============================================================================
2. Options *fidget-options*
Fidgetcan be configured by passing a table of options to the `setup()`.
Available options are shown below:
>lua
{
-- Options related to LSP progress subsystem
progress = {
poll_rate = 0, -- How and when to poll for progress messages
suppress_on_insert = false, -- Suppress new messages while in insert mode
ignore_done_already = false, -- Ignore new tasks that are already complete
ignore_empty_message = false, -- Ignore new tasks that don't contain a message
clear_on_detach = -- Clear notification group when LSP server detaches
function(client_id)
local client = vim.lsp.get_client_by_id(client_id)
return client and client.name or nil
end,
notification_group = -- How to get a progress message's notification group key
function(msg) return msg.lsp_client.name end,
ignore = {}, -- List of LSP servers to ignore
-- Options related to how LSP progress messages are displayed as notifications
display = {
render_limit = 16, -- How many LSP messages to show at once
done_ttl = 3, -- How long a message should persist after completion
done_icon = "✔", -- Icon shown when all LSP progress tasks are complete
done_style = "Constant", -- Highlight group for completed LSP tasks
progress_ttl = math.huge, -- How long a message should persist when in progress
progress_icon = -- Icon shown when LSP progress tasks are in progress
{ "dots" },
progress_style = -- Highlight group for in-progress LSP tasks
"WarningMsg",
group_style = "Title", -- Highlight group for group name (LSP server name)
icon_style = "Question", -- Highlight group for group icons
priority = 30, -- Ordering priority for LSP notification group
skip_history = true, -- Whether progress notifications should be omitted from history
format_message = -- How to format a progress message
require("fidget.progress.display").default_format_message,
format_annote = -- How to format a progress annotation
function(msg) return msg.title end,
format_group_name = -- How to format a progress notification group's name
function(group) return tostring(group) end,
overrides = { -- Override options from the default notification config
rust_analyzer = { name = "rust-analyzer" },
},
},
-- Options related to Neovim's built-in LSP client
lsp = {
progress_ringbuf_size = 0, -- Configure the nvim's LSP progress ring buffer size
log_handler = false, -- Log `$/progress` handler invocations (for debugging)
},
},
-- Options related to notification subsystem
notification = {
poll_rate = 10, -- How frequently to update and render notifications
filter = vim.log.levels.INFO, -- Minimum notifications level
history_size = 128, -- Number of removed messages to retain in history
override_vim_notify = false, -- Automatically override vim.notify() with Fidget
configs = -- How to configure notification groups when instantiated
{ default = require("fidget.notification").default_config },
redirect = -- Conditionally redirect notifications to another backend
function(msg, level, opts)
if opts and opts.on_open then
return require("fidget.integration.nvim-notify").delegate(msg, level, opts)
end
end,
-- Options related to how notifications are rendered as text
view = {
stack_upwards = true, -- Display notification items from bottom to top
icon_separator = " ", -- Separator between group name and icon
group_separator = "---", -- Separator between notification groups
group_separator_hl = -- Highlight group used for group separator
"Comment",
render_message = -- How to render notification messages
function(msg, cnt)
return cnt == 1 and msg or string.format("(%dx) %s", cnt, msg)
end,
},
-- Options related to the notification window and buffer
window = {
normal_hl = "Comment", -- Base highlight group in the notification window
winblend = 100, -- Background color opacity in the notification window
border = "none", -- Border around the notification window
zindex = 45, -- Stacking priority of the notification window
max_width = 0, -- Maximum width of the notification window
max_height = 0, -- Maximum height of the notification window
x_padding = 1, -- Padding from right edge of window boundary
y_padding = 0, -- Padding from bottom edge of window boundary
align = "bottom", -- How to align the notification window
relative = "editor", -- What the notification window position is relative to
},
},
-- Options related to integrating with other plugins
integration = {
["nvim-tree"] = {
enable = true, -- Integrate with nvim-tree/nvim-tree.lua (if installed)
},
["xcodebuild-nvim"] = {
enable = true, -- Integrate with wojciech-kulik/xcodebuild.nvim (if installed)
},
},
-- Options related to logging
logger = {
level = vim.log.levels.WARN, -- Minimum logging level
max_size = 10000, -- Maximum log file size, in KB
float_precision = 0.01, -- Limit the number of decimals displayed for floats
path = -- Where Fidget writes its logs to
string.format("%s/fidget.nvim.log", vim.fn.stdpath("cache")),
},
}
<
For more details, see |fidget-option.txt|.
==============================================================================
3. Lua API *fidget-lua-api*
See |fidget-api.txt|.
==============================================================================
4. Commands *fidget-commands*
*fidget-:Fidget* *:Fidget*
Fidget exposes some of its Lua API functions through `:Fidget` sub-commands
(e.g., `:Fidget clear`), which support shell-like arguments and completion.
These sub-commands are documented below.
:Fidget clear *fidget-:Fidget-clear*
Clear active notifications
Positional arguments: ~
{group_key} (any) group to clear
:Fidget clear_history *fidget-:Fidget-clear_history*
Clear notifications history
Flags: ~
--before {seconds} (number) filter history for items updated at least this long ago
--group_key {group_key} (any) clear history by group key
--include_active {true|false} (boolean) whether to clear items that have not been removed (default: true)
--include_removed {true|false} (boolean) whether to clear items that have have been removed (default: true)
--since {seconds} (number) filter history for items updated at most this long ago
Positional arguments: ~
{group_key} (any) clear history by group key
:Fidget history *fidget-:Fidget-history*
Show notifications history
Flags: ~
--before {seconds} (number) filter history for items updated at least this long ago
--group_key {group_key} (any) filter history by group key
--include_active {true|false} (boolean) whether to clear items that have not been removed (default: `true`)
--include_removed {true|false} (boolean) whether to clear items that have have been removed (default: `true`)
--since {seconds} (number) filter history for items updated at most this long ago
Positional arguments: ~
{group_key} (any) filter history by group key
:Fidget lsp_suppress *fidget-:Fidget-lsp_suppress*
Suppress LSP progress notifications
Positional arguments: ~
{suppress} (boolean) whether to suppress (omitting this argument toggles suppression)
:Fidget suppress *fidget-:Fidget-suppress*
Suppress notification window
Positional arguments: ~
{suppress} (boolean) whether to suppress (omitting this argument toggles suppression)
==============================================================================
5. Highlights *fidget-highlights*
Rather than defining its own highlights, Fidget’s default configuration uses
built-in highlight groups that are typically overridden by custom Vim color
schemes. With any luck, these will look reasonable when rendered, but the
visual outcome will really depend on what your color scheme decided to do with
those highlight groups.
You can override these highlight groups (e.g., `icon_style`) using the
|fidget-options| shown above.
==============================================================================
6. Related Work *fidget-related-work*
rcarriga/nvim-notify <https://github.com/rcarriga/nvim-notify> is first and
foremost a `vim.notify()` backend, and it also supports LSP progress
notifications
<https://github.com/rcarriga/nvim-notify/wiki/Usage-Recipes#lsp-status-updates>
(with the integration seems to have been packaged up in mrded/nvim-lsp-notify
<https://github.com/mrded/nvim-lsp-notify>).
vigoux/notifier.nvim <https://github.com/vigoux/notifier.nvim> is a
`vim.notify()` backend that comes with first-class LSP notification support.
neoclide/coc.nvim <https://github.com/neoclide/coc.nvim> provides a nice LSP
progress UI in the status line, which first inspired my desire to have this
feature for nvim-lsp.
arkav/lualine-lsp-progress <https://github.com/arkav/lualine-lsp-progress> was
the original inspiration for Fidget, and funnels LSP progress messages into
nvim-lualine/lualine.nvim <https://github.com/nvim-lualine/lualine.nvim>. I
once borrowed some of its code (though much of that code has since been
rewritten).
nvim-lua/lsp-status.nvim <https://github.com/nvim-lua/lsp-status.nvim> also
supports showing progress text, though it requires some configuration to
integrate that into their status line.
ACKNOWLEDGEMENTS *fidget-related-work-acknowledgements*
Most of the Fidget spinner patterns were adapted from the npm package
sindresorhus/cli-spinners <https://github.com/sindresorhus/cli-spinners>.
Generated by panvimdoc <https://github.com/kdheepak/panvimdoc>
vim:tw=78:ts=8:noet:ft=help:norl: