mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-25 06:36:46 +00:00
fd65c83956
Some checks failed
Set up binary cache / cachix (default) (push) Has been cancelled
Set up binary cache / cachix (maximal) (push) Has been cancelled
Set up binary cache / cachix (nix) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-html) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-json) (push) Has been cancelled
Validate flake & check documentation / Validate Flake Documentation (docs-manpages) (push) Has been cancelled
Validate flake & check formatting / Validate Flake (push) Has been cancelled
Validate flake & check formatting / Formatting via Alejandra (push) Has been cancelled
Build and deploy documentation / publish (push) Has been cancelled
* plugins/new-file-template: init module * docs: add release note entry about new-file-template.nvim * docs: update jacekpoz's link * plugins/new-file-template: remove _: in default.nix * plugins/new-file-template: add example for disableSpecific * plugins/new-file-template: add docs on how to add custom templates * plugins/new-file-template: fix disableSpecific example * plugins/new-file-template: improve documentation * plugins/new-file-template: remove redundant example * plugins/new-file-template: more compact docs * plugins/new-file-template: more doc improvements * plugins/new-file-template: fix formatting issue
55 lines
1.7 KiB
Nix
55 lines
1.7 KiB
Nix
{lib, ...}: let
|
|
inherit (lib.options) mkOption;
|
|
inherit (lib.types) attrsOf bool listOf str;
|
|
inherit (lib.nvim.types) mkPluginSetupOption;
|
|
in {
|
|
options.vim.utility.new-file-template = {
|
|
enable = mkOption {
|
|
type = bool;
|
|
default = false;
|
|
description = ''
|
|
new-file-template.nvim: Automatically insert a template on new files in neovim.
|
|
::: {.note}
|
|
For custom templates add a directory containing `lua/templates/*.lua`
|
|
to `vim.additionalRuntimePaths`.
|
|
:::
|
|
[custom-template-docs]: https://github.com/otavioschwanck/new-file-template.nvim?tab=readme-ov-file#creating-new-templates
|
|
More documentation on the templates available at [custom-template-docs]
|
|
'';
|
|
};
|
|
|
|
setupOpts = mkPluginSetupOption "nvim-file-template.nvim" {
|
|
disableInsert = mkOption {
|
|
type = bool;
|
|
default = false;
|
|
description = "Enter insert mode after inserting the template";
|
|
};
|
|
|
|
disableAutocmd = mkOption {
|
|
type = bool;
|
|
default = false;
|
|
description = "Disable the autocmd that creates the template";
|
|
};
|
|
|
|
disableFiletype = mkOption {
|
|
type = listOf str;
|
|
default = [];
|
|
description = "Disable default templates for specific filetypes";
|
|
};
|
|
|
|
disableSpecific = mkOption {
|
|
type = attrsOf (listOf str);
|
|
default = {};
|
|
description = "Disable specific regexp for the default templates.";
|
|
example = "{ ruby = [\".*\"]; }";
|
|
};
|
|
|
|
suffixAsFiletype = mkOption {
|
|
type = bool;
|
|
default = false;
|
|
description = "Use suffix of filename rather than `vim.bo.filetype` as filetype";
|
|
};
|
|
};
|
|
};
|
|
}
|