plugins/lsp: move related plugins to by-name

This commit is contained in:
Matt Sturgeon 2024-09-04 17:47:06 +01:00
parent 91c6b62881
commit 8815180c62
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
23 changed files with 0 additions and 11 deletions

View file

@ -1,164 +0,0 @@
{ lib, pkgs, ... }:
{
empty = {
plugins.conform-nvim.enable = true;
};
default = {
plugins.conform-nvim = {
enable = true;
settings = {
formatters_by_ft = { };
format_on_save = {
lsp_format = "never";
timeout_ms = 1000;
quiet = false;
stop_after_first = false;
};
default_format_opts = {
lsp_format = "never";
timeout_ms = 1000;
quiet = false;
stop_after_first = false;
};
format_after_save = {
lsp_format = "never";
timeout_ms = 1000;
quiet = false;
stop_after_first = false;
};
log_level = "error";
notify_on_error = true;
notify_no_formatters = true;
formatters = { };
};
};
};
example = {
plugins.conform-nvim = {
enable = true;
settings = {
formatters_by_ft = {
lua = [ "stylua" ];
python = [
"isort"
"black"
];
javascript = {
__unkeyed-1 = "prettierd";
__unkeyed-2 = "prettier";
timeout_ms = 2000;
stop_after_first = true;
};
"*" = [ "codespell" ];
"_" = [ "trimWhitespace" ];
};
format_on_save = {
lsp_format = "fallback";
timeout_ms = 500;
};
format_after_save = {
lsp_format = "fallback";
};
log_level = "error";
notify_on_error = false;
notify_no_formatters = false;
formatters = {
nixfmt = {
command = lib.getExe pkgs.nixfmt-rfc-style;
};
myFormatter = {
command = "myCmd";
args = [
"--stdin-from-filename"
"$FILENAME"
];
rangeArgs = ''
function(ctx)
return { "--line-start", ctx.range.start[1], "--line-end", ctx.range["end"][1] }
end;
'';
stdin = true;
cwd = ''
require("conform.util").rootFile({ ".editorconfig", "package.json" });
'';
requireCwd = true;
condition = ''
function(ctx)
return vim.fs.basename(ctx.filename) ~= "README.md"
end;
'';
exitCodes = [
0
1
];
env = {
VAR = "value";
};
"inherit" = true;
prependArgs = [ "--use-tabs" ];
};
otherFormatter = ''
function(bufnr)
return {
command = "myCmd";
}
end;
'';
};
};
};
};
custom_format_on_save_function = {
plugins.conform-nvim = {
enable = true;
settings = {
format_on_save = ''
function(bufnr)
local ignore_filetypes = { "helm" }
if vim.tbl_contains(ignore_filetypes, vim.bo[bufnr].filetype) then
return
end
-- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
-- Disable autoformat for files in a certain path
local bufname = vim.api.nvim_buf_get_name(bufnr)
if bufname:match("/node_modules/") then
return
end
return { timeout_ms = 500, lsp_fallback = true }
end
'';
};
};
};
custom_format_after_save_function = {
plugins.conform-nvim = {
enable = true;
settings = {
format_after_save = ''
function(bufnr)
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
if not _conform_slow_format_filetypes[vim.bo[bufnr].filetype] then
return
end
return { lsp_fallback = true }
end
'';
};
};
};
}

View file

@ -1,109 +0,0 @@
{
empty = {
plugins.fidget.enable = true;
};
defaults = {
plugins.fidget = {
enable = true;
progress = {
pollRate = 0;
suppressOnInsert = false;
ignoreDoneAlready = false;
ignoreEmptyMessage = true;
notificationGroup = "function(msg) return msg.lsp_name end";
clearOnDetach = ''
function(client_id)
local client = vim.lsp.get_client_by_id(client_id)
return client and client.name or nil
end
'';
ignore = [ ];
display = {
renderLimit = 16;
doneTtl = 3;
doneIcon = "";
doneStyle = "Constant";
progressTtl = "math.huge";
progressIcon = {
pattern = "dots";
};
progressStyle = "WarningMsg";
groupStyle = "Title";
iconStyle = "Question";
priority = 30;
skipHistory = true;
formatMessage = "require('fidget.progress.display').default_format_message";
formatAnnote = "function(msg) return msg.title end";
formatGroupName = "function(group) return tostring(group) end";
overrides = {
rust_analyzer = {
name = "rust-analyzer";
};
};
};
lsp = {
progressRingbufSize = 0;
};
};
notification = {
pollRate = 10;
filter = "info";
historySize = 128;
overrideVimNotify = false;
configs = {
default = "require('fidget.notification').default_config";
};
redirect = ''
function(msg, level, opts)
if opts and opts.on_open then
return require("fidget.integration.nvim-notify").delegate(msg, level, opts)
end
end
'';
view = {
stackUpwards = true;
iconSeparator = " ";
groupSeparator = "---";
groupSeparatorHl = "Comment";
};
window = {
normalHl = "Comment";
winblend = 100;
border = "none";
borderHl = "";
zindex = 45;
maxWidth = 0;
maxHeight = 0;
xPadding = 1;
yPadding = 0;
align = "bottom";
relative = "editor";
};
};
integration = {
nvim-tree = {
enable = false;
};
};
logger = {
level = "warn";
floatPrecision = 1.0e-2;
path.__raw = "string.format('%s/fidget.nvim.log', vim.fn.stdpath('cache'))";
};
};
};
nvim-tree-integration = {
plugins = {
nvim-tree.enable = true;
fidget = {
enable = true;
integration = {
nvim-tree.enable = true;
};
};
};
};
}

View file

@ -1,17 +0,0 @@
{
empty = {
plugins.inc-rename.enable = true;
};
defaults = {
plugins.inc-rename = {
enable = true;
cmdName = "IncRename";
hlGroup = "Substitute";
previewEmptyName = false;
showMessage = true;
inputBufferType = null;
postHook = null;
};
};
}

View file

@ -1,40 +0,0 @@
{
empty = {
plugins.lsp.enable = true;
plugins.lsp-format.enable = true;
};
example = {
plugins = {
lsp = {
enable = true;
servers.gopls = {
enable = true;
onAttach.function = ''
x = 12
'';
};
};
lsp-format = {
enable = true;
setup = {
go = {
exclude = [ "gopls" ];
order = [
"gopls"
"efm"
];
sync = true;
force = true;
# Test the ability to provide extra options for each filetype
someRandomOption = 42;
};
};
};
};
};
}

View file

@ -1,14 +0,0 @@
{
empty = {
plugins.lsp-lines.enable = true;
};
example = {
plugins.lsp-lines.enable = true;
diagnostics.virtual_lines = {
only_current_line = true;
highlight_whole_line = false;
};
};
}

View file

@ -1,32 +0,0 @@
{
empty = {
plugins = {
lsp.enable = true;
lsp-status.enable = true;
};
};
defaults = {
plugins = {
lsp.enable = true;
lsp-status = {
enable = true;
settings = {
kind_labels = { };
select_symbol = "";
current_function = true;
show_filename = true;
indicator_ok = "OK";
indicator_errors = "E";
indicator_warnings = "W";
indicator_info = "i";
indicator_hint = "?";
indicator_separator = " ";
component_separator = " ";
diagnostics = true;
};
};
};
};
}

View file

@ -1,180 +0,0 @@
{
empty = {
plugins.lspsaga.enable = true;
};
defaults = {
plugins.lspsaga = {
enable = true;
ui = {
border = "single";
devicon = true;
title = true;
expand = "";
collapse = "";
codeAction = "💡";
actionfix = "";
lines = [
""
""
""
""
""
];
kind = { };
impSign = "󰳛 ";
};
hover = {
maxWidth = 0.9;
maxHeight = 0.8;
openLink = "gx";
openCmd = "!chrome";
};
diagnostic = {
showCodeAction = true;
showLayout = "float";
showNormalHeight = 10;
jumpNumShortcut = true;
maxWidth = 0.8;
maxHeight = 0.6;
maxShowWidth = 0.9;
maxShowHeight = 0.6;
textHlFollow = true;
borderFollow = true;
extendRelatedInformation = false;
diagnosticOnlyCurrent = false;
keys = {
execAction = "o";
quit = "q";
toggleOrJump = "<CR>";
quitInShow = [
"q"
"<ESC>"
];
};
};
codeAction = {
numShortcut = true;
showServerName = false;
extendGitSigns = false;
onlyInCursor = true;
keys = {
quit = "q";
exec = "<CR>";
};
};
lightbulb = {
enable = true;
sign = true;
debounce = 10;
signPriority = 40;
virtualText = true;
};
scrollPreview = {
scrollDown = "<C-f>";
scrollUp = "<C-b>";
};
finder = {
maxHeight = 0.5;
leftWidth = 0.3;
rightWidth = 0.3;
methods = {
tyd = "textDocument/typeDefinition";
};
default = "ref+imp";
layout = "float";
silent = false;
filter = { };
keys = {
shuttle = "[w";
toggleOrOpen = "o";
vsplit = "s";
split = "i";
tabe = "t";
tabnew = "r";
quit = "q";
close = "<C-c>k";
};
};
definition = {
width = 0.6;
height = 0.5;
keys = {
edit = "<C-c>o";
vsplit = "<C-c>v";
split = "<C-c>i";
tabe = "<C-c>t";
quit = "q";
close = "<C-c>k";
};
};
rename = {
inSelect = true;
autoSave = false;
projectMaxWidth = 0.5;
projectMaxHeight = 0.5;
keys = {
quit = "<C-k>";
exec = "<CR>";
select = "x";
};
};
symbolInWinbar = {
enable = true;
separator = " ";
hideKeyword = false;
showFile = true;
folderLevel = 1;
colorMode = true;
delay = 300;
};
outline = {
winPosition = "right";
winWidth = 30;
autoPreview = true;
detail = true;
autoClose = true;
closeAfterJump = false;
layout = "normal";
maxHeight = 0.5;
leftWidth = 0.3;
keys = {
toggleOrJump = "o";
quit = "q";
jump = "e";
};
};
callhierarchy = {
layout = "float";
keys = {
edit = "e";
vsplit = "s";
split = "i";
tabe = "t";
close = "<C-c>k";
quit = "q";
shuttle = "[w";
toggleOrReq = "u";
};
};
implement = {
enable = true;
sign = true;
virtualText = true;
priority = 100;
};
beacon = {
enable = true;
frequency = 7;
};
};
};
no-packages = {
plugins.lspsaga = {
enable = true;
iconsPackage = null;
};
};
}

View file

@ -1,100 +0,0 @@
{
empty = {
plugins.nvim-lightbulb.enable = true;
};
defaults = {
plugins.nvim-lightbulb = {
enable = true;
settings = {
priority = 10;
hide_in_unfocused_buffer = true;
link_highlights = true;
validate_config = "auto";
action_kinds = null;
sign = {
enabled = true;
text = "💡";
hl = "LightBulbSign";
};
virtual_text = {
enabled = false;
text = "💡";
pos = "eol";
hl = "LightBulbVirtualText";
hl_mode = "combine";
};
float = {
enabled = false;
text = "💡";
hl = "LightBulbFloatWin";
win_opts = { };
};
status_text = {
enabled = false;
text = "💡";
text_unavailable = "";
};
number = {
enabled = false;
hl = "LightBulbNumber";
};
line = {
enabled = false;
hl = "LightBulbLine";
};
autocmd = {
enabled = false;
updatetime = 200;
pattern = [ "*" ];
events = [
"CursorHold"
"CursorHoldI"
];
};
ignore = {
clients = [ ];
ft = [ ];
actions_without_kind = false;
};
};
};
};
example = {
plugins.nvim-lightbulb = {
enable = true;
settings = {
sign = {
enabled = false;
text = "󰌶";
};
virtual_text = {
enabled = true;
text = "󰌶";
};
float = {
enabled = false;
text = " 󰌶 ";
win_opts.border = "rounded";
};
status_text = {
enabled = false;
text = " 󰌶 ";
};
number = {
enabled = false;
};
line = {
enabled = false;
};
autocmd = {
enabled = true;
updatetime = 200;
};
};
};
};
}

