tests/plugins: refactor (#235)

This commit is contained in:
Gaétan Lepage 2023-03-22 07:42:02 +01:00 committed by GitHub
parent 89f54be73a
commit db5061b4db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 485 additions and 744 deletions

View file

@ -0,0 +1,402 @@
{
# Empty configuration
empty = {
plugins.neo-tree.enable = true;
};
# All the upstream default options of neo-tree
defaults = {
plugins.neo-tree = {
enable = true;
sources = ["filesystem" "buffers" "git_status"];
addBlankLineAtTop = false;
autoCleanAfterSessionRestore = false;
closeIfLastWindow = false;
closeFloatsOnEscapeKey = true;
defaultSource = "filesystem";
enableDiagnostics = true;
enableGitStatus = true;
enableModifiedMarkers = true;
enableRefreshOnWrite = true;
gitStatusAsync = true;
gitStatusAsyncOptions = {
batchSize = 1000;
batchDelay = 10;
maxLines = 10000;
};
hideRootNode = false;
retainHiddenRootIndent = false;
logLevel = "info";
logToFile = false;
openFilesInLastWindow = true;
popupBorderStyle = "NC";
resizeTimerInterval = 500;
sortCaseInsensitive = false;
sortFunction = "nil";
usePopupsForInput = true;
useDefaultMappings = true;
sourceSelector = {
winbar = false;
statusline = false;
showScrolledOffParentNode = false;
tabLabels = {
filesystem = " Files ";
buffers = " Buffers ";
gitStatus = " Git ";
diagnostics = " Diagnostics ";
};
contentLayout = "start";
tabsLayout = "equal";
truncationCharacter = "";
tabsMinWidth = null;
tabsMaxWidth = null;
padding = 0;
separator = {
left = "";
right = "";
};
separatorActive = null;
showSeparatorOnEdge = false;
highlightTab = "NeoTreeTabInactive";
highlightTabActive = "NeoTreeTabActive";
highlightBackground = "NeoTreeTabInactive";
highlightSeparator = "NeoTreeTabSeparatorInactive";
highlightSeparatorActive = "NeoTreeTabSeparatorActive";
};
eventHandlers = {
before_render = ''
function (state)
-- add something to the state that can be used by custom components
end
'';
file_opened = ''
function(file_path)
--auto close
require("neo-tree").close_all()
end
'';
};
defaultComponentConfigs = {
container = {
enableCharacterFade = true;
width = "100%";
rightPadding = 0;
};
diagnostics = {
symbols = {
hint = "H";
info = "I";
warn = "!";
error = "X";
};
highlights = {
hint = "DiagnosticSignHint";
info = "DiagnosticSignInfo";
warn = "DiagnosticSignWarn";
error = "DiagnosticSignError";
};
};
indent = {
indentSize = 2;
padding = 1;
withMarkers = true;
indentMarker = "";
lastIndentMarker = "";
highlight = "NeoTreeIndentMarker";
withExpanders = null;
expanderCollapsed = "";
expanderExpanded = "";
expanderHighlight = "NeoTreeExpander";
};
icon = {
folderClosed = "";
folderOpen = "";
folderEmpty = "";
folderEmptyOpen = "";
default = "*";
highlight = "NeoTreeFileIcon";
};
modified = {
symbol = "[+] ";
highlight = "NeoTreeModified";
};
name = {
trailingSlash = false;
useGitStatusColors = true;
highlight = "NeoTreeFileName";
};
gitStatus = {
symbols = {
added = "";
deleted = "";
modified = "";
renamed = "";
untracked = "";
ignored = "";
unstaged = "";
staged = "";
conflict = "";
};
align = "right";
};
};
renderers = {
directory = [
"indent"
"icon"
"current_filter"
{
name = "container";
content = [
{
name = "name";
zindex = 10;
}
{
name = "clipboard";
zindex = 10;
}
{
name = "diagnostics";
errors_only = true;
zindex = 20;
align = "right";
hide_when_expanded = true;
}
{
name = "git_status";
zindex = 20;
align = "right";
hide_when_expanded = true;
}
];
}
];
file = [
"indent"
"icon"
{
name = "container";
content = [
{
name = "name";
zindex = 10;
}
{
name = "clipboard";
zindex = 10;
}
{
name = "bufnr";
zindex = 10;
}
{
name = "modified";
zindex = 20;
align = "right";
}
{
name = "diagnostics";
zindex = 20;
align = "right";
}
{
name = "git_status";
zindex = 20;
align = "right";
}
];
}
];
message = [
{
name = "indent";
with_markers = false;
}
{
name = "name";
highlight = "NeoTreeMessage";
}
];
terminal = [
"indent"
"icon"
"name"
"bufnr"
];
};
nestingRules = {};
window = {
position = "left";
width = 40;
height = 15;
autoExpandWidth = false;
popup = {
size = {
height = "80%";
width = "50%";
};
position = "80%";
};
sameLevel = false;
insertAs = "child";
mappingOptions = {
noremap = true;
nowait = true;
};
mappings = {
"<space>" = {
command = "toggle_node";
# disable `nowait` if you have existing combos starting with this char that you want to use
nowait = false;
};
"<2-LeftMouse>" = "open";
"<cr>" = "open";
"<esc>" = "revert_preview";
P = {
command = "toggle_preview";
config = {use_float = true;};
};
l = "focus_preview";
S = "open_split";
# S = "split_with_window_picker";
s = "open_vsplit";
# s = "vsplit_with_window_picker";
t = "open_tabnew";
# "<cr>" = "open_drop";
# t = "open_tab_drop";
w = "open_with_window_picker";
C = "close_node";
z = "close_all_nodes";
# Z = "expand_all_nodes";
R = "refresh";
a = {
command = "add";
# some commands may take optional config options, see `:h neo-tree-mappings` for details
config = {
show_path = "none"; # "none", "relative", "absolute"
};
};
A = "add_directory"; # also accepts the config.show_path and config.insert_as options.
d = "delete";
r = "rename";
y = "copy_to_clipboard";
x = "cut_to_clipboard";
p = "paste_from_clipboard";
c = "copy"; # takes text input for destination, also accepts the config.show_path and config.insert_as options
m = "move"; # takes text input for destination, also accepts the config.show_path and config.insert_as options
e = "toggle_auto_expand_width";
q = "close_window";
"?" = "show_help";
"<" = "prev_source";
">" = "next_source";
};
};
filesystem = {
window = {
mappings = {
H = "toggle_hidden";
"/" = "fuzzy_finder";
D = "fuzzy_finder_directory";
# "/" = "filter_as_you_type"; # this was the default until v1.28
"#" = "fuzzy_sorter"; # fuzzy sorting using the fzy algorithm
# D = "fuzzy_sorter_directory";
f = "filter_on_submit";
"<C-x>" = "clear_filter";
"<bs>" = "navigate_up";
"." = "set_root";
"[g" = "prev_git_modified";
"]g" = "next_git_modified";
};
};
asyncDirectoryScan = "auto";
scanMode = "shallow";
bindToCwd = true;
cwdTarget = {
sidebar = "tab";
current = "window";
};
filteredItems = {
visible = false;
forceVisibleInEmptyFolder = false;
showHiddenCount = true;
hideDotfiles = true;
hideGitignored = true;
hideHidden = true;
hideByName = [
".DS_Store"
"thumbs.db"
];
hideByPattern = [];
alwaysShow = [];
neverShow = [];
neverShowByPattern = [];
};
findByFullPathWords = false;
findCommand = "fd";
findArgs = {
fd = [
"--exclude"
".git"
"--exclude"
"node_modules"
];
};
groupEmptyDirs = false;
searchLimit = 50;
followCurrentFile = false;
hijackNetrwBehavior = "open_default";
useLibuvFileWatcher = false;
};
buffers = {
bindToCwd = true;
followCurrentFile = true;
groupEmptyDirs = true;
window = {
mappings = {
"<bs>" = "navigate_up";
"." = "set_root";
bd = "buffer_delete";
};
};
};
gitStatus = {
window = {
mappings = {
A = "git_add_all";
gu = "git_unstage_file";
ga = "git_add_file";
gr = "git_revert_file";
gc = "git_commit";
gp = "git_push";
gg = "git_commit_and_push";
};
};
};
example = {
renderers = {
custom = [
"indent"
{
name = "icon";
default = "C";
}
"custom"
"name"
];
};
window = {
mappings = {
"<cr>" = "toggle_node";
"<C-e>" = "example_command";
d = "show_debug_info";
};
};
};
};
};
}

View file

@ -0,0 +1,13 @@
{
empty = {
plugins.netman.enable = true;
};
withNeotree = {
plugins.neo-tree.enable = true;
plugins.netman = {
enable = true;
neoTreeIntegration = true;
};
};
}

View file

@ -0,0 +1,35 @@
{
# Empty configuration
empty = {
plugins.nvim-autopairs.enable = true;
};
# All the upstream default options of trouble
defaults = {
plugins.nvim-autopairs = {
enable = true;
pairs = null;
disabledFiletypes = ["TelescopePrompt" "spectre_panel"];
disableInMacro = false;
disableInVisualblock = false;
disableInReplaceMode = true;
ignoredNextChar = "[=[[%w%%%'%[%\"%.%`%$]]=]";
enableMoveright = true;
enableAfterQuote = true;
enableCheckBracketLine = true;
enableBracketInQuote = true;
enableAbbr = false;
breakUndo = true;
checkTs = false;
tsConfig = {
lua = ["string" "source"];
javascript = ["string" "template_string"];
};
mapCr = true;
mapBs = true;
mapCH = false;
mapCW = false;
};
};
}

View file

@ -0,0 +1,18 @@
{
empty = {
plugins.nvim-osc52.enable = true;
};
defaults = {
plugins.nvim-osc52 = {
maxLength = 0;
silent = false;
trim = false;
keymaps = {
silent = false;
enable = true;
};
};
};
}

View file

@ -0,0 +1,275 @@
{
# Empty configuration
empty = {
plugins.nvim-tree.enable = true;
};
# All the upstream default options of nvim-tree
defaults = {
plugins.nvim-tree = {
enable = true;
disableNetrw = true;
hijackNetrw = false;
openOnSetup = true;
openOnSetupFile = true;
ignoreBufferOnSetup = true;
ignoreFtOnSetup = ["tex"];
autoClose = true;
autoReloadOnWrite = true;
sortBy = "name";
hijackUnnamedBufferWhenOpening = false;
hijackCursor = false;
rootDirs = [];
preferStartupRoot = false;
syncRootWithCwd = false;
reloadOnBufenter = false;
respectBufCwd = false;
hijackDirectories = {
enable = true;
autoOpen = true;
};
updateFocusedFile = {
enable = false;
updateRoot = false;
ignoreList = [];
};
systemOpen = {
cmd = "";
args = [];
};
diagnostics = {
enable = false;
debounceDelay = 50;
showOnDirs = false;
showOnOpenDirs = true;
icons = {
hint = "";
info = "";
warning = "";
error = "";
};
severity = {
min = "hint";
max = "error";
};
};
git = {
enable = true;
ignore = true;
showOnDirs = true;
showOnOpenDirs = true;
timeout = 400;
};
modified = {
enable = false;
showOnDirs = true;
showOnOpenDirs = true;
};
filesystemWatchers = {
enable = true;
debounceDelay = 50;
ignoreDirs = [];
};
onAttach = "default";
removeKeymaps = false;
selectPrompts = false;
view = {
centralizeSelection = false;
cursorline = true;
debounceDelay = 15;
hideRootFolder = false;
width = {
min = 30;
max = -1;
padding = 1;
};
side = "left";
preserveWindowProportions = false;
number = false;
relativenumber = false;
signcolumn = "yes";
mappings = {
customOnly = false;
list = [
# remove a default mapping for cd
{
key = "<2-RightMouse>";
action = "";
}
# add multiple normal mode mappings for edit
{
key = ["<CR>" "o"];
action = "edit";
mode = "n";
}
# custom action
{
key = "p";
action = "print_the_node_path";
action_cb = ''
function(node)
print(node.absolute_path)
end
'';
}
];
};
float = {
enable = false;
quitOnFocusLoss = true;
openWinConfig = {
col = 1;
row = 1;
relative = "cursor";
border = "shadow";
style = "minimal";
};
};
};
renderer = {
addTrailing = false;
groupEmpty = false;
fullName = false;
highlightGit = false;
highlightOpenedFiles = "none";
highlightModified = "none";
rootFolderLabel = ":~:s?$?/..?";
indentWidth = 2;
indentMarkers = {
enable = false;
inlineArrows = true;
icons = {
corner = "";
edge = "";
item = "";
bottom = "";
none = " ";
};
};
icons = {
webdevColors = true;
gitPlacement = "before";
modifiedPlacement = "after";
padding = " ";
symlinkArrow = " ";
show = {
file = true;
folder = true;
folderArrow = true;
git = true;
modified = true;
};
glyphs = {
default = "";
symlink = "";
modified = "";
folder = {
arrowClosed = "";
arrowOpen = "";
default = "";
open = "";
empty = "";
emptyOpen = "";
symlink = "";
symlinkOpen = "";
};
git = {
unstaged = "";
staged = "";
unmerged = "";
renamed = "";
untracked = "";
deleted = "";
ignored = "";
};
};
};
specialFiles = ["Cargo.toml" "Makefile" "README.md" "readme.md"];
symlinkDestination = true;
};
filters = {
dotfiles = false;
gitClean = false;
noBuffer = false;
custom = [];
exclude = [];
};
actions = {
changeDir = {
enable = true;
global = false;
restrictAboveCwd = false;
};
expandAll = {
maxFolderDiscovery = 300;
exclude = [];
};
filePopup = {
openWinConfig = {
col = 1;
row = 1;
relative = "cursor";
border = "shadow";
style = "minimal";
};
};
openFile = {
quitOnOpen = false;
resizeWindow = true;
};
windowPicker = {
enable = true;
picker = "default";
chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
exclude = {
filetype = ["notify" "packer" "qf" "diff" "fugitive" "fugitiveblame"];
buftype = ["nofile" "terminal" "help"];
};
};
removeFile = {
closeWindow = true;
};
useSystemClipboard = true;
};
liveFilter = {
prefix = "[FILTER]: ";
alwaysShowFolders = true;
};
tab = {
sync = {
open = false;
close = false;
ignore = [];
};
};
notify = {
threshold = "info";
};
ui = {
confirm = {
remove = true;
trash = true;
};
};
log = {
enable = false;
truncate = false;
types = {
all = false;
profile = false;
config = false;
copyPaste = false;
dev = false;
diagnostics = false;
git = false;
watcher = false;
};
};
};
};
}

View file

@ -0,0 +1,46 @@
{
empty = {
plugins.sniprun.enable = true;
};
default = {
plugins.sniprun = {
enable = true;
selectedInterpreters = [];
replEnable = [];
replDisable = [];
interpreterOptions = {};
display = ["Classic" "VirtualTextOk"];
liveDisplay = ["VirtualTextOk"];
displayOptions = {
terminalWidth = 45;
notificationTimeout = 5;
};
showNoOutput = ["Classic" "TempFloatingWindow"];
snipruncolors = {
SniprunVirtualTextOk = {
bg = "#66eeff";
fg = "#000000";
ctermbg = "Cyan";
ctermfg = "Black";
};
SniprunFloatingWinOk = {
fg = "#66eeff";
ctermfg = "Cyan";
};
SniprunVirtualTextErr = {
bg = "#881515";
fg = "#000000";
ctermbg = "DarkRed";
ctermfg = "Black";
};
SniprunFloatingWinErr = {
fg = "#881515";
ctermfg = "DarkRed";
};
};
liveModeToggle = "off";
borders = "single";
};
};
}

View file

@ -0,0 +1,112 @@
{
# Empty configuration
empty = {
plugins.todo-comments.enable = true;
};
# All the upstream default options of todo-comments
defaults = {
plugins.todo-comments = {
enable = true;
signs = true;
signPriority = 8;
keywords = {
FIX = {
icon = " ";
color = "error";
alt = ["FIXME" "BUG" "FIXIT" "ISSUE"];
signs = false;
};
TODO = {
icon = " ";
color = "info";
};
HACK = {
icon = " ";
color = "warning";
};
WARN = {
icon = " ";
color = "warning";
alt = ["WARNING" "XXX"];
};
PERF = {
icon = " ";
alt = ["OPTIM" "PERFORMANCE" "OPTIMIZE"];
};
NOTE = {
icon = " ";
color = "hint";
alt = ["INFO"];
};
TEST = {
icon = " ";
color = "test";
alt = ["TESTING" "PASSED" "FAILED"];
};
};
guiStyle = {
fg = "NONE";
bg = "BOLD";
};
mergeKeywords = true;
highlight = {
multiline = true;
multilinePattern = "^.";
multilineContext = 10;
before = "";
keyword = "wide";
after = "fg";
pattern = ''.*<(KEYWORDS)\s*:'';
commentsOnly = true;
maxLineLen = 400;
exclude = [];
};
colors = {
error = ["DiagnosticError" "ErrorMsg" "#DC2626"];
warning = ["DiagnosticWarn" "WarningMsg" "#FBBF24"];
info = ["DiagnosticInfo" "#2563EB"];
hint = ["DiagnosticHint" "#10B981"];
default = ["Identifier" "#7C3AED"];
test = ["Identifier" "#FF00FF"];
};
search = {
command = "rg";
args = [
"--color=never"
"--no-heading"
"--with-filename"
"--line-number"
"--column"
];
pattern = ''\b(KEYWORDS):'';
};
keymapsSilent = true;
keymaps = {
todoQuickFix.key = "<C-a>";
todoLocList = {
key = "<C-f>";
cwd = "~/projects/foobar";
keywords = "TODO,FIX";
};
todoTrouble = {
key = "<C-t>";
keywords = "TODO,FIX";
};
todoTelescope = {
key = "<C-e>";
cwd = "~/projects/foobar";
};
};
};
};
}

View file

@ -0,0 +1,18 @@
{
empty = {
plugins.vim-bbye.enable = true;
};
test = {
plugins.vim-bbye = {
enable = true;
keymapsSilent = false;
keymaps = {
bdelete = "<C-w>";
bwipeout = "<C-t>";
};
};
};
}