2024-06-21 06:30:18 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
helpers,
|
|
|
|
...
|
2024-07-03 23:58:26 +02:00
|
|
|
}:
|
|
|
|
let
|
2024-06-21 06:30:18 +02:00
|
|
|
inherit (helpers) mkRaw;
|
2024-07-03 23:58:26 +02:00
|
|
|
in
|
|
|
|
{
|
2024-06-23 14:32:47 +02:00
|
|
|
config.plugins = {
|
|
|
|
bacon = {
|
|
|
|
enable = true;
|
|
|
|
settings.quickfix.enabled = true;
|
|
|
|
};
|
|
|
|
cmp = {
|
|
|
|
enable = true;
|
|
|
|
cmdline = {
|
|
|
|
"/" = {
|
2024-07-02 09:29:44 +02:00
|
|
|
mapping =
|
|
|
|
mkRaw
|
2024-07-03 23:58:26 +02:00
|
|
|
# lua
|
|
|
|
''
|
|
|
|
cmp.mapping.preset.cmdline()
|
|
|
|
'';
|
2024-06-23 14:32:47 +02:00
|
|
|
sources = [
|
2024-07-03 23:58:26 +02:00
|
|
|
{ name = "rg"; }
|
|
|
|
{ name = "buffer"; }
|
2024-06-23 14:32:47 +02:00
|
|
|
];
|
|
|
|
};
|
|
|
|
":" = {
|
2024-07-02 09:29:44 +02:00
|
|
|
mapping =
|
|
|
|
mkRaw
|
2024-07-03 23:58:26 +02:00
|
|
|
# lua
|
|
|
|
''
|
|
|
|
cmp.mapping.preset.cmdline()
|
|
|
|
'';
|
2024-06-23 14:32:47 +02:00
|
|
|
sources = [
|
2024-07-03 23:58:26 +02:00
|
|
|
{ name = "path"; }
|
|
|
|
{ name = "cmdline"; }
|
2024-06-23 14:32:47 +02:00
|
|
|
];
|
|
|
|
};
|
2024-06-21 06:30:18 +02:00
|
|
|
};
|
2024-06-23 14:32:47 +02:00
|
|
|
settings = {
|
|
|
|
# Snippets
|
2024-07-02 09:29:44 +02:00
|
|
|
snippet.expand =
|
2024-07-03 23:58:26 +02:00
|
|
|
# lua
|
2024-07-02 09:29:44 +02:00
|
|
|
''
|
|
|
|
function(args) require('luasnip').lsp_expand(args.body) end
|
|
|
|
'';
|
2024-06-23 14:32:47 +02:00
|
|
|
# Completion Sources
|
2024-06-22 19:25:51 +02:00
|
|
|
sources = [
|
2024-06-23 14:32:47 +02:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
2024-06-22 19:25:51 +02:00
|
|
|
];
|
2024-07-02 09:29:44 +02:00
|
|
|
mapping =
|
|
|
|
mkRaw
|
2024-07-03 23:58:26 +02:00
|
|
|
# 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 },
|
|
|
|
})
|
|
|
|
'';
|
2024-06-21 06:30:18 +02:00
|
|
|
};
|
2024-06-22 19:25:51 +02:00
|
|
|
};
|
2024-06-23 14:32:47 +02:00
|
|
|
# FIXME: doesn't include formatters
|
|
|
|
conform-nvim = {
|
|
|
|
enable = true;
|
|
|
|
formattersByFt = {
|
2024-07-03 23:58:26 +02:00
|
|
|
"_" = [ "trim_whitespace" ];
|
|
|
|
c = [ "clang_format" ];
|
|
|
|
cpp = [ "clang_format" ];
|
|
|
|
lua = [ "stylua" ];
|
|
|
|
nix = [ "alejandra" ];
|
|
|
|
rust = [ "rustfmt" ];
|
|
|
|
sh = [ "shfmt" ];
|
|
|
|
toml = [ "taplo" ];
|
|
|
|
yaml = [ "yamlfmt" ];
|
|
|
|
zig = [ "zigfmt" ];
|
2024-06-23 14:32:47 +02:00
|
|
|
};
|
2024-06-22 19:25:51 +02:00
|
|
|
};
|
2024-06-23 14:32:47 +02:00
|
|
|
gitsigns.enable = true;
|
|
|
|
lint = {
|
|
|
|
enable = true;
|
|
|
|
lintersByFt = {
|
2024-07-03 23:58:26 +02:00
|
|
|
rust = [ "typos" ];
|
|
|
|
latex = [
|
|
|
|
"chktex"
|
|
|
|
"typos"
|
|
|
|
];
|
|
|
|
markdown = [ "typos" ];
|
|
|
|
nix = [ "statix" ];
|
|
|
|
sh = [ "dash" ];
|
|
|
|
zsh = [ "zsh" ];
|
2024-06-23 14:32:47 +02:00
|
|
|
};
|
2024-06-22 19:25:51 +02:00
|
|
|
};
|
2024-06-23 14:32:47 +02:00
|
|
|
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;
|
|
|
|
};
|
2024-06-21 06:30:18 +02:00
|
|
|
};
|
2024-06-23 14:32:47 +02:00
|
|
|
ruff-lsp.enable = true;
|
|
|
|
taplo.enable = true;
|
|
|
|
# texlab.enable = true; # Not writing TeX rn
|
|
|
|
typos-lsp.enable = true;
|
|
|
|
typst-lsp.enable = true;
|
2024-06-21 06:30:18 +02:00
|
|
|
};
|
2024-06-22 19:25:51 +02:00
|
|
|
};
|
2024-06-23 14:32:47 +02:00
|
|
|
lspkind = {
|
|
|
|
enable = true;
|
|
|
|
mode = "symbol";
|
|
|
|
extraOptions.maxwidth = 50;
|
2024-06-22 19:25:51 +02:00
|
|
|
};
|
2024-06-23 14:32:47 +02:00
|
|
|
lualine = {
|
|
|
|
enable = true;
|
|
|
|
theme = lib.mkForce "gruvbox";
|
2024-06-22 19:25:51 +02:00
|
|
|
};
|
2024-06-23 14:32:47 +02:00
|
|
|
luasnip = {
|
|
|
|
enable = true;
|
|
|
|
extraConfig = {
|
|
|
|
update_events = "TextChanged,TextChangedI";
|
|
|
|
};
|
2024-06-22 19:25:51 +02:00
|
|
|
};
|
2024-06-23 14:32:47 +02:00
|
|
|
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;
|
|
|
|
};
|
2024-06-22 19:25:51 +02:00
|
|
|
};
|
2024-06-23 14:32:47 +02:00
|
|
|
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;
|
|
|
|
indent = true;
|
|
|
|
incrementalSelection.enable = true;
|
|
|
|
};
|
|
|
|
trouble = {
|
|
|
|
enable = true;
|
|
|
|
settings.auto_close = true;
|
2024-03-02 21:48:19 +01:00
|
|
|
};
|
2024-06-22 19:25:51 +02:00
|
|
|
};
|
|
|
|
}
|