mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-04-15 00:58:37 +00:00
Compare commits
8 commits
62670c3b14
...
c216c1eeb3
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c216c1eeb3 | ||
![]() |
ed31499ad6 | ||
![]() |
a6f8df6785 | ||
![]() |
b1212b77ce | ||
![]() |
51d76dd515 | ||
![]() |
eedb3dd8c4 | ||
![]() |
da57f955df | ||
![]() |
22d08b431a |
8 changed files with 95 additions and 12 deletions
|
@ -199,6 +199,7 @@
|
|||
Inspiration from `vim.languages.clang.dap` implementation.
|
||||
- Add [leetcode.nvim] plugin under `vim.utility.leetcode-nvim`.
|
||||
- Add [codecompanion.nvim] plugin under `vim.assistant.codecompanion-nvim`.
|
||||
- Fix [codecompanion-nvim] plugin: nvim-cmp error and setupOpts defaults.
|
||||
|
||||
[nezia1](https://github.com/nezia1):
|
||||
|
||||
|
@ -288,6 +289,7 @@
|
|||
[rice-cracker-dev](https://github.com/rice-cracker-dev):
|
||||
|
||||
- `eslint_d` now checks for configuration files to load.
|
||||
- Fixed an error where `eslint_d` fails to load.
|
||||
|
||||
[Sc3l3t0n](https://github.com/Sc3l3t0n):
|
||||
|
||||
|
|
|
@ -9,7 +9,14 @@ in {
|
|||
|
||||
setupOpts = mkPluginSetupOption "codecompanion-nvim" {
|
||||
opts = {
|
||||
send_code = mkEnableOption "code from being sent to the LLM.";
|
||||
send_code =
|
||||
mkEnableOption ""
|
||||
// {
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to enable code being sent to the LLM.
|
||||
'';
|
||||
};
|
||||
|
||||
log_level = mkOption {
|
||||
type = enum ["DEBUG" "INFO" "ERROR" "TRACE"];
|
||||
|
@ -30,7 +37,10 @@ in {
|
|||
mkEnableOption ""
|
||||
// {
|
||||
default = true;
|
||||
description = "a diff view to see the changes made by the LLM.";
|
||||
description = ''
|
||||
Whether to enable a diff view
|
||||
to see the changes made by the LLM.
|
||||
'';
|
||||
};
|
||||
|
||||
close_chat_at = mkOption {
|
||||
|
@ -64,7 +74,12 @@ in {
|
|||
};
|
||||
|
||||
chat = {
|
||||
auto_scroll = mkEnableOption "automatic page scrolling.";
|
||||
auto_scroll =
|
||||
mkEnableOption ""
|
||||
// {
|
||||
default = true;
|
||||
description = "Whether to enable automatic page scrolling.";
|
||||
};
|
||||
|
||||
show_settings = mkEnableOption ''
|
||||
LLM settings to appear at the top of the chat buffer.
|
||||
|
@ -85,14 +100,18 @@ in {
|
|||
mkEnableOption ""
|
||||
// {
|
||||
default = true;
|
||||
description = "references in the chat buffer.";
|
||||
description = ''
|
||||
Whether to enable references in the chat buffer.
|
||||
'';
|
||||
};
|
||||
|
||||
show_token_count =
|
||||
mkEnableOption ""
|
||||
// {
|
||||
default = true;
|
||||
description = "the token count for each response.";
|
||||
description = ''
|
||||
Whether to enable the token count for each response.
|
||||
'';
|
||||
};
|
||||
|
||||
intro_message = mkOption {
|
||||
|
@ -155,7 +174,10 @@ in {
|
|||
mkEnableOption ""
|
||||
// {
|
||||
default = true;
|
||||
description = "showing default actions in the action palette.";
|
||||
description = ''
|
||||
Whether to enable showing default
|
||||
actions in the action palette.
|
||||
'';
|
||||
};
|
||||
|
||||
show_default_prompt_library =
|
||||
|
@ -163,7 +185,8 @@ in {
|
|||
// {
|
||||
default = true;
|
||||
description = ''
|
||||
showing default prompt library in the action palette.
|
||||
Whether to enable showing default
|
||||
prompt library in the action palette.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
@ -22,6 +22,11 @@ in {
|
|||
};
|
||||
|
||||
treesitter.enable = true;
|
||||
|
||||
autocomplete.nvim-cmp = {
|
||||
sources = {codecompanion-nvim = "[codecompanion]";};
|
||||
sourcePlugins = ["codecompanion-nvim"];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
local markers = { "eslint.config.js", "eslint.config.mjs",
|
||||
".eslintrc", ".eslintrc.json", ".eslintrc.js", ".eslintrc.yml", }
|
||||
for _, filename in ipairs(markers) do
|
||||
local path = vim.fs.join(cwd, filename)
|
||||
local path = vim.fs.joinpath(cwd, filename)
|
||||
if vim.loop.fs_stat(path) then
|
||||
return require("lint.linters.eslint_d").parser(output, bufnr, cwd)
|
||||
end
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
local markers = { "eslint.config.js", "eslint.config.mjs",
|
||||
".eslintrc", ".eslintrc.json", ".eslintrc.js", ".eslintrc.yml", }
|
||||
for _, filename in ipairs(markers) do
|
||||
local path = vim.fs.join(cwd, filename)
|
||||
local path = vim.fs.joinpath(cwd, filename)
|
||||
if vim.loop.fs_stat(path) then
|
||||
return require("lint.linters.eslint_d").parser(output, bufnr, cwd)
|
||||
end
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
local markers = { "eslint.config.js", "eslint.config.mjs",
|
||||
".eslintrc", ".eslintrc.json", ".eslintrc.js", ".eslintrc.yml", }
|
||||
for _, filename in ipairs(markers) do
|
||||
local path = vim.fs.join(cwd, filename)
|
||||
local path = vim.fs.joinpath(cwd, filename)
|
||||
if vim.loop.fs_stat(path) then
|
||||
return require("lint.linters.eslint_d").parser(output, bufnr, cwd)
|
||||
end
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
inherit (lib.attrsets) mapAttrsToList;
|
||||
inherit (lib.strings) concatLines concatMapStringsSep;
|
||||
inherit (lib.trivial) showWarnings;
|
||||
inherit (lib.lists) optional;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.dag) entryAfter mkLuarcSection resolveDag entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
@ -18,7 +19,19 @@ in {
|
|||
mapAttrsToList (name: value: "vim.g.${name} = ${toLuaObject value}") cfg.globals;
|
||||
|
||||
optionsScript =
|
||||
mapAttrsToList (name: value: "vim.o.${name} = ${toLuaObject value}") cfg.options;
|
||||
mapAttrsToList (name: value: "vim.o.${name} = ${toLuaObject value}") cfg.options
|
||||
++ mapAttrsToList (
|
||||
name: {
|
||||
append,
|
||||
prepend,
|
||||
remove,
|
||||
}:
|
||||
concatLines
|
||||
((optional (append != null) "vim.opt.${name}:append(${toLuaObject append})")
|
||||
++ (optional (prepend != null) "vim.opt.${name}:prepend(${toLuaObject prepend})")
|
||||
++ (optional (remove != null) "vim.opt.${name}:remove(${toLuaObject remove})"))
|
||||
)
|
||||
cfg.opt;
|
||||
|
||||
extraPluginConfigs = resolveDag {
|
||||
name = "extra plugin configs";
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
}: let
|
||||
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 nullOr;
|
||||
inherit (lib.nvim.types) dagOf;
|
||||
inherit (lib.nvim.lua) listToLuaTable;
|
||||
|
||||
|
@ -278,6 +278,46 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
opt = mkOption {
|
||||
default = {};
|
||||
type = attrsOf (submodule {
|
||||
options = {
|
||||
append = mkOption {
|
||||
type = nullOr (listOf anything);
|
||||
default = null;
|
||||
description = "Values to append";
|
||||
};
|
||||
|
||||
prepend = mkOption {
|
||||
type = nullOr (listOf anything);
|
||||
default = null;
|
||||
description = "Values to prepend";
|
||||
};
|
||||
|
||||
remove = mkOption {
|
||||
type = nullOr (listOf anything);
|
||||
default = null;
|
||||
description = "Values to remove";
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
example = literalExpression ''
|
||||
{
|
||||
runtimepath.append = ["~/.config/nvim"];
|
||||
formatoptions.append = ["n"];
|
||||
formatoptions.remove = ["o"];
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Wrapper of the lua `vim.opt` interface. Makes interacting with list and
|
||||
map-style option more convenient.
|
||||
|
||||
If you're looking to set an option normally, instead of add/remove from
|
||||
a list/map type option, see {option}`vim.options` instead.
|
||||
'';
|
||||
};
|
||||
|
||||
pluginRC = mkOption {
|
||||
type = either (dagOf lines) str;
|
||||
default = {};
|
||||
|
|
Loading…
Add table
Reference in a new issue