configuration.nix/nvim/plugins.nix
Jalil David Salamé Messina 329397fc04
All checks were successful
/ check (push) Successful in 20s
/ build (audiomenu) (push) Successful in 1s
/ build (docs) (push) Successful in 1s
/ build (jpassmenu) (push) Successful in 1s
/ build (nixosConfigurations.vm.config.system.build.toplevel) (push) Successful in 1s
/ build (nvim) (push) Successful in 1s
[chore] flake.lock: update inputs
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/797f7dc49e0bc7fab4b57c021cdf68f595e47841' (2024-08-22)
  → 'github:NixOS/nixpkgs/2527da1ef492c495d5391f3bcf9c1dd9f4514e32' (2024-08-24)
• Updated input 'nixvim':
    'github:nix-community/nixvim/4c8d3559ac4548723eeba9861a94ab63219b0d43' (2024-08-23)
  → 'github:nix-community/nixvim/4814147442cd3f12f8160ecad9e36751f68cdc22' (2024-08-27)
• Updated input 'nixvim/git-hooks':
    'github:cachix/git-hooks.nix/6cedaa7c1b4f82a266e5d30f212273e60d62cb0d' (2024-08-21)
  → 'github:cachix/git-hooks.nix/c8a54057aae480c56e28ef3e14e4960628ac495b' (2024-08-23)
• Updated input 'nixvim/nuschtosSearch':
    'github:NuschtOS/search/a05d1805f2a2bc47d230e5e92aecbf69f784f3d0' (2024-08-18)
  → 'github:NuschtOS/search/5a08d691de30b6fc28d58ce71a5e420f2694e087' (2024-08-25)
• Updated input 'nixvim/treefmt-nix':
    'github:numtide/treefmt-nix/1d07739554fdc4f8481068f1b11d6ab4c1a4167a' (2024-08-16)
  → 'github:numtide/treefmt-nix/070f834771efa715f3e74cd8ab93ecc96fabc951' (2024-08-22)
• Updated input 'unstable':
    'github:NixOS/nixpkgs/c374d94f1536013ca8e92341b540eba4c22f9c62' (2024-08-21)
  → 'github:NixOS/nixpkgs/d0e1602ddde669d5beb01aec49d71a51937ed7be' (2024-08-24)
2024-08-28 12:43:26 +02:00

271 lines
6.6 KiB
Nix

{
lib,
pkgs,
helpers,
...
}:
let
inherit (helpers) mkRaw;
in
{
config.plugins = {
bacon = {
enable = true;
settings.quickfix.enabled = true;
};
cmp = {
enable = true;
cmdline = {
"/" = {
mapping =
mkRaw
# lua
''
cmp.mapping.preset.cmdline()
'';
sources = [
{ name = "rg"; }
{ name = "buffer"; }
];
};
":" = {
mapping =
mkRaw
# lua
''
cmp.mapping.preset.cmdline()
'';
sources = [
{ name = "path"; }
{ name = "cmdline"; }
];
};
};
settings = {
# Snippets
snippet.expand =
# lua
''
function(args) require('luasnip').lsp_expand(args.body) end
'';
# Completion Sources
sources = [
{
name = "buffer";
groupIndex = 3;
}
{
name = "calc";
groupIndex = 2;
}
{
name = "conventionalcommits";
groupIndex = 1;
}
{
name = "crates";
groupIndex = 1;
}
{
name = "luasnip";
groupIndex = 1;
}
{
name = "nvim_lsp";
groupIndex = 1;
}
{
name = "nvim_lsp_document_symbol";
groupIndex = 1;
}
{
name = "nvim_lsp_signature_help";
groupIndex = 1;
}
{
name = "path";
groupIndex = 2;
}
{
name = "spell";
groupIndex = 2;
}
{
name = "treesitter";
groupIndex = 2;
}
{
name = "zsh";
groupIndex = 1;
}
];
mapping =
mkRaw
# lua
''
cmp.mapping.preset.insert({
["<C-n>"] = function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif require("luasnip").expand_or_jumpable() then
require("luasnip").expand_or_jump()
elseif has_words_before() then
cmp.complete()
else
fallback()
end
end,
["<C-p>"] = function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif require("luasnip").jumpable(-1) then
require("luasnip").jump(-1)
else
fallback()
end
end,
["<C-u>"] = cmp.mapping(function(fallback)
if require("luasnip").choice_active() then
require("luasnip").next_choice()
else
fallback()
end
end),
["<C-b>"] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete { },
["<C-e>"] = cmp.mapping.close(),
["<CR>"] = cmp.mapping.confirm { select = true },
})
'';
};
};
# FIXME: doesn't include formatters
conform-nvim = {
enable = true;
settings = {
formatters.nixfmt.command = "${lib.getExe pkgs.nixfmt-rfc-style}";
formatters_by_ft = {
"_" = [ "trim_whitespace" ];
c = [ "clang_format" ];
cpp = [ "clang_format" ];
lua = [ "stylua" ];
nix = [ "nixfmt" ];
rust = [ "rustfmt" ];
sh = [ "shfmt" ];
toml = [ "taplo" ];
yaml = [ "yamlfmt" ];
zig = [ "zigfmt" ];
};
};
};
gitsigns.enable = true;
lint = {
enable = true;
lintersByFt = {
rust = [ "typos" ];
latex = [
"chktex"
"typos"
];
markdown = [ "typos" ];
nix = [ "statix" ];
sh = [ "dash" ];
zsh = [ "zsh" ];
};
};
lsp = {
enable = true;
servers = {
bashls.enable = true;
bashls.package = pkgs.unstable.bash-language-server;
# clangd.enable = true; # Adds ~2GiB
html.enable = true;
jsonls.enable = true;
marksman.enable = true;
nixd.enable = true;
nil-ls = {
enable = true;
settings.nix.flake = {
autoArchive = true;
autoEvalInputs = true;
};
};
pyright.enable = true;
# ruff-lsp.enable = true;
ruff.enable = true;
taplo.enable = true;
# texlab.enable = true; # Not writing TeX rn
typos-lsp.enable = true;
typst-lsp.enable = true;
};
};
lspkind = {
enable = true;
mode = "symbol";
extraOptions.maxwidth = 50;
};
lualine = {
enable = true;
theme = lib.mkForce "gruvbox";
};
luasnip = {
enable = true;
settings.update_events = "TextChanged,TextChangedI";
};
noice = {
enable = true;
lsp.override = {
"vim.lsp.util.convert_input_to_markdown_lines" = true;
"vim.lsp.util.stylize_markdown" = true;
"cmp.entry.get_documentation" = true;
};
presets = {
# use a classic bottom cmdline for search
bottom_search = true;
# position the cmdline and popupmenu together
command_palette = false;
# long messages will be sent to a split
long_message_to_split = true;
# enables an input dialog for inc-rename.nvim
inc_rename = false;
# add a border to hover docs and signature help
lsp_doc_border = true;
};
};
notify = {
enable = true;
backgroundColour = "#000000";
};
nvim-colorizer = {
enable = true;
userDefaultOptions = {
names = false; # disable named colors (i.e. red)
mode = "virtualtext";
};
};
rustaceanvim = {
enable = true;
# Install through rustup
rustAnalyzerPackage = null;
};
telescope = {
enable = true;
extensions = {
ui-select.enable = true;
fzy-native.enable = true;
};
};
treesitter = {
enable = true;
settings = {
indent.enable = true;
incremental_election.enable = true;
};
};
trouble = {
enable = true;
settings.auto_close = true;
};
};
}