mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/easy-dotnet: init
This commit is contained in:
parent
13341a4c12
commit
78b6f8e1e5
2 changed files with 240 additions and 0 deletions
54
plugins/by-name/easy-dotnet/default.nix
Normal file
54
plugins/by-name/easy-dotnet/default.nix
Normal file
|
@ -0,0 +1,54 @@
|
|||
{ lib, config, ... }:
|
||||
lib.nixvim.plugins.mkNeovimPlugin {
|
||||
name = "easy-dotnet";
|
||||
packPathName = "easy-dotnet.nvim";
|
||||
package = "easy-dotnet-nvim";
|
||||
|
||||
maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
settingsExample = lib.literalExpression ''
|
||||
{
|
||||
test_runner = {
|
||||
enable_buffer_test_execution = true;
|
||||
viewmode = "float";
|
||||
};
|
||||
auto_bootstrap_namespace = true;
|
||||
terminal.__raw = '''
|
||||
function(path, action, args)
|
||||
local commands = {
|
||||
run = function()
|
||||
return string.format("dotnet run --project %s %s", path, args)
|
||||
end,
|
||||
test = function()
|
||||
return string.format("dotnet test %s %s", path, args)
|
||||
end,
|
||||
restore = function()
|
||||
return string.format("dotnet restore %s %s", path, args)
|
||||
end,
|
||||
build = function()
|
||||
return string.format("dotnet build %s %s", path, args)
|
||||
end,
|
||||
}
|
||||
|
||||
local command = commands[action]() .. "\r"
|
||||
require("toggleterm").exec(command, nil, nil, nil, "float")
|
||||
end
|
||||
''';
|
||||
picker = "fzf";
|
||||
}
|
||||
'';
|
||||
|
||||
extraConfig = cfg: {
|
||||
warnings = lib.nixvim.mkWarnings "plugins.easy-dotnet" (
|
||||
lib.mapAttrsToList
|
||||
(pickerName: pluginName: {
|
||||
when = (cfg.settings.picker or null == pickerName) && (!config.plugins.${pluginName}.enable);
|
||||
message = "You have chosen to use '${pickerName}' as a picker but 'plugins.${pluginName}' is not enabled.";
|
||||
})
|
||||
{
|
||||
fzf = "fzf-lua";
|
||||
telescope = "telescope";
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue