refactor(config): use local.lua for machine-specific paths
- Load local.lua at startup and expose via vim.g.cargdev_local - Update avante.lua to use local config for paths and settings - Update ideaMap.lua to use IDEA_DIR from local config - Remove all hardcoded user paths from plugin configs - Plugins gracefully skip if required local config is missing
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
-- Get local config (loaded in core/init.lua)
|
||||
local local_cfg = vim.g.cargdev_local or {}
|
||||
|
||||
-- Skip plugin if local config is missing required values
|
||||
if not local_cfg.avante_dev_path then
|
||||
return {}
|
||||
end
|
||||
|
||||
return {
|
||||
{
|
||||
dir = "/Users/carlos/Documents/projects/avante.nvim",
|
||||
dir = local_cfg.avante_dev_path,
|
||||
-- "yetone/avante.nvim",
|
||||
event = "VeryLazy",
|
||||
lazy = false,
|
||||
@@ -13,9 +21,9 @@ return {
|
||||
providers = {
|
||||
cargdev = {
|
||||
name = "cargdev", -- Optional
|
||||
endpoint = "http://localhost:5001", -- endpoint = "https://api-ai.cargdev.io", -- API endpoint
|
||||
api_key_name = "CARGDEV_API_KEY", -- reference the ENV VAR below
|
||||
model = "qwen2.5-coder:7b",
|
||||
endpoint = local_cfg.avante_endpoint,
|
||||
api_key_name = local_cfg.avante_api_key_name,
|
||||
model = local_cfg.avante_model,
|
||||
__inherited_from = "ollama", -- ensures compatibility
|
||||
max_tokens = 8192,
|
||||
-- Explicitly ensure tools are enabled
|
||||
@@ -27,7 +35,7 @@ return {
|
||||
},
|
||||
-- Build from source for development
|
||||
-- Run `make BUILD_FROM_SOURCE=true` to build Rust components
|
||||
-- You can also build manually: cd /Users/carlos/Documents/projects/avante.nvim && make
|
||||
-- You can also build manually: cd <avante_dev_path> && make
|
||||
build = "make BUILD_FROM_SOURCE=true",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
-- Get local config (loaded in core/init.lua)
|
||||
local local_cfg = vim.g.cargdev_local or {}
|
||||
|
||||
-- Skip plugin if IDEA_DIR is not configured
|
||||
if not local_cfg.IDEA_DIR then
|
||||
return {}
|
||||
end
|
||||
|
||||
return {
|
||||
"CarGDev/ideadrop.nvim",
|
||||
name = "ideaDrop",
|
||||
@@ -7,7 +15,7 @@ return {
|
||||
},
|
||||
config = function()
|
||||
require("ideaDrop").setup({
|
||||
idea_dir = vim.env.IDEA_DIR,
|
||||
idea_dir = vim.g.cargdev_local.IDEA_DIR,
|
||||
})
|
||||
|
||||
-- Set up convenient keymaps for ideaDrop
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
return {
|
||||
--[[ dir = "/Users/carlos/Documents/SSD_Documents/projects/lazygit.nvim", ]]
|
||||
"kdheepak/lazygit.nvim",
|
||||
cmd = {
|
||||
"LazyGit",
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
return {
|
||||
--[[ dir = '/Users/carlos/Documents/SSD_Documents/personals/leetcode.nvim', ]]
|
||||
"kawre/leetcode.nvim",
|
||||
dependencies = {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
|
||||
Reference in New Issue
Block a user