View file

@ -1,104 +0,0 @@
{
empty = {
plugins = {
lsp = {
enable = true;
servers = {
jsonls.enable = true;
yamlls.enable = true;
};
};
schemastore.enable = true;
};
};
example = {
plugins = {
lsp = {
enable = true;
servers = {
jsonls.enable = true;
yamlls.enable = true;
};
};
schemastore = {
enable = true;
json = {
enable = true;
settings = {
replace."package.json" = {
description = "package.json overridden";
fileMatch = [ "package.json" ];
name = "package.json";
url = "https://example.com/package.json";
};
extra = [
{
description = "My custom JSON schema";
fileMatch = "foo.json";
name = "foo.json";
url = "https://example.com/schema/foo.json";
}
{
description = "My other custom JSON schema";
fileMatch = [
"bar.json"
".baar.json"
];
name = "bar.json";
url = "https://example.com/schema/bar.json";
}
];
};
};
yaml = {
enable = true;
settings = { };
};
};
};
};
withJson = {
plugins = {
lsp = {
enable = true;
servers.jsonls.enable = true;
};
schemastore = {
enable = true;
json = {
enable = true;
settings = { };
};
yaml.enable = false;
};
};
};
withYaml = {
plugins = {
lsp = {
enable = true;
servers.yamlls.enable = true;
};
schemastore = {
enable = true;
json.enable = false;
yaml = {
enable = true;
settings = { };
};
};
};
};
}

View file

@ -1,87 +0,0 @@
{
empty = {
plugins.trouble.enable = true;
};
lsp = {
plugins.lsp = {
enable = true;
servers.clangd.enable = true;
};
plugins.trouble.enable = true;
};
defaults = {
plugins.trouble = {
enable = true;
settings = {
position = "bottom";
height = 10;
width = 50;
icons = true;
mode = "workspace_diagnostics";
fold_open = "";
fold_closed = "";
group = true;
padding = true;
action_keys = {
close = "q";
cancel = "<esc>";
refresh = "r";
jump = [
"<cr>"
"<tab>"
];
open_split = [ "<c-x>" ];
open_vsplit = [ "<c-v>" ];
open_tab = [ "<c-t>" ];
jump_close = [ "o" ];
toggle_mode = "m";
toggle_preview = "P";
hover = "K";
preview = "p";
close_folds = [
"zM"
"zm"
];
open_folds = [
"zR"
"zr"
];
toggle_fold = [
"zA"
"za"
];
previous = "k";
next = "j";
};
indent_lines = true;
win_config = {
border = "single";
};
auto_open = false;
auto_close = false;
auto_preview = true;
auto_fold = false;
auto_jump = [ "lsp_definitions" ];
signs = {
error = "";
warning = "";
hint = "";
information = "";
other = "";
};
use_diagnostic_signs = false;
};
};
};
no-packages = {
plugins.trouble = {
enable = true;
iconsPackage = null;
};
};
}

View file

@ -1,42 +0,0 @@
{
empty = {
plugins.wtf.enable = true;
};
example = {
plugins.wtf = {
enable = true;
keymaps = {
ai = "gw";
search = {
mode = [
"n"
"x"
];
options.desc = "Search diagnostic with Google";
};
};
popupType = "popup";
openaiApiKey = null;
openaiModelId = "gpt-3.5-turbo";
context = true;
language = "english";
additionalInstructions = "Hello world !";
searchEngine = "google";
hooks = {
requestStarted = ''
function()
vim.cmd("hi StatusLine ctermbg=NONE ctermfg=yellow")
end
'';
requestFinished = ''
vim.schedule_wrap(function()
vim.cmd("hi StatusLine ctermbg=NONE ctermfg=NONE")
end)
'';
};
winhighlight = "Normal:Normal,FloatBorder:FloatBorder";
};
};
}