mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-13 10:44:34 +02:00
plugins/gx: init
Strip `lib` from `lib.types.` Co-authored-by: Gaétan Lepage <33058747+GaetanLepage@users.noreply.github.com> Fix settingsExample expression Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk> Use '-version of options for better examples Fix indentation in example lua code Remove trailing space Replace use of literalLua with strings Revert to use literalLua Use lib.mkDefault Co-authored-by: Gaétan Lepage <33058747+GaetanLepage@users.noreply.github.com>
This commit is contained in:
parent
683e5ea4b5
commit
16f92ff8a6
2 changed files with 186 additions and 0 deletions
64
tests/test-sources/plugins/by-name/gx/default.nix
Normal file
64
tests/test-sources/plugins/by-name/gx/default.nix
Normal file
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
empty = {
|
||||
plugins.gx.enable = true;
|
||||
};
|
||||
|
||||
default = {
|
||||
plugins.gx = {
|
||||
enable = true;
|
||||
|
||||
disableNetrwGx = true;
|
||||
|
||||
settings = {
|
||||
open_browser_app = null;
|
||||
open_browser_args = [ ];
|
||||
handlers = { };
|
||||
handler_options = {
|
||||
search_engine = "google";
|
||||
select_for_search = false;
|
||||
git_remotes = [
|
||||
"upstream"
|
||||
"origin"
|
||||
];
|
||||
git_remote_push = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
example = {
|
||||
plugins.gx = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
handlers = {
|
||||
rust = {
|
||||
name = "rust";
|
||||
filetype = [ "toml" ];
|
||||
filename = "Cargo.toml";
|
||||
handle.__raw = ''
|
||||
function(mode, line, _)
|
||||
local crate = require("gx.helper").find(line, mode, "(%w+)%s-=%s")
|
||||
|
||||
if crate then
|
||||
return "https://crates.io/crates/" .. crate
|
||||
end
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
handler_options = {
|
||||
search_engine = "duckduckgo";
|
||||
git_remotes.__raw = ''
|
||||
function(fname)
|
||||
if fname:match("myproject") then
|
||||
return { "mygit" }
|
||||
end
|
||||
return { "upstream", "origin" }
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue