nixvim!
This commit is contained in:
parent
1ae2d7cc6a
commit
6198767e5b
47 changed files with 2430 additions and 108 deletions
24
modules/editors/nixvim/plug/lsp/conform.nix
Normal file
24
modules/editors/nixvim/plug/lsp/conform.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
programs.nixvim.plugins.conform-nvim = {
|
||||
enable = true;
|
||||
formatOnSave = {
|
||||
lspFallback = true;
|
||||
timeoutMs = 500;
|
||||
};
|
||||
notifyOnError = true;
|
||||
formattersByFt = {
|
||||
liquidsoap = ["liquidsoap-prettier"];
|
||||
html = [["prettierd" "prettier"]];
|
||||
css = [["prettierd" "prettier"]];
|
||||
javascript = [["prettierd" "prettier"]];
|
||||
javascriptreact = [["prettierd" "prettier"]];
|
||||
typescript = [["prettierd" "prettier"]];
|
||||
typescriptreact = [["prettierd" "prettier"]];
|
||||
python = ["black"];
|
||||
lua = ["stylua"];
|
||||
nix = ["alejandra"];
|
||||
markdown = [["prettierd" "prettier"]];
|
||||
yaml = ["yamllint" "yamlfmt"];
|
||||
};
|
||||
};
|
||||
}
|
101
modules/editors/nixvim/plug/lsp/fidget.nix
Normal file
101
modules/editors/nixvim/plug/lsp/fidget.nix
Normal file
|
@ -0,0 +1,101 @@
|
|||
{
|
||||
programs.nixvim = {
|
||||
plugins.fidget = {
|
||||
enable = true;
|
||||
logger = {
|
||||
level = "warn"; # “off”, “error”, “warn”, “info”, “debug”, “trace”
|
||||
floatPrecision = 0.01; # 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
|
||||
};
|
||||
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
|
||||
};
|
||||
};
|
||||
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)
|
||||
end
|
||||
end
|
||||
'';
|
||||
configs = {
|
||||
default = "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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
13
modules/editors/nixvim/plug/lsp/hlchunk.nix
Normal file
13
modules/editors/nixvim/plug/lsp/hlchunk.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{pkgs, ...}: {
|
||||
programs.nixvim.extraPlugins = [
|
||||
(pkgs.vimUtils.buildVimPlugin {
|
||||
name = "hlchunk";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "shellRaining";
|
||||
repo = "hlchunk.nvim";
|
||||
rev = "882d1bc86d459fa8884398223c841fd09ea61b6b";
|
||||
hash = "sha256-fvFvV7KAOo7xtOCjhGS5bDUzwd10DndAKs3++dunED8=";
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
98
modules/editors/nixvim/plug/lsp/lsp.nix
Normal file
98
modules/editors/nixvim/plug/lsp/lsp.nix
Normal file
|
@ -0,0 +1,98 @@
|
|||
{
|
||||
programs.nixvim = {
|
||||
plugins = {
|
||||
lsp-format = {enable = true;};
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = {
|
||||
eslint = {enable = true;};
|
||||
html = {enable = true;};
|
||||
lua-ls = {enable = true;};
|
||||
nil_ls = {enable = true;};
|
||||
marksman = {enable = true;};
|
||||
pyright = {enable = true;};
|
||||
gopls = {enable = true;};
|
||||
terraformls = {enable = true;};
|
||||
tsserver = {enable = false;};
|
||||
yamlls = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
keymaps = {
|
||||
silent = true;
|
||||
lspBuf = {
|
||||
gd = {
|
||||
action = "definition";
|
||||
desc = "Goto Definition";
|
||||
};
|
||||
gr = {
|
||||
action = "references";
|
||||
desc = "Goto References";
|
||||
};
|
||||
gD = {
|
||||
action = "declaration";
|
||||
desc = "Goto Declaration";
|
||||
};
|
||||
gI = {
|
||||
action = "implementation";
|
||||
desc = "Goto Implementation";
|
||||
};
|
||||
gT = {
|
||||
action = "type_definition";
|
||||
desc = "Type Definition";
|
||||
};
|
||||
K = {
|
||||
action = "hover";
|
||||
desc = "Hover";
|
||||
};
|
||||
"<leader>cw" = {
|
||||
action = "workspace_symbol";
|
||||
desc = "Workspace Symbol";
|
||||
};
|
||||
"<leader>cr" = {
|
||||
action = "rename";
|
||||
desc = "Rename";
|
||||
};
|
||||
};
|
||||
diagnostic = {
|
||||
"<leader>cd" = {
|
||||
action = "open_float";
|
||||
desc = "Line Diagnostics";
|
||||
};
|
||||
"[d" = {
|
||||
action = "goto_next";
|
||||
desc = "Next Diagnostic";
|
||||
};
|
||||
"]d" = {
|
||||
action = "goto_prev";
|
||||
desc = "Previous Diagnostic";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
extraConfigLua = ''
|
||||
local _border = "rounded"
|
||||
|
||||
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(
|
||||
vim.lsp.handlers.hover, {
|
||||
border = _border
|
||||
}
|
||||
)
|
||||
|
||||
vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(
|
||||
vim.lsp.handlers.signature_help, {
|
||||
border = _border
|
||||
}
|
||||
)
|
||||
|
||||
vim.diagnostic.config{
|
||||
float={border=_border}
|
||||
};
|
||||
|
||||
require('lspconfig.ui.windows').default_options = {
|
||||
border = _border
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
188
modules/editors/nixvim/plug/lsp/lspsaga.nix
Normal file
188
modules/editors/nixvim/plug/lsp/lspsaga.nix
Normal file
|
@ -0,0 +1,188 @@
|
|||
{
|
||||
programs.nixvim = {
|
||||
plugins.lspsaga = {
|
||||
enable = true;
|
||||
beacon = {
|
||||
enable = true;
|
||||
};
|
||||
ui = {
|
||||
border = "rounded"; # One of none, single, double, rounded, solid, shadow
|
||||
codeAction = "💡"; # Can be any symbol you want 💡
|
||||
};
|
||||
hover = {
|
||||
openCmd = "!floorp"; # Choose your browser
|
||||
openLink = "gx";
|
||||
};
|
||||
diagnostic = {
|
||||
borderFollow = true;
|
||||
diagnosticOnlyCurrent = false;
|
||||
showCodeAction = true;
|
||||
};
|
||||
symbolInWinbar = {
|
||||
enable = true; # Breadcrumbs
|
||||
};
|
||||
codeAction = {
|
||||
extendGitSigns = false;
|
||||
showServerName = true;
|
||||
onlyInCursor = true;
|
||||
numShortcut = true;
|
||||
keys = {
|
||||
exec = "<CR>";
|
||||
quit = ["<Esc>" "q"];
|
||||
};
|
||||
};
|
||||
lightbulb = {
|
||||
enable = false;
|
||||
sign = false;
|
||||
virtualText = true;
|
||||
};
|
||||
implement = {
|
||||
enable = false;
|
||||
};
|
||||
rename = {
|
||||
autoSave = false;
|
||||
keys = {
|
||||
exec = "<CR>";
|
||||
quit = ["<C-k>" "<Esc>"];
|
||||
select = "x";
|
||||
};
|
||||
};
|
||||
outline = {
|
||||
autoClose = true;
|
||||
autoPreview = true;
|
||||
closeAfterJump = true;
|
||||
layout = "normal"; # normal or float
|
||||
winPosition = "right"; # left or right
|
||||
keys = {
|
||||
jump = "e";
|
||||
quit = "q";
|
||||
toggleOrJump = "o";
|
||||
};
|
||||
};
|
||||
scrollPreview = {
|
||||
scrollDown = "<C-f>";
|
||||
scrollUp = "<C-b>";
|
||||
};
|
||||
};
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = "gd";
|
||||
action = "<cmd>Lspsaga finder def<CR>";
|
||||
options = {
|
||||
desc = "Goto Definition";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "gr";
|
||||
action = "<cmd>Lspsaga finder ref<CR>";
|
||||
options = {
|
||||
desc = "Goto References";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
# {
|
||||
# mode = "n";
|
||||
# key = "gD";
|
||||
# action = "<cmd>Lspsaga show_line_diagnostics<CR>";
|
||||
# options = {
|
||||
# desc = "Goto Declaration";
|
||||
# silent = true;
|
||||
# };
|
||||
# }
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "gI";
|
||||
action = "<cmd>Lspsaga finder imp<CR>";
|
||||
options = {
|
||||
desc = "Goto Implementation";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "gT";
|
||||
action = "<cmd>Lspsaga peek_type_definition<CR>";
|
||||
options = {
|
||||
desc = "Type Definition";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "K";
|
||||
action = "<cmd>Lspsaga hover_doc<CR>";
|
||||
options = {
|
||||
desc = "Hover";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>cw";
|
||||
action = "<cmd>Lspsaga outline<CR>";
|
||||
options = {
|
||||
desc = "Outline";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>cr";
|
||||
action = "<cmd>Lspsaga rename<CR>";
|
||||
options = {
|
||||
desc = "Rename";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ca";
|
||||
action = "<cmd>Lspsaga code_action<CR>";
|
||||
options = {
|
||||
desc = "Code Action";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>cd";
|
||||
action = "<cmd>Lspsaga show_line_diagnostics<CR>";
|
||||
options = {
|
||||
desc = "Line Diagnostics";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "[d";
|
||||
action = "<cmd>Lspsaga diagnostic_jump_next<CR>";
|
||||
options = {
|
||||
desc = "Next Diagnostic";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
mode = "n";
|
||||
key = "]d";
|
||||
action = "<cmd>Lspsaga diagnostic_jump_prev<CR>";
|
||||
options = {
|
||||
desc = "Previous Diagnostic";
|
||||
silent = true;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
50
modules/editors/nixvim/plug/lsp/none-ls.nix
Normal file
50
modules/editors/nixvim/plug/lsp/none-ls.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
plugins.none-ls = {
|
||||
enable = true;
|
||||
enableLspFormat = true;
|
||||
updateInInsert = false;
|
||||
sources = {
|
||||
code_actions = {
|
||||
gitsigns.enable = true;
|
||||
statix.enable = true;
|
||||
};
|
||||
diagnostics = {
|
||||
statix.enable = true;
|
||||
yamllint.enable = true;
|
||||
};
|
||||
formatting = {
|
||||
alejandra.enable = true;
|
||||
black = {
|
||||
enable = true;
|
||||
withArgs = ''
|
||||
{
|
||||
extra_args = { "--fast" },
|
||||
}
|
||||
'';
|
||||
};
|
||||
prettier = {
|
||||
enable = true;
|
||||
disableTsServerFormatter = true;
|
||||
withArgs = ''
|
||||
{
|
||||
extra_args = { "--no-semi", "--single-quote" },
|
||||
}
|
||||
'';
|
||||
};
|
||||
stylua.enable = true;
|
||||
yamlfmt.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
keymaps = [
|
||||
{
|
||||
mode = ["n" "v"];
|
||||
key = "<leader>cf";
|
||||
action = "<cmd>lua vim.lsp.buf.format()<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Format";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
5
modules/editors/nixvim/plug/lsp/trouble.nix
Normal file
5
modules/editors/nixvim/plug/lsp/trouble.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
plugins.trouble = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue