feat: Change nix formatter to alejandra
This commit is contained in:
parent
0b8b647f05
commit
b4c3dfec42
229 changed files with 2528 additions and 2884 deletions
|
|
@ -1 +1 @@
|
|||
{ ... }: { }
|
||||
{...}: {}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
youthlic.plugins.blink-cmp = {
|
||||
enable = true;
|
||||
setupLspCapabilities = true;
|
||||
|
|
@ -26,7 +25,7 @@
|
|||
};
|
||||
menu = {
|
||||
draw = {
|
||||
treesitter = [ "lsp" ];
|
||||
treesitter = ["lsp"];
|
||||
};
|
||||
};
|
||||
documentation = {
|
||||
|
|
@ -42,7 +41,7 @@
|
|||
};
|
||||
};
|
||||
sources = {
|
||||
compat = [ ];
|
||||
compat = [];
|
||||
default = [
|
||||
"lsp"
|
||||
"path"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
youthlic.plugins = {
|
||||
lazydev = {
|
||||
enable = true;
|
||||
|
|
@ -7,7 +6,7 @@
|
|||
library = [
|
||||
{
|
||||
path = "$''{3rd}/luv/library";
|
||||
words = [ "vim%.uv" ];
|
||||
words = ["vim%.uv"];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
youthlic.plugins.mini-ai = {
|
||||
enable = true;
|
||||
luaConfig.pre =
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
youthlic.plugins.mini-pairs = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
youthlic.plugins.ts-comments.enable = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
youthlic.plugins = {
|
||||
# grug-far = {
|
||||
# enable = true;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
youthlic.plugins.gitsigns = {
|
||||
enable = true;
|
||||
luaConfig.post =
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
youthlic.plugins.trouble = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
youthlic.plugins = {
|
||||
which-key = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -1,85 +1,82 @@
|
|||
{ ... }:
|
||||
{
|
||||
userCommands =
|
||||
let
|
||||
formatCmd = {
|
||||
desc = "Format all the buffer";
|
||||
# conform.format function can deal with range by itself
|
||||
range = "%";
|
||||
bang = true;
|
||||
bar = true;
|
||||
nargs = "?";
|
||||
complete = {
|
||||
__raw =
|
||||
#lua
|
||||
''
|
||||
function(ArgLead, CmdLine, CursorPos)
|
||||
return vim.iter(require("conform").list_all_formatters()):filter(function(val)
|
||||
return val.available
|
||||
end):map(function(val)
|
||||
return val.name
|
||||
end):filter(function(name)
|
||||
return string.match(name, "^" .. ArgLead) ~= nil
|
||||
end):totable()
|
||||
end
|
||||
'';
|
||||
};
|
||||
command = {
|
||||
__raw =
|
||||
#lua
|
||||
''
|
||||
function(opts)
|
||||
local format = require("conform").format
|
||||
if #(opts.fargs) == 0 then
|
||||
return format()
|
||||
else
|
||||
return format({ formatters = { opts.fargs[1] } })
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
Format = formatCmd;
|
||||
Fmt = formatCmd;
|
||||
Formatter = {
|
||||
desc = "Show config of formatter";
|
||||
nargs = "?";
|
||||
bar = true;
|
||||
complete = {
|
||||
__raw =
|
||||
#lua
|
||||
''
|
||||
function(ArgLead, CmdLine, CursorPos)
|
||||
return vim.iter(require("conform").list_all_formatters()):map(function(val)
|
||||
{...}: {
|
||||
userCommands = let
|
||||
formatCmd = {
|
||||
desc = "Format all the buffer";
|
||||
# conform.format function can deal with range by itself
|
||||
range = "%";
|
||||
bang = true;
|
||||
bar = true;
|
||||
nargs = "?";
|
||||
complete = {
|
||||
__raw =
|
||||
#lua
|
||||
''
|
||||
function(ArgLead, CmdLine, CursorPos)
|
||||
return vim.iter(require("conform").list_all_formatters()):filter(function(val)
|
||||
return val.available
|
||||
end):map(function(val)
|
||||
return val.name
|
||||
end):filter(function(name)
|
||||
return string.match(name, "^" .. ArgLead) ~= nil
|
||||
end):totable()
|
||||
end):filter(function(name)
|
||||
return string.match(name, "^" .. ArgLead) ~= nil
|
||||
end):totable()
|
||||
end
|
||||
'';
|
||||
};
|
||||
command = {
|
||||
__raw =
|
||||
#lua
|
||||
''
|
||||
function(opts)
|
||||
local format = require("conform").format
|
||||
if #(opts.fargs) == 0 then
|
||||
return format()
|
||||
else
|
||||
return format({ formatters = { opts.fargs[1] } })
|
||||
end
|
||||
'';
|
||||
};
|
||||
command = {
|
||||
__raw =
|
||||
#lua
|
||||
''
|
||||
function(opts)
|
||||
local conform = require("conform")
|
||||
if #(opts.fargs) == 0 then
|
||||
local formatters = conform.list_all_formatters()
|
||||
print(vim.inspect(formatters))
|
||||
return formatters
|
||||
else
|
||||
local config = conform.get_formatter_config(opts.fargs[1])
|
||||
print(vim.inspect(config))
|
||||
return config
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
in {
|
||||
Format = formatCmd;
|
||||
Fmt = formatCmd;
|
||||
Formatter = {
|
||||
desc = "Show config of formatter";
|
||||
nargs = "?";
|
||||
bar = true;
|
||||
complete = {
|
||||
__raw =
|
||||
#lua
|
||||
''
|
||||
function(ArgLead, CmdLine, CursorPos)
|
||||
return vim.iter(require("conform").list_all_formatters()):map(function(val)
|
||||
return val.name
|
||||
end):filter(function(name)
|
||||
return string.match(name, "^" .. ArgLead) ~= nil
|
||||
end):totable()
|
||||
end
|
||||
'';
|
||||
};
|
||||
command = {
|
||||
__raw =
|
||||
#lua
|
||||
''
|
||||
function(opts)
|
||||
local conform = require("conform")
|
||||
if #(opts.fargs) == 0 then
|
||||
local formatters = conform.list_all_formatters()
|
||||
print(vim.inspect(formatters))
|
||||
return formatters
|
||||
else
|
||||
local config = conform.get_formatter_config(opts.fargs[1])
|
||||
print(vim.inspect(config))
|
||||
return config
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
keymaps = [
|
||||
{
|
||||
action = {
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{ ... }: { }
|
||||
{...}: {}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
youthlic.plugins.conform-nvim.settings = {
|
||||
formatters_by_ft.c = {
|
||||
__unkeyed-1 = "clang-format";
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
youthlic.plugins.conform-nvim.settings = {
|
||||
formatters_by_ft.cpp = {
|
||||
__unkeyed-1 = "clang-format";
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
extraPackagesAfter = with pkgs; [ idris2Packages.idris2Lsp ];
|
||||
{pkgs, ...}: {
|
||||
extraPackagesAfter = with pkgs; [idris2Packages.idris2Lsp];
|
||||
lsp.servers.idris2 = {
|
||||
enable = true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
youthlic.plugins.conform-nvim.settings = {
|
||||
formatters_by_ft.json = {
|
||||
__unkeyed-1 = "deno_fmt";
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
lsp.servers.lua_ls = {
|
||||
enable = true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
youthlic.plugins.conform-nvim.settings = {
|
||||
formatters_by_ft.markdown = {
|
||||
__unkeyed-1 = "deno_fmt";
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
lsp.servers = {
|
||||
nixd = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
youthlic.plugins.conform-nvim.settings = {
|
||||
formatters_by_ft.python = {
|
||||
__unkeyed-1 = "ruff_format";
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
youthlic.plugins.conform-nvim.settings = {
|
||||
formatters_by_ft.rust = {
|
||||
__unkeyed-1 = "rustfmt";
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
youthlic.plugins.conform-nvim.settings = {
|
||||
formatters_by_ft.toml = {
|
||||
__unkeyed-1 = "taplo";
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
youthlic.plugins.conform-nvim.settings = {
|
||||
formatters_by_ft.yaml = {
|
||||
__unkeyed-1 = "deno_fmt";
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{ ... }: { }
|
||||
{...}: {}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
youthlic.plugins.lspconfig.enable = true;
|
||||
lsp = {
|
||||
inlayHints.enable = true;
|
||||
|
|
|
|||
|
|
@ -3,11 +3,9 @@
|
|||
config,
|
||||
options,
|
||||
...
|
||||
}:
|
||||
let
|
||||
}: let
|
||||
cfg = config.youthlic;
|
||||
in
|
||||
{
|
||||
in {
|
||||
options = {
|
||||
youthlic.plugins = lib.mkOption {
|
||||
type = lib.types.attrsOf (
|
||||
|
|
@ -16,8 +14,7 @@ in
|
|||
name,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
}: {
|
||||
freeformType = lib.types.anything;
|
||||
options = {
|
||||
enable = lib.mkEnableOption "nvimPlugins.${name}";
|
||||
|
|
@ -25,13 +22,12 @@ in
|
|||
}
|
||||
)
|
||||
);
|
||||
default = { };
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
config =
|
||||
let
|
||||
enabledPlugins = lib.filterAttrs (_name: value: value.enable) cfg.plugins;
|
||||
in
|
||||
config = let
|
||||
enabledPlugins = lib.filterAttrs (_name: value: value.enable) cfg.plugins;
|
||||
in
|
||||
lib.mkMerge [
|
||||
{
|
||||
plugins = enabledPlugins;
|
||||
|
|
@ -42,13 +38,13 @@ in
|
|||
(lib.filter (name: options.plugins.${name} ? luaConfig))
|
||||
(map (
|
||||
name:
|
||||
lib.nameValuePair name {
|
||||
luaConfig.post =
|
||||
#lua
|
||||
''
|
||||
_M.load("${name}")
|
||||
'';
|
||||
}
|
||||
lib.nameValuePair name {
|
||||
luaConfig.post =
|
||||
#lua
|
||||
''
|
||||
_M.load("${name}")
|
||||
'';
|
||||
}
|
||||
))
|
||||
lib.listToAttrs
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
extraConfigLua =
|
||||
#lua
|
||||
''
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
globals = {
|
||||
mapleader = {
|
||||
__raw =
|
||||
|
|
@ -92,7 +91,7 @@
|
|||
];
|
||||
whichwrap = "b,s,<,>";
|
||||
wildmenu = true;
|
||||
wildmode = [ "full" ];
|
||||
wildmode = ["full"];
|
||||
wildoptions = [
|
||||
"fuzzy"
|
||||
"pum"
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@ makeNixvimWithModule {
|
|||
inherit nixvimPlugins;
|
||||
};
|
||||
module = {
|
||||
imports =
|
||||
with lib;
|
||||
imports = with lib;
|
||||
youthlic.loadImports' ./. (filter (name: !hasSuffix "/package.nix" (toString name)));
|
||||
enableMan = true;
|
||||
enablePrintInit = true;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
youthlic.plugins = {
|
||||
treesitter = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
youthlic.plugins.bufferline = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
colorschemes.gruvbox = {
|
||||
enable = true;
|
||||
settings = {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
youthlic.plugins.lualine = {
|
||||
enable = true;
|
||||
luaConfig.pre =
|
||||
|
|
@ -17,6 +16,6 @@
|
|||
vim.o.laststatus = vim.g.lualine_laststatus
|
||||
end
|
||||
'';
|
||||
settings = { };
|
||||
settings = {};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
extraConfigLuaPre =
|
||||
#lua
|
||||
''
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
{...}: {
|
||||
youthlic.plugins.snacks = {
|
||||
enable = true;
|
||||
luaConfig.content =
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{ nixvimPlugins, ... }:
|
||||
{
|
||||
{nixvimPlugins, ...}: {
|
||||
extraPlugins = [
|
||||
{
|
||||
config =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue