Skip to content

Commit 341508f

Browse files
author
Your Name
committed
Avante config adjustments and bumping zig version
1 parent 636795e commit 341508f

File tree

4 files changed

+97
-30
lines changed

4 files changed

+97
-30
lines changed
Lines changed: 65 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,67 @@
11
--require("copilot").setup({})
2-
require("avante_lib").load()
3-
require("avante").setup({
4-
---@alias Provider "claude" | "openai" | "azure" | "gemini" | "cohere" | "copilot" | string
5-
provider = "copilot", -- The provider used in Aider mode or in the planning phase of Cursor Planning Mode
6-
behaviour = {
7-
auto_apply_diff_after_generation = true,
8-
},
9-
suggestion = {
10-
debounce = 1200,
11-
throttle = 1200,
12-
},
13-
})
2+
local config = function()
3+
-- Security verification commands
4+
vim.api.nvim_create_user_command('AvanteVerify', function()
5+
local plugin_path = vim.fn.stdpath('data') .. '/site/pack/packer/opt/avante.nvim'
6+
print("Reviewing Avante source code at: " .. plugin_path)
7+
print("Please manually review:")
8+
print("1. cd " .. plugin_path)
9+
print("2. cat Makefile")
10+
print("3. find . -name '*.sh' -exec cat {} \\;")
11+
print("4. git log --oneline -10")
12+
print("If safe, run :AvanteBuild")
13+
end, {})
1414

15+
vim.api.nvim_create_user_command('AvanteBuild', function()
16+
local plugin_path = vim.fn.stdpath('data') .. '/site/pack/packer/opt/avante.nvim'
17+
print("Building Avante...")
18+
19+
vim.fn.jobstart({'make'}, {
20+
cwd = plugin_path,
21+
on_stdout = function(_, data)
22+
for _, line in ipairs(data) do
23+
if line ~= "" then print("Build: " .. line) end
24+
end
25+
end,
26+
27+
on_exit = function(_, exit_code)
28+
if exit_code == 0 then
29+
print("Build successful! Run :AvanteLoad to activate.")
30+
else
31+
print("Build failed with exit code: " .. exit_code)
32+
end
33+
end
34+
})
35+
end, {})
36+
37+
vim.api.nvim_create_user_command('AvanteLoad', function()
38+
vim.cmd('packadd avante.nvim')
39+
require("avante_lib").load()
40+
require('avante').setup({
41+
provider = "claude",
42+
behaviour = {
43+
auto_apply_diff_after_generation = true,
44+
auto_set_highlight_group = true,
45+
auto_set_keymaps = true,
46+
},
47+
auto_suggestions_provider = "claude",
48+
suggestion = {
49+
debounce = 1200,
50+
throttle = 1200,
51+
},
52+
providers = {
53+
claude = {
54+
endpoint = "https://api.anthropic.com",
55+
model = "claude-sonnet-4-20250514",
56+
extra_request_body = {
57+
temperature = 0.75,
58+
max_tokens = 4096,
59+
},
60+
},
61+
},
62+
})
63+
print("Avante loaded and configured!")
64+
end, {})
65+
end
66+
67+
config()

build/home/blong14/.config/nvim/lua/blong14/packer.lua

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
-- This file can be loaded by calling `lua require('plugins')` from your init.vim
2+
local ensure_packer = function()
3+
local fn = vim.fn
4+
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
5+
if fn.empty(fn.glob(install_path)) > 0 then
6+
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
7+
vim.cmd [[packadd packer.nvim]]
8+
return true
9+
end
10+
return false
11+
end
212

3-
-- Only required if you have packer configured as `opt`
4-
vim.cmd [[packadd packer.nvim]]
13+
local packer_bootstrap = ensure_packer()
514

615
return require('packer').startup(function(use)
716
-- Packer can manage itself
@@ -39,27 +48,27 @@ return require('packer').startup(function(use)
3948

4049
use("marko-cerovac/material.nvim")
4150

42-
use {
43-
'nvim-lualine/lualine.nvim',
44-
requires = { 'nvim-tree/nvim-web-devicons', opt = true }
45-
}
51+
use("nvim-lualine/lualine.nvim")
52+
53+
-- AI related tools
4654

55+
-- avante __
56+
use("nvim-lua/plenary.nvim")
57+
use("MunifTanjim/nui.nvim")
58+
use("MeanderingProgrammer/render-markdown.nvim")
59+
use("stevearc/dressing.nvim")
4760
use("preservim/nerdtree")
4861
use("ryanoasis/vim-devicons")
49-
50-
-- AI related tools
5162
-- use("github/copilot.vim")
52-
5363
use{
5464
"yetone/avante.nvim",
55-
branch = "main",
56-
run = "make",
65+
tag = "v0.0.9", -- Use specific stable version instead of main
66+
opt = true, -- Don't auto-load for security
5767
requires = {
58-
"stevearc/dressing.nvim",
59-
"MunifTanjim/nui.nvim",
60-
"nvim-lua/plenary.nvim",
61-
"MeanderingProgrammer/render-markdown.nvim",
62-
"github/copilot.vim",
68+
{'nvim-lua/plenary.nvim'},
69+
{'MunifTanjim/nui.nvim'},
70+
{'MeanderingProgrammer/render-markdown.nvim'},
71+
{'stevearc/dressing.nvim'},
6372
},
6473
}
6574

build/home/blong14/bin/install_zig.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
export ZIG_VERSION="0.13.0";
3+
export ZIG_VERSION="0.14.1";
44

55
if [ "$TARGETARCH" = "arm64" ]; then
66
echo "Building for ARM64 architecture";
@@ -15,7 +15,8 @@ echo "ZIG_VERSION=$ZIG_VERSION";
1515
mkdir -p "$HOME/sdk/zig${ZIG_VERSION}"
1616

1717
echo "Downloading zig ${ZIG_VERSION} for ${ZIG_ARCH}...";
18-
wget -O zig${ZIG_VERSION}.tar.xz "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-${ZIG_ARCH}-${ZIG_VERSION}.tar.xz";
18+
wget -O zig${ZIG_VERSION}.tar.xz "https://ziglang.org/download/${ZIG_VERSION}/zig-${ZIG_ARCH}-linux-${ZIG_VERSION}.tar.xz";
19+
https://ziglang.org/download/0.14.1/zig-x86_64-linux-0.14.1.tar.xz
1920
tar -xf zig${ZIG_VERSION}.tar.xz -C $HOME/sdk/zig${ZIG_VERSION} --strip-components=1;
2021
rm zig${ZIG_VERSION}.tar.xz;
2122

build/playbooks/home/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
ansible.builtin.copy:
99
src: /home/blong14/Developer/git/compute-cluster/build/home/blong14/.config/nvim
1010
dest: /home/blong14/.config
11+
group: blong14
12+
owner: blong14
13+
directory_mode: '0755'
14+
mode: '0644'
1115
- name: Copy bash config
1216
become: yes
1317
become_method: sudo

0 commit comments

Comments
 (0)