2024-04-05 11:55:35 +02:00
|
|
|
{
|
2024-05-04 20:57:33 +02:00
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
}: {
|
2024-04-02 17:05:17 +02:00
|
|
|
bacon = {
|
|
|
|
enable = true;
|
|
|
|
settings.quickfix.enabled = true;
|
|
|
|
};
|
2024-03-08 23:14:18 +01:00
|
|
|
cmp = {
|
|
|
|
enable = true;
|
|
|
|
cmdline = {
|
|
|
|
"/" = {
|
|
|
|
mapping.__raw = "cmp.mapping.preset.cmdline()";
|
2024-04-05 11:55:35 +02:00
|
|
|
sources = [
|
2024-05-04 20:57:33 +02:00
|
|
|
{name = "rg";}
|
|
|
|
{name = "buffer";}
|
2024-04-05 11:55:35 +02:00
|
|
|
];
|
2024-03-08 23:14:18 +01:00
|
|
|
};
|
|
|
|
":" = {
|
|
|
|
mapping.__raw = "cmp.mapping.preset.cmdline()";
|
2024-04-05 11:55:35 +02:00
|
|
|
sources = [
|
2024-05-04 20:57:33 +02:00
|
|
|
{name = "path";}
|
|
|
|
{name = "cmdline";}
|
2024-04-05 11:55:35 +02:00
|
|
|
];
|
2024-03-08 23:14:18 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
settings = {
|
|
|
|
# Snippets
|
|
|
|
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
|
|
|
|
# Completion Sources
|
|
|
|
sources = [
|
2024-04-05 11:55:35 +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-03-08 23:14:18 +01:00
|
|
|
];
|
|
|
|
mapping.__raw = ''
|
|
|
|
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-04-05 11:49:48 +02:00
|
|
|
# FIXME: doesn't include formatters
|
2024-03-02 21:48:19 +01:00
|
|
|
conform-nvim = {
|
|
|
|
enable = true;
|
|
|
|
formattersByFt = {
|
2024-05-04 20:57:33 +02:00
|
|
|
"_" = ["trim_whitespace"];
|
|
|
|
c = ["clang_format"];
|
|
|
|
cpp = ["clang_format"];
|
|
|
|
lua = ["stylua"];
|
|
|
|
nix = ["nixpkgs_fmt"];
|
|
|
|
rust = ["rustfmt"];
|
|
|
|
sh = ["shfmt"];
|
|
|
|
toml = ["taplo"];
|
|
|
|
yaml = ["yamlfmt"];
|
|
|
|
zig = ["zigfmt"];
|
2024-03-02 21:48:19 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
gitsigns.enable = true;
|
|
|
|
lsp = {
|
|
|
|
enable = true;
|
|
|
|
servers = {
|
|
|
|
bashls.enable = true;
|
|
|
|
clangd.enable = true;
|
|
|
|
html.enable = true;
|
|
|
|
jsonls.enable = true;
|
|
|
|
nil_ls.enable = true;
|
|
|
|
pyright.enable = true;
|
|
|
|
ruff-lsp.enable = true;
|
|
|
|
taplo.enable = true;
|
|
|
|
texlab.enable = true;
|
|
|
|
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;
|
2024-04-05 11:55:35 +02:00
|
|
|
extraConfig = {
|
|
|
|
update_events = "TextChanged,TextChangedI";
|
|
|
|
};
|
2024-03-02 21:48:19 +01:00
|
|
|
};
|
2024-03-04 22:17:42 +01:00
|
|
|
noice = {
|
|
|
|
enable = true;
|
|
|
|
presets = {
|
|
|
|
# use a classic bottom cmdline for search
|
|
|
|
bottom_search = true;
|
|
|
|
# position the cmdline and popupmenu together
|
|
|
|
command_palette = true;
|
|
|
|
# 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 = false;
|
|
|
|
};
|
|
|
|
};
|
2024-03-02 21:48:19 +01:00
|
|
|
nvim-colorizer = {
|
|
|
|
enable = true;
|
|
|
|
userDefaultOptions = {
|
|
|
|
names = false; # disable named colors (i.e. red)
|
|
|
|
mode = "virtualtext";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
rustaceanvim.enable = true;
|
2024-03-04 22:18:12 +01:00
|
|
|
telescope = {
|
|
|
|
enable = true;
|
|
|
|
extensions = {
|
|
|
|
ui-select.enable = true;
|
|
|
|
fzy-native.enable = true;
|
|
|
|
};
|
|
|
|
};
|
2024-03-02 21:48:19 +01:00
|
|
|
treesitter = {
|
|
|
|
enable = true;
|
|
|
|
indent = true;
|
|
|
|
incrementalSelection.enable = true;
|
2024-05-04 20:57:33 +02:00
|
|
|
grammarPackages = let
|
|
|
|
parsers = pkgs.vimPlugins.nvim-treesitter-parsers;
|
|
|
|
in [
|
|
|
|
parsers.asm
|
|
|
|
parsers.bash
|
|
|
|
# parsers.bibtex
|
|
|
|
parsers.c
|
|
|
|
parsers.comment
|
|
|
|
parsers.commonlisp
|
|
|
|
parsers.cpp
|
|
|
|
parsers.css
|
|
|
|
parsers.csv
|
|
|
|
# parsers.d
|
|
|
|
parsers.diff
|
|
|
|
parsers.dockerfile
|
|
|
|
parsers.dot
|
|
|
|
parsers.doxygen
|
|
|
|
parsers.git_config
|
|
|
|
parsers.git_rebase
|
|
|
|
parsers.gitattributes
|
|
|
|
parsers.gitcommit
|
|
|
|
parsers.gitignore
|
|
|
|
parsers.go
|
|
|
|
parsers.gomod
|
|
|
|
parsers.gosum
|
|
|
|
parsers.gowork
|
|
|
|
parsers.html
|
|
|
|
parsers.ini
|
|
|
|
parsers.json
|
|
|
|
parsers.json5
|
|
|
|
parsers.jsonc
|
|
|
|
# parsers.latex
|
|
|
|
parsers.lua
|
|
|
|
parsers.luadoc
|
|
|
|
parsers.luap
|
|
|
|
parsers.luau
|
|
|
|
parsers.make
|
|
|
|
parsers.markdown
|
|
|
|
parsers.markdown_inline
|
|
|
|
parsers.meson
|
|
|
|
parsers.nix
|
|
|
|
parsers.ocaml
|
|
|
|
parsers.ocaml_interface
|
|
|
|
parsers.pem
|
|
|
|
parsers.python
|
|
|
|
parsers.rust
|
|
|
|
parsers.scheme
|
|
|
|
parsers.sql
|
|
|
|
parsers.ssh_config
|
|
|
|
parsers.toml
|
|
|
|
parsers.tsv
|
|
|
|
parsers.vim
|
|
|
|
parsers.vimdoc
|
|
|
|
parsers.wgsl
|
|
|
|
parsers.wgsl_bevy
|
|
|
|
parsers.yaml
|
|
|
|
parsers.zig
|
|
|
|
];
|
2024-03-02 21:48:19 +01:00
|
|
|
};
|
|
|
|
trouble = {
|
|
|
|
enable = true;
|
2024-03-26 21:03:09 +01:00
|
|
|
settings.auto_close = true;
|
2024-03-02 21:48:19 +01:00
|
|
|
};
|
|
|
|
lint = {
|
|
|
|
enable = true;
|
|
|
|
lintersByFt = {
|
2024-05-04 20:57:33 +02:00
|
|
|
rust = ["typos"];
|
2024-04-05 11:55:35 +02:00
|
|
|
latex = [
|
|
|
|
"chktex"
|
|
|
|
"typos"
|
|
|
|
];
|
2024-05-04 20:57:33 +02:00
|
|
|
markdown = ["typos"];
|
2024-03-02 21:48:19 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|