mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 21:30:51 +00:00
Compare commits
3 commits
7d9c3e6cb6
...
6d455aa4c4
Author | SHA1 | Date | |
---|---|---|---|
|
6d455aa4c4 | ||
|
78c01d50ed | ||
|
fd65c83956 |
9 changed files with 103 additions and 6 deletions
|
@ -83,7 +83,7 @@ Release notes for release 0.5
|
||||||
|
|
||||||
- Updated indent-blankine.nvim to v3 - this comes with a few option changes, which will be migrated with `renamedOptionModule`
|
- Updated indent-blankine.nvim to v3 - this comes with a few option changes, which will be migrated with `renamedOptionModule`
|
||||||
|
|
||||||
[jacekpoz](https://github.com/jacekpoz):
|
[jacekpoz](https://jacekpoz.pl):
|
||||||
|
|
||||||
- Fixed scrollOffset not being used
|
- Fixed scrollOffset not being used
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@ vim.api.nvim_set_keymap('n', '<leader>a', ':lua camelToSnake()<CR>', { noremap =
|
||||||
|
|
||||||
- Added rose-pine theme.
|
- Added rose-pine theme.
|
||||||
|
|
||||||
[jacekpoz](https://github.com/jacekpoz):
|
[jacekpoz](https://jacekpoz.pl):
|
||||||
|
|
||||||
- Added `vim.autocomplete.alwaysComplete`. Allows users to have the autocomplete window popup only when manually activated.
|
- Added `vim.autocomplete.alwaysComplete`. Allows users to have the autocomplete window popup only when manually activated.
|
||||||
|
|
||||||
|
|
|
@ -62,14 +62,17 @@ configuration formats.
|
||||||
recommended to go through rustacean.nvim's README to take a closer look at its
|
recommended to go through rustacean.nvim's README to take a closer look at its
|
||||||
features and usage
|
features and usage
|
||||||
|
|
||||||
[jacekpoz](https://github.com/jacekpoz):
|
[jacekpoz](https://jacekpoz.pl):
|
||||||
|
|
||||||
[ocaml-lsp]: https://github.com/ocaml/ocaml-lsp
|
[ocaml-lsp]: https://github.com/ocaml/ocaml-lsp
|
||||||
|
[new-file-template.nvim]: https://github.com/otavioschwanck/new-file-template.nvim
|
||||||
|
|
||||||
- Add [ocaml-lsp] support
|
- Add [ocaml-lsp] support
|
||||||
|
|
||||||
- Fix "Emac" typo
|
- Fix "Emac" typo
|
||||||
|
|
||||||
|
- Add [new-file-template.nvim] to automatically fill new file contents using templates.
|
||||||
|
|
||||||
[diniamo](https://github.com/diniamo):
|
[diniamo](https://github.com/diniamo):
|
||||||
|
|
||||||
- Move the `theme` dag entry to before `luaScript`.
|
- Move the `theme` dag entry to before `luaScript`.
|
||||||
|
|
|
@ -628,9 +628,15 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-nvim-nio = {
|
plugin-nvim-nio = {
|
||||||
# (required nvim-dap-ui)
|
# (required by nvim-dap-ui)
|
||||||
url = "github:nvim-neotest/nvim-nio";
|
url = "github:nvim-neotest/nvim-nio";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugin-new-file-template-nvim = {
|
||||||
|
# (required by new-file-template.nvim)
|
||||||
|
url = "github:otavioschwanck/new-file-template.nvim";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,8 @@ inputs: {
|
||||||
# alias to the internal configuration
|
# alias to the internal configuration
|
||||||
vimOptions = module.config.vim;
|
vimOptions = module.config.vim;
|
||||||
|
|
||||||
|
luajit = vimOptions.package.lua;
|
||||||
|
|
||||||
# build a vim plugin with the given name and arguments
|
# build a vim plugin with the given name and arguments
|
||||||
# if the plugin is nvim-treesitter, warn the user to use buildTreesitterPlug
|
# if the plugin is nvim-treesitter, warn the user to use buildTreesitterPlug
|
||||||
# instead
|
# instead
|
||||||
|
@ -41,6 +43,8 @@ inputs: {
|
||||||
inherit src;
|
inherit src;
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs.vimUtils; [
|
nativeBuildInputs = with pkgs.vimUtils; [
|
||||||
|
luajit
|
||||||
|
|
||||||
vimCommandCheckHook
|
vimCommandCheckHook
|
||||||
vimGenDocHook
|
vimGenDocHook
|
||||||
neovimRequireCheckHook
|
neovimRequireCheckHook
|
||||||
|
@ -102,12 +106,12 @@ inputs: {
|
||||||
|
|
||||||
luaConfig =
|
luaConfig =
|
||||||
if vimOptions.byteCompileLua
|
if vimOptions.byteCompileLua
|
||||||
then pkgs.runCommandLocal "init.lua" {text = vimOptions.builtLuaConfigRC;} "${pkgs.luajit}/bin/luajit -bd -- - $out <<< \"$text\""
|
then pkgs.runCommandLocal "init.lua" {text = vimOptions.builtLuaConfigRC;} "${luajit}/bin/luajit -bd -- - $out <<< \"$text\""
|
||||||
else pkgs.writeText "init.lua" vimOptions.builtLuaConfigRC;
|
else pkgs.writeText "init.lua" vimOptions.builtLuaConfigRC;
|
||||||
|
|
||||||
extraLuaFiles =
|
extraLuaFiles =
|
||||||
if vimOptions.byteCompileLua
|
if vimOptions.byteCompileLua
|
||||||
then map (file: pkgs.runCommandLocal (baseNameOf file) {} "${pkgs.luajit}/bin/luajit -bd -- ${file} $out") vimOptions.extraLuaFiles
|
then map (file: pkgs.runCommandLocal (baseNameOf file) {} "${luajit}/bin/luajit -bd -- ${file} $out") vimOptions.extraLuaFiles
|
||||||
else vimOptions.extraLuaFiles;
|
else vimOptions.extraLuaFiles;
|
||||||
|
|
||||||
# Wrap the user's desired (unwrapped) Neovim package with arguments that'll be used to
|
# Wrap the user's desired (unwrapped) Neovim package with arguments that'll be used to
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
./ccc
|
./ccc
|
||||||
./gestures
|
./gestures
|
||||||
./motion
|
./motion
|
||||||
|
./new-file-template
|
||||||
./telescope
|
./telescope
|
||||||
./icon-picker
|
./icon-picker
|
||||||
./images
|
./images
|
||||||
|
|
23
modules/plugins/utility/new-file-template/config.nix
Normal file
23
modules/plugins/utility/new-file-template/config.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.nvim.dag) entryAnywhere;
|
||||||
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
|
|
||||||
|
cfg = config.vim.utility.new-file-template;
|
||||||
|
in {
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
vim = {
|
||||||
|
startPlugins = [
|
||||||
|
"new-file-template-nvim"
|
||||||
|
];
|
||||||
|
|
||||||
|
pluginRC.new-file-template = entryAnywhere ''
|
||||||
|
require('new-file-template').setup(${toLuaObject cfg.setupOpts})
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
6
modules/plugins/utility/new-file-template/default.nix
Normal file
6
modules/plugins/utility/new-file-template/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./config.nix
|
||||||
|
./new-file-template.nix
|
||||||
|
];
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
{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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue