Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: snake_case in fidget config, use lib.nixvim.mkRaw #120

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
179 changes: 90 additions & 89 deletions config/lsp/fidget.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,101 +4,102 @@
fidget.enable = lib.mkEnableOption "Enable fidget module";
};
config = lib.mkIf config.fidget.enable {

plugins.fidget = {
enable = true;
logger = {
level = "warn"; # “off”, “error”, “warn”, “info”, “debug”, “trace”
floatPrecision = 1.0e-2; # Limit the number of decimals displayed for floats
};
progress = {
pollRate = 0; # How and when to poll for progress messages
suppressOnInsert = true; # Suppress new messages while in insert mode
ignoreDoneAlready = false; # Ignore new tasks that are already complete
ignoreEmptyMessage = false; # Ignore new tasks that don't contain a message
clearOnDetach =
# 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
'';
notificationGroup =
# 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
lsp = {
progressRingbufSize = 0; # Configure the nvim's LSP progress ring buffer size
settings = {
logger = {
level = "warn"; # “off”, “error”, “warn”, “info”, “debug”, “trace”
float_precision = 1.0e-2; # Limit the number of decimals displayed for floats
};
display = {
renderLimit = 16; # How many LSP messages to show at once
doneTtl = 3; # How long a message should persist after completion
doneIcon = "✔"; # Icon shown when all LSP progress tasks are complete
doneStyle = "Constant"; # Highlight group for completed LSP tasks
progressTtl = "math.huge"; # How long a message should persist when in progress
progressIcon = {
pattern = "dots";
period = 1;
}; # Icon shown when LSP progress tasks are in progress
progressStyle = "WarningMsg"; # Highlight group for in-progress LSP tasks
groupStyle = "Title"; # Highlight group for group name (LSP server name)
iconStyle = "Question"; # Highlight group for group icons
priority = 30; # Ordering priority for LSP notification group
skipHistory = true; # Whether progress notifications should be omitted from history
formatMessage = ''
require ("fidget.progress.display").default_format_message
''; # How to format a progress message
formatAnnote = ''
function (msg) return msg.title end
''; # How to format a progress annotation
formatGroupName = ''
function (group) return tostring (group) end
''; # How to format a progress notification group's name
overrides = {
rust_analyzer = {
name = "rust-analyzer";
};
}; # Override options from the default notification config
progress = {
poll_rate = 0; # How and when to poll for progress messages
suppress_on_insert = true; # 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
lib.nixvim.mkRaw ''
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
lib.nixvim.mkRaw ''
function(msg) return msg.lsp_client.name end
'';
ignore = [ ]; # List of LSP servers to ignore
lsp = {
progress_ringbuf_size = 0; # Configure the nvim's LSP progress ring buffer size
};
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 = lib.nixvim.mkRaw "math.huge"; # How long a message should persist when in progress
progress_icon = {
pattern = "dots";
period = 1;
}; # Icon shown when LSP progress tasks are in progress
progress_style = "WarningMsg"; # Highlight group for in-progress LSP tasks
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 = lib.nixvim.mkRaw ''
require ("fidget.progress.display").default_format_message
''; # How to format a progress message
format_annote = lib.nixvim.mkRaw ''
function (msg) return msg.title end
''; # How to format a progress annotation
format_group_name = lib.nixvim.mkRaw ''
function (group) return tostring (group) end
''; # How to format a progress notification group's name
overrides = {
rust_analyzer = {
name = "rust-analyzer";
};
}; # Override options from the default notification config
};
};
};
notification = {
pollRate = 10; # How frequently to update and render notifications
filter = "info"; # “off”, “error”, “warn”, “info”, “debug”, “trace”
historySize = 128; # Number of removed messages to retain in history
overrideVimNotify = true;
redirect = ''
function(msg, level, opts)
if opts and opts.on_open then
return require("fidget.integration.nvim-notify").delegate(msg, level, opts)
notification = {
poll_rate = 10; # How frequently to update and render notifications
filter = "info"; # “off”, “error”, “warn”, “info”, “debug”, “trace”
history_size = 128; # Number of removed messages to retain in history
override_vim_notify = true;
redirect = lib.nixvim.mkRaw ''
function(msg, level, opts)
if opts and opts.on_open then
return require("fidget.integration.nvim-notify").delegate(msg, level, opts)
end
end
end
'';
configs = {
default = "require('fidget.notification').default_config";
};
'';
configs = {
default = lib.nixvim.mkRaw "require('fidget.notification').default_config";
};

window = {
normalHl = "Comment";
winblend = 0;
border = "none"; # none, single, double, rounded, solid, shadow
zindex = 45;
maxWidth = 0;
maxHeight = 0;
xPadding = 1;
yPadding = 0;
align = "bottom";
relative = "editor";
};
view = {
stackUpwards = true; # Display notification items from bottom to top
iconSeparator = " "; # Separator between group name and icon
groupSeparator = "---"; # Separator between notification groups
groupSeparatorHl =
# Highlight group used for group separator
"Comment";
window = {
normal_hl = "Comment";
winblend = 0;
border = "none"; # none, single, double, rounded, solid, shadow
zindex = 45;
max_width = 0;
max_height = 0;
x_padding = 1;
y_padding = 0;
align = "bottom";
relative = "editor";
};
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";
};
};
};
};
Expand Down
Loading