mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 09:48:42 +02:00
tests/plugins: refactor (#235)
This commit is contained in:
parent
89f54be73a
commit
db5061b4db
38 changed files with 485 additions and 744 deletions
34
tests/test-sources/plugins/completion/lspkind.nix
Normal file
34
tests/test-sources/plugins/completion/lspkind.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
# Empty configuration
|
||||
empty = {
|
||||
plugins.lspkind.enable = true;
|
||||
};
|
||||
|
||||
example = {
|
||||
plugins = {
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers.clangd.enable = true;
|
||||
};
|
||||
nvim-cmp.enable = true;
|
||||
lspkind.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# All the upstream default options of lspkind
|
||||
defaults = {
|
||||
plugins.lspkind = {
|
||||
enable = true;
|
||||
mode = "symbol_text";
|
||||
preset = "codicons";
|
||||
symbolMap = null;
|
||||
cmp = {
|
||||
enable = true;
|
||||
maxWidth = 50;
|
||||
ellipsisChar = "...";
|
||||
menu = null;
|
||||
after = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
113
tests/test-sources/plugins/completion/nvim-cmp.nix
Normal file
113
tests/test-sources/plugins/completion/nvim-cmp.nix
Normal file
|
@ -0,0 +1,113 @@
|
|||
{
|
||||
# Empty configuration
|
||||
empty = {
|
||||
plugins.nvim-cmp.enable = true;
|
||||
};
|
||||
|
||||
snippetEngine = {
|
||||
plugins.nvim-cmp = {
|
||||
enable = true;
|
||||
snippet.expand = "luasnip";
|
||||
};
|
||||
};
|
||||
|
||||
# All the upstream default options of nvim-cmp
|
||||
defaults = {
|
||||
plugins.nvim-cmp = {
|
||||
enable = true;
|
||||
|
||||
performance = {
|
||||
debounce = 60;
|
||||
throttle = 30;
|
||||
fetchingTimeout = 500;
|
||||
};
|
||||
|
||||
preselect = "Item";
|
||||
|
||||
snippet = {
|
||||
expand.__raw = ''
|
||||
function(_)
|
||||
error('snippet engine is not configured.')
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
completion = {
|
||||
keywordLength = 1;
|
||||
keywordPattern = ''\%(-\?\d\+\%(\.\d\+\)\?\|\h\w*\%(-\w*\)*\)'';
|
||||
autocomplete = ["TextChanged"];
|
||||
completeopt = "menu,menuone,noselect";
|
||||
};
|
||||
|
||||
confirmation = {
|
||||
getCommitCharacters = ''
|
||||
function(commit_characters)
|
||||
return commit_characters
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
formatting = {
|
||||
expandableIndicator = true;
|
||||
fields = ["abbr" "kind" "menu"];
|
||||
format = ''
|
||||
function(_, vim_item)
|
||||
return vim_item
|
||||
end
|
||||
'';
|
||||
};
|
||||
|
||||
matching = {
|
||||
disallowFuzzyMatching = false;
|
||||
disallowFullfuzzyMatching = false;
|
||||
disallowPartialFuzzyMatching = true;
|
||||
disallowPartialMatching = false;
|
||||
disallowPrefixUnmatching = false;
|
||||
};
|
||||
|
||||
sorting = {
|
||||
priorityWeight = 2;
|
||||
comparators = [
|
||||
"offset"
|
||||
"exact"
|
||||
"score"
|
||||
"recently_used"
|
||||
"locality"
|
||||
"kind"
|
||||
"length"
|
||||
"order"
|
||||
];
|
||||
};
|
||||
|
||||
sources = [];
|
||||
|
||||
experimental = {
|
||||
ghost_text = false;
|
||||
};
|
||||
|
||||
view = {
|
||||
entries = {
|
||||
name = "custom";
|
||||
selection_order = "top_down";
|
||||
};
|
||||
};
|
||||
|
||||
window = {
|
||||
completion = {
|
||||
border = ["" "" "" "" "" "" "" ""];
|
||||
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,CursorLine:PmenuSel,Search:None";
|
||||
scrolloff = 0;
|
||||
colOffset = 0;
|
||||
sidePadding = 1;
|
||||
scrollbar = true;
|
||||
};
|
||||
documentation = {
|
||||
maxHeight = "math.floor(40 * (40 / vim.o.lines))";
|
||||
maxWidth = "math.floor((40 * 2) * (vim.o.columns / (40 * 2 * 16 / 9)))";
|
||||
border = ["" "" "" " " "" "" "" " "];
|
||||
winhighlight = "FloatBorder:NormalFloat";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue