This commit is contained in:
Arsen Mirzaev Tatyano-Muradovich 2024-03-22 04:59:39 +07:00
parent cc2d6197c0
commit cc81f4f781
3 changed files with 96 additions and 47 deletions

View File

@ -1,46 +1,95 @@
require('fidget').setup({ require('fidget').setup({
text = { -- Options related to LSP progress subsystem
spinner = "pipe", -- animation shown when tasks are ongoing progress = {
done = "", -- character shown when all tasks are complete poll_rate = 0, -- How and when to poll for progress messages
commenced = "Started", -- message shown when task starts suppress_on_insert = false, -- Suppress new messages while in insert mode
completed = "Completed", -- message shown when task completes ignore_done_already = false, -- Ignore new tasks that are already complete
}, ignore_empty_message = false, -- Ignore new tasks that don't contain a message
align = { clear_on_detach = -- Clear notification group when LSP server detaches
bottom = true, -- align fidgets along bottom edge of buffer function(client_id)
right = true, -- align fidgets along right edge of buffer local client = vim.lsp.get_client_by_id(client_id)
}, return client and client.name or nil
timer = { end,
spinner_rate = 125, -- frame rate of spinner animation, in ms notification_group = -- How to get a progress message's notification group key
fidget_decay = 2000, -- how long to keep around empty fidget, in ms function(msg) return msg.lsp_client.name end,
task_decay = 1000, -- how long to keep around completed task, in ms ignore = {}, -- List of LSP servers to ignore
}, -- Options related to how LSP progress messages are displayed as notifications
window = { display = {
relative = "win", -- where to anchor, either "win" or "editor" render_limit = 16, -- How many LSP messages to show at once
blend = 100, -- &winblend for the window done_ttl = 3, -- How long a message should persist after completion
zindex = nil, -- the zindex value for the window done_icon = "", -- Icon shown when all LSP progress tasks are complete
border = "none", -- style of border for the fidget window done_style = "Constant", -- Highlight group for completed LSP tasks
}, progress_ttl = math.huge, -- How long a message should persist when in progress
fmt = { progress_icon = -- Icon shown when LSP progress tasks are in progress
leftpad = true, -- right-justify text in fidget box { pattern = "dots", period = 1 },
stack_upwards = true, -- list of tasks grows upwards progress_style = -- Highlight group for in-progress LSP tasks
max_width = 0, -- maximum width of the fidget box "WarningMsg",
fidget = -- function to format fidget title group_style = "Title", -- Highlight group for group name (LSP server name)
function(fidget_name, spinner) icon_style = "Question", -- Highlight group for group icons
return string.format("%s %s", spinner, fidget_name) priority = 30, -- Ordering priority for LSP notification group
end, skip_history = true, -- Whether progress notifications should be omitted from history
task = -- function to format each task line format_message = -- How to format a progress message
function(task_name, message, percentage) require("fidget.progress.display").default_format_message,
return string.format( format_annote = -- How to format a progress annotation
"%s%s [%s]", function(msg) return msg.title end,
message, format_group_name = -- How to format a progress notification group's name
percentage and string.format(" (%s%%)", percentage) or "", function(group) return tostring(group) end,
task_name overrides = { -- Override options from the default notification config
) rust_analyzer = { name = "rust-analyzer" },
end, },
}, },
sources = {}, -- Options related to Neovim's built-in LSP client
debug = { lsp = {
logging = false, -- whether to enable logging, for debugging progress_ringbuf_size = 0, -- Configure the nvim's LSP progress ring buffer size
strict = false, -- whether to interpret LSP strictly },
} },
-- 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",
},
-- 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)
},
},
-- Options related to logging
logger = {
level = vim.log.levels.WARN, -- Minimum logging level
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")),
}
}) })

View File

@ -166,7 +166,7 @@ return require('packer').startup(function(use)
run = 'composer install' run = 'composer install'
} }
-- Аналог LSP-сервера для поддержки оболочки fish -- LSP-сервер для Fish Shell
use 'dag/vim-fish' use 'dag/vim-fish'
-- Цветовая тема -- Цветовая тема
@ -181,6 +181,6 @@ return require('packer').startup(function(use)
-- Форматировщик Prettier -- Форматировщик Prettier
use { use {
'prettier/vim-prettier', 'prettier/vim-prettier',
run = 'npm i', run = 'yarn install --frozen-lockfile --production'
} }
end) end)

2
plugin/.gitignore vendored
View File

@ -1,2 +1,2 @@
packer_compiled.lua
!.gitignore !.gitignore
packer_compiled.lua