From 117ba1112cf67ba1d397d14a7ff09a416d6b5a6c Mon Sep 17 00:00:00 2001 From: Alex Pickering Date: Tue, 7 Oct 2025 12:26:48 -0500 Subject: Updates --- nvim/init.vim | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 133 insertions(+), 8 deletions(-) (limited to 'nvim/init.vim') diff --git a/nvim/init.vim b/nvim/init.vim index d5b1fd7..ccc3490 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -128,9 +128,19 @@ Plug 'ryanoasis/vim-devicons' "AI, requires ollama, curl, and plenary "on +Plug 'ravitemer/mcphub.nvim' Plug 'nomnivore/ollama.nvim' Plug 'nvim-lualine/lualine.nvim' -Plug 'dlants/magenta.nvim', {'do': 'npm install --frozen-lockfile'} + +" Magenta.nvim is one ai agent +" Plug 'dlants/magenta.nvim', {'do': 'npm install --frozen-lockfile'} +" Avante.nvim is another that integrates better with ollama +Plug 'MunifTanjim/nui.nvim' +Plug 'MeanderingProgrammer/render-markdown.nvim' +Plug 'yetone/avante.nvim', { 'branch': 'main', 'do': 'make' } + +" Oh boy windsurf +Plug 'Exafunction/windsurf.vim', { 'branch': 'main' } " Terraform Plug 'hashivim/vim-terraform' @@ -307,7 +317,7 @@ noremap :vsplit term://make all "Start a terminal function! s:Terminal() if filereadable(".terminal") - execute feedkeys(":vsplit\:terminal\i./.terminal\") + execute feedkeys(":vsplit term://./.terminal\i") else execute feedkeys(":vsplit\:terminal\i") endif @@ -409,7 +419,7 @@ lua << EOF vim.keymap.set("n", "", "lua vim.lsp.buf.hover()", opts) end, }) - require("lspconfig").lua_ls.setup{ + vim.lsp.config.lua_ls.setup{ settings={ Lua={ runtime={ @@ -427,7 +437,7 @@ lua << EOF } } } - require('lspconfig').harper_ls.setup { + vim.lsp.config.harper_ls.setup { settings = { ["harper-ls"] = { linters = { @@ -439,6 +449,11 @@ lua << EOF } EOF +if filereadable(".lspconfig") + source .lspconfig +endif + + lua << EOF -- ollama.nvim integration do @@ -506,6 +521,10 @@ $buf end EOF +" Disable windsurf by default so we're not chewing through tokens +let g:codeium_enabled = v:false +lua vim.g.codeium_enabled = false + " Open diagnostics (e.g. for harper) nnoremap s :lua vim.diagnostic.open_float() @@ -514,7 +533,7 @@ nnoremap y :let @+ = expand('%') " ollama.nvim - ai code assist -lua require("ollama").config.model = "codestral" +lua require("ollama").config.model = "qwen3" nnoremap gg :lua require("ollama").prompt("fgen") vnoremap gh :lua require("ollama").prompt("Explain_Code") vnoremap gG :lua require("ollama").prompt("rewrite") @@ -551,18 +570,124 @@ lua << EOF ]] EOF +" MCP-hub +lua<< EOF + require("mcphub").setup() +EOF + " Magenta.nvim lua << EOF +--[=[ require('magenta').setup({ profiles = { { - name = "local-codestral", + name = "local-llama3.1:8b", + provider = "ollama", + model = "llama3.1:8b" + }, + { + name = "local-llama3.2:latest", + provider = "ollama", + model = "llama3.2:latest" + }, + { + name = "local-llama3.3:latest", + provider = "ollama", + model = "llama3.3:latest" + }, + { + name = "local-qwen3:8b", + provider = "ollama", + model = "qwen3:8b" + }, + { + name = "local-qwen3:32b", provider = "ollama", - model = "dolphin3:latest" + model = "qwen3:32b" + }, + { + name = "local-qwen3:30b", + provider = "ollama", + model = "qwen3:30b" + }, + { + name = "local-deepseek", + provider = "ollama", + model = "deepseek-r1:latest" + }, + { + name = "claude-35", + provider = "anthropic", + model = "claude-3.5-haiku-latest", + apiKeyEnvVar="ANTHROPIC_API_KEY" + } + }, + picker = "telescope", + mcpServers = { + --[[ + filesystem = { + command = "npx", + args = {"-y","@modelcontextprotocol/server-filesystem","/Users/alexanderpickering"}, + }, + fetch = { + command = "uvx", + args = {"mcp-server-fetch"}, + }, + git = { + command = "uvx", + args = {"mcp-server-git"}, + }, + ]] + mcphub = { + url = "http://localhost:37373/mcp" } }, - picker = "telescope" + commandAllowList = { + "^ls( [^;&|()<>]*)?$", + "^pwd$", + "^echo( [^;&|()<>]*)?$", + "^git (status|log|diff|show|add|commit|push|reset|restore|branch|checkout|switch|fetch|pull|merge|rebase|tag|stash)( [^;&|()<>]*)?$", + "^ls [^;&()<>]* | grep [^;&|()<>]*$", + "^echo [^;&|()<>]* > [a-zA-Z0-9_\\-.]+$", + "^grep( -[A-Za-z]*)? [^;&|()<>]*$", + "^find .*$", + }, }) +]=] +EOF + +autocmd! User avante.nvim +lua << EOF +require('avante').setup{ + provider = "ollama", + providers = { + ollama = { + endpoint = "http://localhost:11434", + model = "qwen3:32b" + } + }, + system_prompt = function() + local hub = require("mcphub").get_hub_instance() + return hub and hub:get_active_servers_prompt() or "" + end, + custom_tools = function() + return { + require("mcphub.extensions.avante").mcp_tool(), + } + end, + disabled_tools = { + "list_files", -- Built-in file operations + "search_files", + "read_file", + "create_file", + "rename_file", + "delete_file", + "create_dir", + "rename_dir", + "delete_dir", + "bash", -- Built-in terminal access + } +} EOF " Acrisure -- cgit v1.2.3-70-g09d2