Compare commits

..

26 commits

Author SHA1 Message Date
Ching Pei Yang
f5769ca156
Merge pull request #934 from Munsio/fix-avante
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Treewide Checks / Validate flake (push) Waiting to run
Treewide Checks / Check formatting (push) Waiting to run
Treewide Checks / Check source tree for typos (push) Waiting to run
Treewide Checks / Validate documentation builds (push) Waiting to run
Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions
fix, Add dependencies needed for building Avante
2025-06-03 23:53:02 +02:00
Martin Treml
f04ad1fff5 fix, Add dependencies needed for building Avante
Fixes #933
2025-06-03 23:41:43 +02:00
Ching Pei Yang
3f42d4e810
Merge pull request #931 from CallumGilly/main
themes/onedark: add missing transparency option
2025-06-03 22:28:12 +02:00
Callum
412d786325 Document onedark change in release notes. 2025-06-03 22:26:15 +02:00
Callum
144ab18dbd Fix OneDark transparancy issue 2025-06-03 22:26:15 +02:00
Ching Pei Yang
76558857a3
Merge pull request #911 from cramt/avante
assistant/avante-nvim: init
2025-06-03 22:25:21 +02:00
Alexandra Østermark
48d5fbfa32
fix spelling mistake 2025-06-03 21:13:49 +02:00
Ching Pei Yang
7550be9b72
Merge branch 'main' into avante 2025-06-03 16:15:03 +02:00
Alexandra Østermark
988f034236
delete build deps 2025-06-03 15:20:28 +02:00
Alexandra Østermark
c4d040b0b0
assistant/avante.nvim apply suggested changes
Change the options to use mkOption when applicable and apply changes to
descriptions
Change the building of the vimPlugin to use npin dependencies instead of
dependencies from nixpkgs
2025-05-18 21:01:30 +02:00
Alexandra Østermark
139c18f296
Merge branch 'main' into avante 2025-05-18 21:00:09 +02:00
Alexandra Østermark
5fe4106866
Merge branch 'main' into avante
use pins for package call

syntax fix

add optional deps
2025-05-18 21:00:09 +02:00
Farouk Brown
e946799757
Merge branch 'main' into main 2025-05-03 18:04:20 +01:00
raf
a8291918a9
Merge branch 'main' into main 2025-04-27 19:59:04 +00:00
Farouk Brown
20a4bbe01e Merge branch 'main' of github.com:aionoid/nvf-avante-nvim 2025-04-27 20:31:45 +01:00
Farouk Brown
64bee7e729 fix: set avante-nvim to build from source 2025-04-27 20:28:17 +01:00
Farouk Brown
b99308bd70
Merge branch 'main' into main 2025-04-25 06:10:08 +01:00
Farouk Brown
f8779d1968 chore:set npins to follow nixpkgs avante version 2025-04-24 22:31:45 +01:00
Farouk Brown
75fa8e22b6 fix: lazy load avante.nvim plugin 2025-04-24 22:31:14 +01:00
Farouk Brown
f0fe0b0f62 doc: format descriptions 2025-04-24 22:14:02 +01:00
Farouk Brown
9f6413e891
Merge branch 'main' into main 2025-04-24 17:23:53 +01:00
Farouk Brown
79f3dc2c02 Merge remote-tracking branch 'origin/markdown_fix' 2025-04-24 17:22:05 +01:00
Farouk Brown
e21904d50d pr: revert markdown changes 2025-04-22 15:33:07 +01:00
Farouk Brown
7092ff5b7b docs: add missing descriptions 2025-04-22 14:09:46 +01:00
Farouk Brown
8cde1f7b93 fix:set render-markdown.nvim file_types to list 2025-04-22 12:20:10 +01:00
Farouk Brown
72c5c7f634 assistant: add avante.nvim plugin 2025-04-22 12:17:33 +01:00
12 changed files with 500 additions and 4 deletions

View file

@ -248,6 +248,7 @@ isMaximal: {
cmp.enable = isMaximal;
};
codecompanion-nvim.enable = false;
avante-nvim.enable = isMaximal;
};
session = {

View file

@ -370,7 +370,10 @@
[aionoid](https://github.com/aionoid):
[avante-nvim]: https://github.com/yetone/avante.nvim
- Fix [render-markdown.nvim] file_types option type to list, to accept merging.
- Add [avante.nvim] plugin under `vim.assistant.avante-nvim`.
[poz](https://poz.pet):
@ -415,3 +418,8 @@
- Add Clojure support under `vim.languages.clojure` using [clojure-lsp]
- Add code evaluation environment [conjure] under `vim.repl.conjure`
[CallumGilly](https://github.com/CallumGilly):
- Add missing `transparent` option for existing
[onedark.nvim](https://github.com/navarasu/onedark.nvim) theme.

View file

@ -0,0 +1,80 @@
{
nix-update-script,
openssl,
pkg-config,
rustPlatform,
stdenv,
vimPlugins,
vimUtils,
makeWrapper,
pkgs,
version,
src,
pins,
}: let
inherit version src;
avante-nvim-lib = rustPlatform.buildRustPackage {
pname = "avante-nvim-lib";
inherit version src;
useFetchCargoVendor = true;
cargoHash = "sha256-pmnMoNdaIR0i+4kwW3cf01vDQo39QakTCEG9AXA86ck=";
nativeBuildInputs = [
pkg-config
makeWrapper
pkgs.perl
];
buildInputs = [
openssl
];
buildFeatures = ["luajit"];
checkFlags = [
# Disabled because they access the network.
"--skip=test_hf"
"--skip=test_public_url"
"--skip=test_roundtrip"
"--skip=test_fetch_md"
];
};
in
vimUtils.buildVimPlugin {
pname = "avante-nvim";
inherit version src;
dependencies =
[vimPlugins.nvim-treesitter]
++ (builtins.map (name: let
pin = pins.${name};
in
pkgs.fetchFromGitHub {
inherit (pin.repository) owner repo;
rev = pin.revision;
sha256 = pin.hash;
}) [
"dressing-nvim"
"plenary-nvim"
"nui-nvim"
]);
postInstall = let
ext = stdenv.hostPlatform.extensions.sharedLibrary;
in ''
mkdir -p $out/build
ln -s ${avante-nvim-lib}/lib/libavante_repo_map${ext} $out/build/avante_repo_map${ext}
ln -s ${avante-nvim-lib}/lib/libavante_templates${ext} $out/build/avante_templates${ext}
ln -s ${avante-nvim-lib}/lib/libavante_tokenizers${ext} $out/build/avante_tokenizers${ext}
ln -s ${avante-nvim-lib}/lib/libavante_html2md${ext} $out/build/avante_html2md${ext}
'';
nvimSkipModules = [
# Requires setup with corresponding provider
"avante.providers.azure"
"avante.providers.copilot"
"avante.providers.vertex_claude"
"avante.providers.ollama"
];
}

View file

@ -1,4 +1,8 @@
{inputs, ...} @ args: {
{
inputs,
self,
...
} @ args: {
perSystem = {
config,
pkgs,
@ -14,6 +18,18 @@
in {
packages = {
blink-cmp = pkgs.callPackage ./blink {};
avante-nvim = let
pin = self.pins.avante-nvim;
in
pkgs.callPackage ./avante-nvim {
version = pin.branch;
src = pkgs.fetchFromGitHub {
inherit (pin.repository) owner repo;
rev = pin.revision;
sha256 = pin.hash;
};
pins = self.pins;
};
inherit (docs.manual) htmlOpenTool;
# Documentation

View file

@ -0,0 +1,325 @@
{lib, ...}: let
inherit (lib.options) mkOption mkEnableOption literalMD;
inherit (lib.types) int str enum nullOr attrs bool;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.assistant = {
avante-nvim = {
enable = mkEnableOption "complementary Neovim plugin for avante.nvim";
setupOpts = mkPluginSetupOption "avante-nvim" {
provider = mkOption {
type = nullOr str;
default = null;
description = "The provider used in Aider mode or in the planning phase of Cursor Planning Mode.";
};
vendors = mkOption {
type = nullOr attrs;
default = null;
description = "Define Your Custom providers.";
example = literalMD ''
```nix
ollama = {
__inherited_from = "openai";
api_key_name = "";
endpoint = "http://127.0.0.1:11434/v1";
model = "qwen2.5u-coder:7b";
max_tokens = 4096;
disable_tools = true;
};
ollama_ds = {
__inherited_from = "openai";
api_key_name = "";
endpoint = "http://127.0.0.1:11434/v1";
model = "deepseek-r1u:7b";
max_tokens = 4096;
disable_tools = true;
};
```
'';
};
auto_suggestions_provider = mkOption {
type = str;
default = "claude";
description = ''
Since auto-suggestions are a high-frequency operation and therefore expensive,
currently designating it as `copilot` provider is dangerous because:
https://github.com/yetone/avante.nvim/issues/1048
Of course, you can reduce the request frequency by increasing `suggestion.debounce`.
'';
};
cursor_applying_provider = mkOption {
type = nullOr str;
default = null;
description = ''
The provider used in the applying phase of Cursor Planning Mode, defaults to `nil`,
Config.provider will be used as the provider for the applying phase when `nil`.
'';
};
dual_boost = {
enabled = mkEnableOption "dual_boost mode.";
first_provider = mkOption {
type = str;
default = "openai";
description = "The first provider to generate response.";
};
second_provider = mkOption {
type = str;
default = "claude";
description = "The second provider to generate response.";
};
prompt = mkOption {
type = str;
default = ''
Based on the two reference outputs below, generate a response that incorporates
elements from both but reflects your own judgment and unique perspective.
Do not provide any explanation, just give the response directly. Reference Output 1:
[{{provider1_output}}], Reference Output 2: [{{provider2_output}}'';
description = "The prompt to generate response based on the two reference outputs.";
};
timeout = mkOption {
type = int;
default = 60000;
description = "Timeout in milliseconds.";
};
};
behaviour = {
auto_suggestions =
mkEnableOption "auto suggestions.";
auto_set_highlight_group =
mkEnableOption "automatically set the highlight group for the current line."
// {
default = true;
};
auto_set_keymaps =
mkEnableOption "automatically set the keymap for the current line."
// {
default = true;
};
auto_apply_diff_after_generation =
mkEnableOption "automatically apply diff after LLM response.";
support_paste_from_clipboard = mkEnableOption ''
pasting image from clipboard.
This will be determined automatically based whether img-clip is available or not.
'';
minimize_diff =
mkEnableOption "remove unchanged lines when applying a code block."
// {
default = true;
};
enable_token_counting =
mkEnableOption "token counting."
// {
default = true;
};
enable_cursor_planning_mode =
mkEnableOption "Cursor Planning Mode.";
enable_claude_text_editor_tool_mode =
mkEnableOption "Claude Text Editor Tool Mode.";
};
mappings = {
diff = mkOption {
type = nullOr attrs;
default = null;
description = "Define or override the default keymaps for diff.";
};
suggestion = mkOption {
type = nullOr attrs;
default = null;
description = "Define or override the default keymaps for suggestion actions.";
};
jump = mkOption {
type = nullOr attrs;
default = null;
description = "Define or override the default keymaps for jump actions.";
};
submit = mkOption {
type = nullOr attrs;
default = null;
description = "Define or override the default keymaps for submit actions.";
};
cancel = mkOption {
type = nullOr attrs;
default = null;
description = "Define or override the default keymaps for cancel actions.";
};
sidebar = mkOption {
type = nullOr attrs;
default = null;
description = "Define or override the default keymaps for sidebar actions.";
};
};
hints.enabled =
mkEnableOption ""
// {
default = true;
description = ''
Whether to enable hints.
'';
};
windows = {
position = mkOption {
type = enum ["right" "left" "top" "bottom"];
default = "right";
description = "The position of the sidebar.";
};
wrap =
mkEnableOption ""
// {
default = true;
description = ''
similar to vim.o.wrap.
'';
};
width = mkOption {
type = int;
default = 30;
description = "Default % based on available width.";
};
sidebar_header = {
enabled = mkOption {
type = bool;
default = true;
description = "enable/disable the header.";
};
align = mkOption {
type = enum ["right" "center" "left"];
default = "center";
description = "Position of the title.";
};
rounded = mkOption {
type = bool;
default = true;
description = "Enable rounded sidebar header";
};
};
input = {
prefix = mkOption {
type = str;
default = "> ";
description = "The prefix used on the user input.";
};
height = mkOption {
type = int;
default = 8;
description = ''
Height of the input window in vertical layout.
'';
};
};
edit = {
border = mkOption {
type = str;
default = "rounded";
description = "The border type on the edit window.";
};
start_insert = mkOption {
type = bool;
default = true;
description = ''
Start insert mode when opening the edit window.
'';
};
};
ask = {
floating = mkOption {
type = bool;
default = false;
description = ''
Open the 'AvanteAsk' prompt in a floating window.
'';
};
start_insert = mkOption {
type = bool;
default = true;
description = ''
Start insert mode when opening the ask window.
'';
};
border = mkOption {
type = str;
default = "rounded";
description = "The border type on the ask window.";
};
focus_on_apply = mkOption {
type = enum ["ours" "theirs"];
default = "ours";
description = "Which diff to focus after applying.";
};
};
};
diff = {
autojump =
mkEnableOption ""
// {
default = true;
description = "Automatically jumps to the next change.";
};
override_timeoutlen = mkOption {
type = int;
default = 500;
example = -1;
description = ''
Override the 'timeoutlen' setting while hovering over a diff (see {command}`:help timeoutlen`).
Helps to avoid entering operator-pending mode with diff mappings starting with `c`.
Disable by setting to -1.
'';
};
};
suggestion = {
debounce = mkOption {
type = int;
default = 600;
description = "Suggestion debounce in milliseconds.";
};
throttle = mkOption {
type = int;
default = 600;
description = "Suggestion throttle in milliseconds.";
};
};
};
};
};
}

View file

@ -0,0 +1,41 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.lists) optionals;
cfg = config.vim.assistant.avante-nvim;
in {
config = mkIf cfg.enable {
vim = {
startPlugins =
[
"nvim-treesitter"
"plenary-nvim"
"dressing-nvim"
"nui-nvim"
]
++ (optionals config.vim.mini.pick.enable ["mini-pick"])
++ (optionals config.vim.telescope.enable ["telescope"])
++ (optionals config.vim.autocomplete.nvim-cmp.enable ["nvim-cmp"])
++ (optionals config.vim.fzf-lua.enable ["fzf-lua"])
++ (optionals config.vim.visuals.nvim-web-devicons.enable ["nvim-web-devicons"])
++ (optionals config.vim.utility.images.img-clip.enable ["img-clip"]);
lazy.plugins = {
avante-nvim = {
package = "avante-nvim";
setupModule = "avante";
inherit (cfg) setupOpts;
event = ["DeferredUIEnter"];
};
};
treesitter.enable = true;
languages.markdown.extensions.render-markdown-nvim.setupOpts.file_types = lib.mkAfter ["Avante"];
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./config.nix
./avante-nvim.nix
];
}

View file

@ -3,5 +3,6 @@
./chatgpt
./copilot
./codecompanion
./avante
];
}

View file

@ -21,9 +21,14 @@ in {
'';
};
onedark = {
setup = {style ? "dark", ...}: ''
setup = {
style ? "dark",
transparent,
...
}: ''
-- OneDark theme
require('onedark').setup {
transparent = ${boolToString transparent},
style = "${style}"
}
require('onedark').load()

View file

@ -48,7 +48,7 @@
doCheck = false;
};
inherit (inputs.self.packages.${pkgs.stdenv.system}) blink-cmp;
inherit (inputs.self.packages.${pkgs.stdenv.system}) blink-cmp avante-nvim;
};
buildConfigPlugins = plugins:

View file

@ -11,7 +11,7 @@ in {
description = ''
[official documentation]: https://neovim.io/doc/user/lua.html#vim.loader.enable()
Whethere to enable the experimental Lua module loader to speed up the start
Whether to enable the experimental Lua module loader to speed up the start
up process. If `true`, this will enable the experimental Lua module loader
which:

View file

@ -26,6 +26,19 @@
"url": "https://github.com/goolord/alpha-nvim/archive/a35468cd72645dbd52c0624ceead5f301c566dff.tar.gz",
"hash": "0c1jkhxamfn2md7m1r5b2wpxa26y90b98yzjwf68m3fymalvkn5h"
},
"avante-nvim": {
"type": "Git",
"repository": {
"type": "GitHub",
"owner": "yetone",
"repo": "avante.nvim"
},
"branch": "main",
"submodules": false,
"revision": "f9aa75459d403d9e963ef2647c9791e0dfc9e5f9",
"url": "https://github.com/yetone/avante.nvim/archive/f9aa75459d403d9e963ef2647c9791e0dfc9e5f9.tar.gz",
"hash": "1qgdxapmw24zkx3d4cwv6f459p2a6dw7pvx7sa3650px2n75bb31"
},
"base16": {
"type": "Git",
"repository": {