mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/supermaven: init
Co-authored-by: Po Co <polniolino@gmail.com>
This commit is contained in:
parent
f8ed424711
commit
0bdc32e331
3 changed files with 105 additions and 0 deletions
40
plugins/by-name/supermaven/default.nix
Normal file
40
plugins/by-name/supermaven/default.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
|
name = "supermaven";
|
||||||
|
package = "supermaven-nvim";
|
||||||
|
moduleName = "supermaven-nvim";
|
||||||
|
packPathName = "supermaven-nvim";
|
||||||
|
|
||||||
|
maintainers = [ lib.maintainers.PoCo ];
|
||||||
|
|
||||||
|
# Register nvim-cmp association
|
||||||
|
imports = [
|
||||||
|
{ cmpSourcePlugins.supermaven = "supermaven"; }
|
||||||
|
];
|
||||||
|
|
||||||
|
extraConfig = {
|
||||||
|
dependencies.curl.enable = lib.mkDefault true;
|
||||||
|
};
|
||||||
|
|
||||||
|
settingsExample = lib.literalExpression ''
|
||||||
|
{
|
||||||
|
keymaps = {
|
||||||
|
accept_suggestion = "<Tab>";
|
||||||
|
clear_suggestions = "<C-]>";
|
||||||
|
accept_word = "<C-j>";
|
||||||
|
};
|
||||||
|
ignore_filetypes = [ "cpp" ];
|
||||||
|
color = {
|
||||||
|
suggestion_color = "#ffffff";
|
||||||
|
cterm = 244;
|
||||||
|
};
|
||||||
|
log_level = "info";
|
||||||
|
disable_inline_completion = false;
|
||||||
|
disable_keymaps = false;
|
||||||
|
condition = lib.nixvim.mkRaw '''
|
||||||
|
function()
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
''';
|
||||||
|
}'';
|
||||||
|
}
|
63
tests/test-sources/plugins/by-name/supermaven/default.nix
Normal file
63
tests/test-sources/plugins/by-name/supermaven/default.nix
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
# We don't run neovim here, as supermaven tries to download `sm-agent`
|
||||||
|
{
|
||||||
|
empty = {
|
||||||
|
test.runNvim = false;
|
||||||
|
plugins.supermaven.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
defaults = {
|
||||||
|
test.runNvim = false;
|
||||||
|
plugins.supermaven = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
keymaps = {
|
||||||
|
accept_suggestion = "<Tab>";
|
||||||
|
clear_suggestions = "<C-]>";
|
||||||
|
accept_word = "<C-j>";
|
||||||
|
};
|
||||||
|
ignore_filetypes = [ ];
|
||||||
|
color = {
|
||||||
|
suggestion_color = null;
|
||||||
|
cterm = null;
|
||||||
|
};
|
||||||
|
log_level = "info";
|
||||||
|
disable_inline_completion = false;
|
||||||
|
disable_keymaps = false;
|
||||||
|
condition.__raw = ''
|
||||||
|
function()
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
example = {
|
||||||
|
test.runNvim = false;
|
||||||
|
plugins.supermaven = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
keymaps = {
|
||||||
|
accept_suggestion = "<Tab>";
|
||||||
|
clear_suggestions = "<C-]>";
|
||||||
|
accept_word = "<C-j>";
|
||||||
|
};
|
||||||
|
ignore_filetypes = [ "cpp" ];
|
||||||
|
color = {
|
||||||
|
suggestion_color = "#ffffff";
|
||||||
|
cterm = 244;
|
||||||
|
};
|
||||||
|
log_level = "info";
|
||||||
|
disable_inline_completion = false;
|
||||||
|
disable_keymaps = false;
|
||||||
|
condition.__raw = ''
|
||||||
|
function()
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -25,6 +25,8 @@
|
||||||
"otter"
|
"otter"
|
||||||
# Invokes the `nix` command at startup which is not available in the sandbox
|
# Invokes the `nix` command at startup which is not available in the sandbox
|
||||||
"nixpkgs_maintainers"
|
"nixpkgs_maintainers"
|
||||||
|
# Needs internet access to download `sm-agent`
|
||||||
|
"supermaven"
|
||||||
] ++ optional (pkgs.stdenv.hostPlatform.system == "aarch64-linux") "cmp_tabnine";
|
] ++ optional (pkgs.stdenv.hostPlatform.system == "aarch64-linux") "cmp_tabnine";
|
||||||
in
|
in
|
||||||
pipe config.cmpSourcePlugins [
|
pipe config.cmpSourcePlugins [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue