configuration.nix/nvim/plugins.nix
Jalil David Salamé Messina 6f6ad6b711
All checks were successful
/ check (push) Successful in 20s
/ build (audiomenu) (push) Successful in 2s
/ build (docs) (push) Successful in 2s
/ build (jpassmenu) (push) Successful in 2s
/ 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 'home-manager':
    'github:nix-community/home-manager/e1391fb22e18a36f57e6999c7a9f966dc80ac073' (2024-07-03)
  → 'github:nix-community/home-manager/208df2e558b73b6a1f0faec98493cb59a25f62ba' (2024-09-07)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/6f6c45b5134a8ee2e465164811e451dcb5ad86e3' (2024-09-03)
  → 'github:NixOS/nixpkgs/f4c846aee8e1e29062aa8514d5e0ab270f4ec2f9' (2024-09-08)
• Updated input 'nixvim':
    'github:nix-community/nixvim/2ef974182ef62a6a6992118f0beb54dce812ae9b' (2024-09-04)
  → 'github:nix-community/nixvim/fc7e9b29271a03459191955f78d4128451b7cd81' (2024-09-10)
• Updated input 'nixvim/nuschtosSearch':
    'github:NuschtOS/search/9ca36bf5d8de1e51454a255208e6f6bffac24f42' (2024-09-03)
  → 'github:NuschtOS/search/9eaa0246f803758c26f00d21188de00098b79c8b' (2024-09-10)
• Updated input 'unstable':
    'github:NixOS/nixpkgs/ad416d066ca1222956472ab7d0555a6946746a80' (2024-09-04)
  → 'github:NixOS/nixpkgs/574d1eac1c200690e27b8eb4e24887f8df7ac27c' (2024-09-06)
2024-09-11 08:10:25 +02:00

271 lines
6.7 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;
settings.options.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;
};
};
}