summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nvim/init.vim141
1 files changed, 133 insertions, 8 deletions
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 <C-b> :vsplit term://make all<Cr>
"Start a terminal
function! s:Terminal()
if filereadable(".terminal")
- execute feedkeys(":vsplit\<CR>:terminal\<CR>i./.terminal\<CR>")
+ execute feedkeys(":vsplit term://./.terminal\<CR>i")
else
execute feedkeys(":vsplit\<CR>:terminal\<CR>i")
endif
@@ -409,7 +419,7 @@ lua << EOF
vim.keymap.set("n", "<f1>", "<cmd>lua vim.lsp.buf.hover()<CR>", 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 <leader>s :lua vim.diagnostic.open_float()<CR>
@@ -514,7 +533,7 @@ nnoremap <leader>y :let @+ = expand('%')<CR>
" ollama.nvim - ai code assist
-lua require("ollama").config.model = "codestral"
+lua require("ollama").config.model = "qwen3"
nnoremap <leader>gg :lua require("ollama").prompt("fgen")<CR>
vnoremap <leader>gh :lua require("ollama").prompt("Explain_Code")<CR>
vnoremap <leader>gG :lua require("ollama").prompt("rewrite")<CR>
@@ -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