-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample-lazyvim-config.lua
More file actions
91 lines (79 loc) · 3.34 KB
/
example-lazyvim-config.lua
File metadata and controls
91 lines (79 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
-- Example LazyVim configuration for context-graph.nvim
-- Add this to your LazyVim plugins configuration
-- Usually in ~/.config/nvim/lua/plugins/context-graph.lua
return {
{
-- For local development
dir = "~/src/context-graph.nvim",
-- For production use (when published):
-- "winterfell/context-graph.nvim",
dependencies = {
"nvim-lua/plenary.nvim", -- Required for async operations
"lewis6991/gitsigns.nvim", -- Required for git collector
-- Optional but recommended:
-- "nvim-treesitter/nvim-treesitter", -- Better code parsing
-- "ldelossa/litee.nvim", -- Enhanced call graphs
-- "ldelossa/litee-calltree.nvim", -- Call tree visualization
},
-- Load strategy options:
event = "VeryLazy", -- Load after startup
-- Alternative: Load on specific commands
-- cmd = { "ContextGraph", "ContextGraphCopy" },
-- Alternative: Load on keymaps (most efficient)
-- keys = {
-- { "<leader>as", mode = { "n", "v" }, desc = "AI context snapshot (shallow)" },
-- { "<leader>aS", mode = { "n", "v" }, desc = "AI context snapshot (medium)" },
-- { "<leader>aD", mode = { "n", "v" }, desc = "AI context snapshot (deep)" },
-- { "<leader>ap", mode = { "n", "v" }, desc = "AI context preview (shallow)" },
-- { "<leader>aP", mode = { "n", "v" }, desc = "AI context preview (medium)" },
-- { "<leader>aA", mode = { "n", "v" }, desc = "AI context preview (deep)" },
-- },
config = function()
require("context_graph").setup({
-- Depth settings
max_call_depth = 3, -- Maximum depth for call graph traversal
max_type_depth = 3, -- Maximum depth for type definition following
-- Parser settings
ts_parser = "typescript", -- Default TreeSitter parser
-- Budget settings (token limits)
budget_softcap = 2000, -- Token budget for deep mode
-- Preview window settings
preview_height = 30, -- Preview window height
preview_width = 100, -- Preview window width
})
-- Optional: Create custom presets
-- local cg = require("context_graph")
-- vim.keymap.set({ "n", "v" }, "<leader>ac", function()
-- cg.collect({
-- name = "custom",
-- depth = "custom",
-- budget = 1500,
-- list = {
-- "selection", "types", "dataflow",
-- "tests", "git", "dependencies"
-- },
-- preview = true, -- Show preview instead of copying
-- })
-- end, { desc = "AI context custom preset" })
end,
},
}
-- Note: The plugin provides three depth presets:
--
-- 1. Shallow (quick) - <leader>as
-- - Selection and diagnostics only
-- - ~300 token budget
-- - Best for quick questions about visible code
--
-- 2. Medium - <leader>aS
-- - Adds types, dataflow, call graph, and git hunks
-- - ~800 token budget
-- - Good for understanding code relationships
--
-- 3. Deep - <leader>aD
-- - Adds tests, dependencies, TODOs, history, and more
-- - ~2000 token budget
-- - Comprehensive context for complex debugging
--
-- The content is automatically copied to your system clipboard
-- and can be pasted directly into ChatGPT, Claude, or other LLMs.