mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-30 00:26:45 +00:00
Compare commits
9 commits
f68071e0b9
...
1c0b31cc10
Author | SHA1 | Date | |
---|---|---|---|
|
1c0b31cc10 | ||
|
78c01d50ed | ||
|
d48f52f065 | ||
|
1340eb34a0 | ||
|
fa660627fc | ||
|
5c79c458fc | ||
|
13cc59ab99 | ||
|
97d49d331c | ||
|
afa5e3594b |
10 changed files with 35 additions and 99 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://jacekpoz.pl):
|
[jacekpoz](https://github.com/jacekpoz):
|
||||||
|
|
||||||
- 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://jacekpoz.pl):
|
[jacekpoz](https://github.com/jacekpoz):
|
||||||
|
|
||||||
- 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,17 +62,14 @@ 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://jacekpoz.pl):
|
[jacekpoz](https://github.com/jacekpoz):
|
||||||
|
|
||||||
[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`.
|
||||||
|
@ -102,6 +99,8 @@ configuration formats.
|
||||||
yourself by adding `vim.opt.listchars:append({ eol = '<char>' })` to your
|
yourself by adding `vim.opt.listchars:append({ eol = '<char>' })` to your
|
||||||
lua configuration
|
lua configuration
|
||||||
|
|
||||||
|
- Pre-compile lua files using LuaJIT for performance. Can be disabled with `vim.byteCompileLua = false`.
|
||||||
|
|
||||||
[Neovim documentation on `vim.cmd`]: https://neovim.io/doc/user/lua.html#vim.cmd()
|
[Neovim documentation on `vim.cmd`]: https://neovim.io/doc/user/lua.html#vim.cmd()
|
||||||
|
|
||||||
- Make Neovim's configuration file entirely Lua based. This comes with a few
|
- Make Neovim's configuration file entirely Lua based. This comes with a few
|
||||||
|
|
|
@ -628,15 +628,9 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
plugin-nvim-nio = {
|
plugin-nvim-nio = {
|
||||||
# (required by nvim-dap-ui)
|
# (required 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;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ inputs: {
|
||||||
inherit (lib.strings) isString toString;
|
inherit (lib.strings) isString toString;
|
||||||
inherit (lib.lists) filter map concatLists;
|
inherit (lib.lists) filter map concatLists;
|
||||||
inherit (lib.attrsets) recursiveUpdate;
|
inherit (lib.attrsets) recursiveUpdate;
|
||||||
|
inherit (builtins) baseNameOf;
|
||||||
|
|
||||||
# import modules.nix with `check`, `pkgs` and `lib` as arguments
|
# import modules.nix with `check`, `pkgs` and `lib` as arguments
|
||||||
# check can be disabled while calling this file is called
|
# check can be disabled while calling this file is called
|
||||||
|
@ -28,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
|
||||||
|
@ -40,12 +43,20 @@ inputs: {
|
||||||
inherit src;
|
inherit src;
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs.vimUtils; [
|
nativeBuildInputs = with pkgs.vimUtils; [
|
||||||
|
luajit
|
||||||
|
|
||||||
vimCommandCheckHook
|
vimCommandCheckHook
|
||||||
vimGenDocHook
|
vimGenDocHook
|
||||||
neovimRequireCheckHook
|
neovimRequireCheckHook
|
||||||
];
|
];
|
||||||
passthru.vimPlugin = true;
|
passthru.vimPlugin = true;
|
||||||
|
|
||||||
|
buildPhase = lib.optionalString vimOptions.byteCompileLua ''
|
||||||
|
runHook preBuild
|
||||||
|
find . -type f -name '*.lua' -exec luajit -bd -- {} {} \;
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
|
@ -93,6 +104,16 @@ inputs: {
|
||||||
extraLuaPackages = ps: map (x: ps.${x}) vimOptions.luaPackages;
|
extraLuaPackages = ps: map (x: ps.${x}) vimOptions.luaPackages;
|
||||||
extraPython3Packages = ps: map (x: ps.${x}) vimOptions.python3Packages;
|
extraPython3Packages = ps: map (x: ps.${x}) vimOptions.python3Packages;
|
||||||
|
|
||||||
|
luaConfig =
|
||||||
|
if vimOptions.byteCompileLua
|
||||||
|
then pkgs.runCommandLocal "init.lua" {text = vimOptions.builtLuaConfigRC;} "${luajit}/bin/luajit -bd -- - $out <<< \"$text\""
|
||||||
|
else pkgs.writeText "init.lua" vimOptions.builtLuaConfigRC;
|
||||||
|
|
||||||
|
extraLuaFiles =
|
||||||
|
if vimOptions.byteCompileLua
|
||||||
|
then map (file: pkgs.runCommandLocal (baseNameOf file) {} "${luajit}/bin/luajit -bd -- ${file} $out") 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
|
||||||
# generate a wrapped Neovim package.
|
# generate a wrapped Neovim package.
|
||||||
neovim-wrapped = inputs.mnw.lib.wrap pkgs {
|
neovim-wrapped = inputs.mnw.lib.wrap pkgs {
|
||||||
|
@ -100,8 +121,7 @@ inputs: {
|
||||||
plugins = concatLists [builtStartPlugins builtOptPlugins];
|
plugins = concatLists [builtStartPlugins builtOptPlugins];
|
||||||
appName = "nvf";
|
appName = "nvf";
|
||||||
extraBinPath = vimOptions.extraPackages;
|
extraBinPath = vimOptions.extraPackages;
|
||||||
initLua = vimOptions.builtLuaConfigRC;
|
luaFiles = [luaConfig] ++ extraLuaFiles;
|
||||||
luaFiles = vimOptions.extraLuaFiles;
|
|
||||||
|
|
||||||
inherit (vimOptions) viAlias vimAlias withRuby withNodeJs withPython3;
|
inherit (vimOptions) viAlias vimAlias withRuby withNodeJs withPython3;
|
||||||
inherit extraLuaPackages extraPython3Packages;
|
inherit extraLuaPackages extraPython3Packages;
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
./ccc
|
./ccc
|
||||||
./gestures
|
./gestures
|
||||||
./motion
|
./motion
|
||||||
./new-file-template
|
|
||||||
./telescope
|
./telescope
|
||||||
./icon-picker
|
./icon-picker
|
||||||
./images
|
./images
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
{
|
|
||||||
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})
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./config.nix
|
|
||||||
./new-file-template.nix
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,54 +0,0 @@
|
||||||
{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";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -23,6 +23,13 @@ in {
|
||||||
];
|
];
|
||||||
|
|
||||||
options.vim = {
|
options.vim = {
|
||||||
|
byteCompileLua = mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = true;
|
||||||
|
example = false;
|
||||||
|
description = "Enable the pre-compilation of lua files using LuaJIT.";
|
||||||
|
};
|
||||||
|
|
||||||
enableLuaLoader = mkEnableOption ''
|
enableLuaLoader = mkEnableOption ''
|
||||||
the experimental Lua module loader to speed up the start up process
|
the experimental Lua module loader to speed up the start up process
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue