feat(cli/nvf): add custom nix snippet for nvf
This commit is contained in:
parent
e65b478d21
commit
a668db89b3
5 changed files with 52 additions and 5 deletions
|
@ -12,10 +12,6 @@
|
|||
screensaver.timeout = lib.pantheon.mkStrOption;
|
||||
screensaver.command = lib.pantheon.mkStrOption;
|
||||
editor = lib.pantheon.mkStrOption;
|
||||
nvf.snippets = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.attrs;
|
||||
default = { };
|
||||
};
|
||||
file-browser = lib.pantheon.mkStrOption;
|
||||
multiplexer = lib.pantheon.mkStrOption;
|
||||
fetch = lib.pantheon.mkStrOption;
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ config, lib, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
config = lib.mkIf (config.cli.editor == "nvf") {
|
||||
home.sessionVariables.EDITOR = "nvim";
|
||||
|
@ -8,6 +13,7 @@
|
|||
programs.nvf = {
|
||||
enable = true;
|
||||
settings.vim = {
|
||||
startPlugins = [ pkgs.pantheon.snippets ];
|
||||
hideSearchHighlight = true;
|
||||
syntaxHighlighting = true;
|
||||
telescope.enable = true;
|
||||
|
|
8
packages/snippets/default.nix
Normal file
8
packages/snippets/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
inherit (pkgs.vimUtils) buildVimPlugin;
|
||||
in
|
||||
buildVimPlugin {
|
||||
name = "snippets";
|
||||
src = ./.;
|
||||
}
|
15
packages/snippets/package.json
Normal file
15
packages/snippets/package.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"name": "snippets",
|
||||
"engines": {
|
||||
"vscode": "^1.11.0"
|
||||
},
|
||||
"contributes": {
|
||||
"snippets": [
|
||||
{
|
||||
"language": "nix",
|
||||
"path": "./snippets/nix.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
22
packages/snippets/snippets/nix.json
Normal file
22
packages/snippets/snippets/nix.json
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"module": {
|
||||
"prefix": "mod",
|
||||
"body": [
|
||||
"{ config, lib, ... }:",
|
||||
"let",
|
||||
" inherit (lib) mkEnableOption mkIf;",
|
||||
" cfg = config.$1;",
|
||||
"in",
|
||||
"{",
|
||||
" options.$2 = {",
|
||||
" enable = mkEnableOption \"$3\";",
|
||||
" };",
|
||||
"",
|
||||
" config = mkIf cfg.enable {",
|
||||
" $4",
|
||||
" };",
|
||||
"}"
|
||||
],
|
||||
"description": "empty module"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue