feat(editor): remove standalone snippets package, move config to nvf module
This commit is contained in:
parent
50e0d971ae
commit
3b5eefe456
6 changed files with 16 additions and 63 deletions
6
flake.lock
generated
6
flake.lock
generated
|
@ -474,11 +474,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750184939,
|
"lastModified": 1750247856,
|
||||||
"narHash": "sha256-kbKV8EJjyEEiAL03pQk4k1dUn5VRjYzI0FyDoaPchNc=",
|
"narHash": "sha256-+fGlDHq+4RoURurxUFrSBtHN81EZq0qk1Xn9+7ShmfM=",
|
||||||
"owner": "rrvsh",
|
"owner": "rrvsh",
|
||||||
"repo": "nvf",
|
"repo": "nvf",
|
||||||
"rev": "7f1acefe918072d9567ac3541ca67581f4c4c02e",
|
"rev": "62494c01644e199c3b31aa617e67adad49a6d56e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -5,23 +5,21 @@
|
||||||
setupOpts.enable_autosnippets = true;
|
setupOpts.enable_autosnippets = true;
|
||||||
providers = with pkgs.vimPlugins; [ vim-snippets ];
|
providers = with pkgs.vimPlugins; [ vim-snippets ];
|
||||||
customSnippets.snipmate = {
|
customSnippets.snipmate = {
|
||||||
all = [
|
|
||||||
{
|
|
||||||
trigger = "if";
|
|
||||||
body = "if $1 else $2";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
nix = [
|
nix = [
|
||||||
{
|
{
|
||||||
trigger = "mkOption";
|
trigger = "mod";
|
||||||
body = ''
|
description = "empty module";
|
||||||
mkOption {
|
body = # nix
|
||||||
type = $1;
|
''
|
||||||
default = $2;
|
{config, lib}:
|
||||||
description = $3;
|
let
|
||||||
example = $4;
|
cfg = config.$1;
|
||||||
}
|
in
|
||||||
'';
|
{
|
||||||
|
options.$1 = { $2 };
|
||||||
|
config = $3;
|
||||||
|
}
|
||||||
|
'';
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,8 +7,6 @@ in
|
||||||
persistDirs = singleton ".local/share/nvf";
|
persistDirs = singleton ".local/share/nvf";
|
||||||
programs.nvf.enable = true;
|
programs.nvf.enable = true;
|
||||||
programs.nvf.settings.vim = {
|
programs.nvf.settings.vim = {
|
||||||
startPlugins = [ pkgs.pantheon.snippets ];
|
|
||||||
|
|
||||||
hideSearchHighlight = true;
|
hideSearchHighlight = true;
|
||||||
syntaxHighlighting = true;
|
syntaxHighlighting = true;
|
||||||
telescope.enable = true;
|
telescope.enable = true;
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
let
|
|
||||||
inherit (pkgs.vimUtils) buildVimPlugin;
|
|
||||||
in
|
|
||||||
buildVimPlugin {
|
|
||||||
name = "snippets";
|
|
||||||
src = ./.;
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
{
|
|
||||||
"name": "snippets",
|
|
||||||
"engines": {
|
|
||||||
"vscode": "^1.11.0"
|
|
||||||
},
|
|
||||||
"contributes": {
|
|
||||||
"snippets": [
|
|
||||||
{
|
|
||||||
"language": "nix",
|
|
||||||
"path": "./snippets/nix.json"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
"module": {
|
|
||||||
"prefix": "mod",
|
|
||||||
"body": [
|
|
||||||
"{ config, lib, ... }:",
|
|
||||||
"let",
|
|
||||||
" inherit (lib) mkIf mkEnableOption;",
|
|
||||||
" cfg = config.$1;",
|
|
||||||
"in",
|
|
||||||
"{",
|
|
||||||
" options.$1 = {",
|
|
||||||
" enable = mkEnableOption \"$2\";",
|
|
||||||
" $3",
|
|
||||||
" };",
|
|
||||||
" config = mkIf cfg.enable {$4};",
|
|
||||||
"}"
|
|
||||||
],
|
|
||||||
"description": "empty module"
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue