mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-01-17 07:43:21 +00:00
Compare commits
8 commits
27c0b5caf3
...
4045c458dc
| Author | SHA1 | Date | |
|---|---|---|---|
|
4045c458dc |
|||
|
d2cb38ca0e |
|||
|
46979fd94f |
|||
|
682945c79d |
|||
|
499db0e09a |
|||
|
|
6bf57573f1 | ||
|
|
1f6e2f3ca4 | ||
|
|
db3a35a116 |
5 changed files with 36 additions and 36 deletions
|
|
@ -107,6 +107,8 @@
|
||||||
- Add `LazyFile` user event.
|
- Add `LazyFile` user event.
|
||||||
- Migrate language modules from none-ls to conform/nvim-lint
|
- Migrate language modules from none-ls to conform/nvim-lint
|
||||||
- Add tsx support in conform and lint
|
- Add tsx support in conform and lint
|
||||||
|
- Moved code setting `additionalRuntimePaths` and `enableLuaLoader` out of
|
||||||
|
`luaConfigPre`'s default to prevent being overridden
|
||||||
|
|
||||||
[diniamo](https://github.com/diniamo):
|
[diniamo](https://github.com/diniamo):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
mkEnableOption ""
|
mkEnableOption ""
|
||||||
// {
|
// {
|
||||||
default = true;
|
default = true;
|
||||||
description = "Whether to enable this autocommand";
|
description = "Whether to enable this autocommand.";
|
||||||
};
|
};
|
||||||
|
|
||||||
event = mkOption {
|
event = mkOption {
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
type = nullOr (listOf str);
|
type = nullOr (listOf str);
|
||||||
default = null;
|
default = null;
|
||||||
example = ["*.lua" "*.vim"];
|
example = ["*.lua" "*.vim"];
|
||||||
description = "The file pattern(s) that determine when the autocommand applies).";
|
description = "The file pattern(s) that determine when the autocommand applies.";
|
||||||
};
|
};
|
||||||
|
|
||||||
callback = mkOption {
|
callback = mkOption {
|
||||||
|
|
@ -44,13 +44,16 @@
|
||||||
end
|
end
|
||||||
''''
|
''''
|
||||||
'';
|
'';
|
||||||
description = "The file pattern(s) that determine when the autocommand applies.";
|
description = "Lua function to be called when the event(s) are triggered.";
|
||||||
};
|
};
|
||||||
|
|
||||||
command = mkOption {
|
command = mkOption {
|
||||||
type = nullOr str;
|
type = nullOr str;
|
||||||
default = null;
|
default = null;
|
||||||
description = "Vim command string instead of a Lua function.";
|
description = ''
|
||||||
|
Vim command to be executed when the event(s) are triggered.
|
||||||
|
Cannot be defined if the `callback` option is already defined.
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
group = mkOption {
|
group = mkOption {
|
||||||
|
|
@ -70,7 +73,7 @@
|
||||||
once = mkOption {
|
once = mkOption {
|
||||||
type = bool;
|
type = bool;
|
||||||
default = false;
|
default = false;
|
||||||
description = "Whether autocommand run only once.";
|
description = "Whether to run the autocommand only once.";
|
||||||
};
|
};
|
||||||
|
|
||||||
nested = mkOption {
|
nested = mkOption {
|
||||||
|
|
@ -87,7 +90,7 @@
|
||||||
mkEnableOption ""
|
mkEnableOption ""
|
||||||
// {
|
// {
|
||||||
default = true;
|
default = true;
|
||||||
description = "Whether to enable this autogroup";
|
description = "Whether to enable this autocommand group.";
|
||||||
};
|
};
|
||||||
|
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
|
|
@ -118,8 +121,8 @@ in {
|
||||||
autocommands together. Groups allow multiple autocommands to be cleared
|
autocommands together. Groups allow multiple autocommands to be cleared
|
||||||
or redefined collectively, preventing duplicate definitions.
|
or redefined collectively, preventing duplicate definitions.
|
||||||
|
|
||||||
Each autogroup consists of a name, a boolean indicating whether to clear
|
Each autogroup consists of a name and a boolean indicating whether to clear
|
||||||
existing autocommands, and a list of associated autocommands.
|
existing autocommands.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -129,8 +132,8 @@ in {
|
||||||
description = ''
|
description = ''
|
||||||
A list of Neovim autocommands to be registered.
|
A list of Neovim autocommands to be registered.
|
||||||
|
|
||||||
Each entry defines an autocommand, specifying events, patterns, optional
|
Each entry defines an autocommand, specifying events, patterns, a callback or Vim
|
||||||
callbacks, commands, groups, and execution settings.
|
command, an optional group, a description, and execution settings.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,16 @@
|
||||||
in {
|
in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
vim = {
|
vim = {
|
||||||
startPlugins = ["chatgpt-nvim"];
|
startPlugins = [
|
||||||
|
"chatgpt-nvim"
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
"nui-nvim"
|
||||||
|
"plenary-nvim"
|
||||||
|
];
|
||||||
|
|
||||||
|
# ChatGPT.nvim explicitly depends on Telescope.
|
||||||
|
telescope.enable = true;
|
||||||
|
|
||||||
pluginRC.chagpt = entryAnywhere ''
|
pluginRC.chagpt = entryAnywhere ''
|
||||||
require("chatgpt").setup(${toLuaObject cfg.setupOpts})
|
require("chatgpt").setup(${toLuaObject cfg.setupOpts})
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) map mapAttrs filter;
|
inherit (builtins) map mapAttrs filter;
|
||||||
inherit (lib.attrsets) mapAttrsToList;
|
inherit (lib.attrsets) mapAttrsToList;
|
||||||
inherit (lib.strings) concatLines concatMapStringsSep;
|
inherit (lib.strings) concatLines concatMapStringsSep optionalString;
|
||||||
inherit (lib.trivial) showWarnings;
|
inherit (lib.trivial) showWarnings;
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.nvim.dag) entryAfter mkLuarcSection resolveDag entryAnywhere;
|
inherit (lib.nvim.dag) entryAfter mkLuarcSection resolveDag entryAnywhere;
|
||||||
|
|
@ -72,6 +72,14 @@ in {
|
||||||
dag = cfg.luaConfigRC;
|
dag = cfg.luaConfigRC;
|
||||||
mapResult = result:
|
mapResult = result:
|
||||||
concatLines [
|
concatLines [
|
||||||
|
(optionalString (cfg.additionalRuntimePaths != []) ''
|
||||||
|
vim.opt.runtimepath:append(${toLuaObject cfg.additionalRuntimePaths})
|
||||||
|
'')
|
||||||
|
(optionalString cfg.enableLuaLoader ''
|
||||||
|
if vim.loader then
|
||||||
|
vim.loader.enable()
|
||||||
|
end
|
||||||
|
'')
|
||||||
cfg.luaConfigPre
|
cfg.luaConfigPre
|
||||||
(concatMapStringsSep "\n" mkLuarcSection result)
|
(concatMapStringsSep "\n" mkLuarcSection result)
|
||||||
cfg.luaConfigPost
|
cfg.luaConfigPost
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,7 @@
|
||||||
{
|
{lib, ...}: let
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.options) mkOption literalMD literalExpression;
|
inherit (lib.options) mkOption literalMD literalExpression;
|
||||||
inherit (lib.strings) optionalString;
|
|
||||||
inherit (lib.types) str bool int enum attrsOf lines listOf either path submodule anything;
|
inherit (lib.types) str bool int enum attrsOf lines listOf either path submodule anything;
|
||||||
inherit (lib.nvim.types) dagOf;
|
inherit (lib.nvim.types) dagOf;
|
||||||
inherit (lib.nvim.lua) listToLuaTable;
|
|
||||||
|
|
||||||
cfg = config.vim;
|
|
||||||
in {
|
in {
|
||||||
options.vim = {
|
options.vim = {
|
||||||
enableLuaLoader = mkOption {
|
enableLuaLoader = mkOption {
|
||||||
|
|
@ -286,21 +278,7 @@ in {
|
||||||
|
|
||||||
luaConfigPre = mkOption {
|
luaConfigPre = mkOption {
|
||||||
type = str;
|
type = str;
|
||||||
default = ''
|
default = "";
|
||||||
${optionalString (cfg.additionalRuntimePaths != []) ''
|
|
||||||
-- The following list is generated from `vim.additionalRuntimePaths`
|
|
||||||
-- and is used to append additional runtime paths to the
|
|
||||||
-- `runtimepath` option.
|
|
||||||
vim.opt.runtimepath:append(${listToLuaTable cfg.additionalRuntimePaths})
|
|
||||||
''}
|
|
||||||
|
|
||||||
${optionalString cfg.enableLuaLoader ''
|
|
||||||
if vim.loader then
|
|
||||||
vim.loader.enable()
|
|
||||||
end
|
|
||||||
''}
|
|
||||||
'';
|
|
||||||
|
|
||||||
defaultText = literalMD ''
|
defaultText = literalMD ''
|
||||||
By default, this option will **append** paths in
|
By default, this option will **append** paths in
|
||||||
[](#opt-vim.additionalRuntimePaths)
|
[](#opt-vim.additionalRuntimePaths)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue