updating libraries 💥
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
indent_type = "Spaces"
|
||||
indent_width = 2
|
||||
|
||||
|
||||
@@ -303,8 +303,6 @@ function M.setup()
|
||||
|
||||
-- Don't override vim.notify here to avoid circular dependency
|
||||
-- Let the system handle notifications naturally
|
||||
|
||||
print("Notification manager initialized")
|
||||
end
|
||||
|
||||
-- Initialize notification manager
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
-- 0. Setup LuaRocks path for rest.nvim dependencies (Lua 5.1 - Neovim uses LuaJIT)
|
||||
local function setup_luarocks_path()
|
||||
local luarocks_path = vim.fn.system("luarocks path --lr-path --lua-version=5.1 --local"):gsub("\n", "")
|
||||
local luarocks_path = vim.fn.system("luarocks path --lr-path --lua-version=5.1 --local 2>/dev/null"):gsub("\n", "")
|
||||
if luarocks_path and luarocks_path ~= "" then
|
||||
package.path = package.path .. ";" .. luarocks_path
|
||||
end
|
||||
@@ -37,7 +37,7 @@ end
|
||||
vim.api.nvim_create_autocmd("BufRead", {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
vim.cmd("filetype detect")
|
||||
vim.cmd("silent filetype detect")
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
@@ -1,13 +1,18 @@
|
||||
-- -- Copilot Chat keymaps
|
||||
-- local keymap = vim.keymap
|
||||
--
|
||||
-- keymap.set("v", "<leader>zn", ":CopilotChatRename<CR>", { desc = "Rename variable (Copilot Chat)" })
|
||||
-- keymap.set("n", "<leader>zc", ":CopilotChat<CR>", { desc = "Open Copilot Chat" })
|
||||
-- keymap.set("v", "<leader>ze", ":CopilotChatExplain<CR>", { desc = "Explain code (Copilot Chat)" })
|
||||
-- keymap.set("v", "<leader>zr", ":CopilotChatReview<CR>", { desc = "Review code (Copilot Chat)" })
|
||||
-- keymap.set("v", "<leader>zf", ":CopilotChatFix<CR>", { desc = "Fix code issues (Copilot Chat)" })
|
||||
-- keymap.set("v", "<leader>zo", ":CopilotChatOptimize<CR>", { desc = "Optimize code (Copilot Chat)" })
|
||||
-- keymap.set("v", "<leader>zd", ":CopilotChatDocs<CR>", { desc = "Generate docs (Copilot Chat)" })
|
||||
-- keymap.set("n", "<leader>cp", ":Copilot panel<CR>", { desc = "Copilot: Open copilot panel" })
|
||||
-- keymap.set("n", "<leader>cd", ":Copilot disable<CR>", { desc = "Copilot: Disabled" })
|
||||
-- keymap.set("n", "<leader>cs", ":Copilot status<CR>", { desc = "Copilot: Status" })
|
||||
-- Copilot keymaps
|
||||
local keymap = vim.keymap
|
||||
|
||||
-- Copilot panel and status
|
||||
keymap.set("n", "<leader>cp", ":Copilot panel<CR>", { desc = "Copilot: Open copilot panel" })
|
||||
keymap.set("n", "<leader>cd", ":Copilot disable<CR>", { desc = "Copilot: Disable" })
|
||||
keymap.set("n", "<leader>ce", ":Copilot enable<CR>", { desc = "Copilot: Enable" })
|
||||
keymap.set("n", "<leader>cs", ":Copilot status<CR>", { desc = "Copilot: Status" })
|
||||
|
||||
-- Copilot suggestion navigation (insert mode)
|
||||
-- These are configured in copilot.lua but documented here for reference:
|
||||
-- <leader>] - Next suggestion
|
||||
-- <leader>[ - Previous suggestion
|
||||
-- <M-l> - Accept suggestion
|
||||
-- <C-]> - Dismiss suggestion
|
||||
|
||||
-- CodeCompanion keymaps
|
||||
keymap.set("n", "<leader>cc", ":CodeCompanion<CR>", { desc = "CodeCompanion: Open CodeCompanion" })
|
||||
|
||||
@@ -89,4 +89,9 @@ keymap.set("v", "<leader>zd", ":CopilotChatDocs<CR>", { desc = "Generate docs (C
|
||||
|
||||
-- Copilot
|
||||
keymap.set("n", "<leader>cp", ":Copilot panel<CR>", { desc = "Copilot: Open copilot panel" })
|
||||
keymap.set("n", "<leader>ce", ":CopilotChatExplain<CR>", { desc = "Copilot Chat: Explain code" })
|
||||
keymap.set("n", "<leader>ce", ":CopilotChatExplain<CR>", { desc = "Copilot Chat: Explain code" })
|
||||
|
||||
-- Paste HTML as Markdown using pandoc
|
||||
keymap.set("n", "<leader>p", function()
|
||||
vim.cmd("read !pbpaste -Prefer html | pandoc -f html -t gfm")
|
||||
end, { desc = "Paste HTML clipboard as Markdown" })
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- Core options and settings
|
||||
local opt = vim.opt
|
||||
local g = vim.g
|
||||
local fn = vim.fn
|
||||
|
||||
-- Disable deprecated API warnings
|
||||
vim.deprecate = function() end
|
||||
@@ -17,6 +18,10 @@ opt.completeopt = "menuone,noselect" -- Better completion
|
||||
opt.undofile = true -- Persistent undo
|
||||
opt.undodir = vim.fn.stdpath("data") .. "/undodir"
|
||||
|
||||
-- Suppress startup messages to avoid "Press ENTER" prompts
|
||||
opt.shortmess = "aoOtTIcFWS" -- Suppress various messages
|
||||
opt.cmdheight = 1 -- Set command height to avoid prompts
|
||||
|
||||
-- Search settings
|
||||
opt.ignorecase = true -- Case insensitive search
|
||||
opt.smartcase = true -- Case sensitive when uppercase
|
||||
@@ -130,18 +135,19 @@ g.loaded_perl_provider = 0 -- Disable Perl provider
|
||||
g.loaded_ruby_provider = 0 -- Disable Ruby provider (optional)
|
||||
|
||||
-- Python provider configuration
|
||||
g.python3_host_prog = "/opt/homebrew/bin/python3.12" -- Explicit Python path
|
||||
|
||||
g.python3_host_prog = fn.expand("~/.local/pipx/venvs/pynvim/bin/python")
|
||||
|
||||
-- Clipboard provider optimization (macOS)
|
||||
g.clipboard = {
|
||||
name = "xclip",
|
||||
name = "macOS-clipboard",
|
||||
copy = {
|
||||
["+"] = "xclip -selection clipboard",
|
||||
["*"] = "xclip -selection primary",
|
||||
["+"] = "pbcopy",
|
||||
["*"] = "pbcopy",
|
||||
},
|
||||
paste = {
|
||||
["+"] = "xclip -selection clipboard -o",
|
||||
["*"] = "xclip -selection primary -o",
|
||||
["+"] = "pbpaste",
|
||||
["*"] = "pbpaste",
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -1,25 +1,34 @@
|
||||
return {
|
||||
{
|
||||
"yetone/avante.nvim",
|
||||
dir = "/Users/carlos/Documents/projects/avante.nvim",
|
||||
-- "yetone/avante.nvim",
|
||||
event = "VeryLazy",
|
||||
lazy = false,
|
||||
version = false, -- Always pull the latest change
|
||||
build = "make", -- This will build on first load
|
||||
opts = {
|
||||
provider = "claude", -- API provider configuration
|
||||
provider = "cargdev", -- API provider configuration
|
||||
mode = "agentic", -- Enable agentic mode for tool support
|
||||
debug = true, -- Enable debug logging to troubleshoot tools
|
||||
providers = {
|
||||
claude = {
|
||||
endpoint = "https://api.anthropic.com",
|
||||
model = "claude-3-haiku-20240307",
|
||||
timeout = 30000, -- Timeout in milliseconds
|
||||
extra_request_body = {
|
||||
temperature = 0.75,
|
||||
max_tokens = 4096,
|
||||
},
|
||||
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",
|
||||
__inherited_from = "ollama", -- ensures compatibility
|
||||
max_tokens = 8192,
|
||||
-- Explicitly ensure tools are enabled
|
||||
disable_tools = false,
|
||||
-- Tool format: false = function calling (JSON tools in request), true = XML tool format (tools in prompt)
|
||||
use_ReAct_prompt = false, -- Use function calling format (OpenAI-compatible)
|
||||
},
|
||||
},
|
||||
},
|
||||
-- Optional: Build from source if required
|
||||
build = "make",
|
||||
-- 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
|
||||
build = "make BUILD_FROM_SOURCE=true",
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"nvim-lua/plenary.nvim",
|
||||
@@ -32,14 +41,31 @@ return {
|
||||
{
|
||||
"folke/snacks.nvim", -- for input provider snacks
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
priority = 1001, -- Higher than dressing to override it
|
||||
dependencies = {
|
||||
"stevearc/dressing.nvim", -- Load after dressing to override it
|
||||
},
|
||||
config = function()
|
||||
require("snacks").setup({
|
||||
-- Enable all snacks modules
|
||||
bigfile = { enabled = true },
|
||||
dashboard = { enabled = true },
|
||||
dashboard = {
|
||||
enabled = true,
|
||||
autostart = true,
|
||||
-- Ensure dashboard setup runs
|
||||
auto_open = false,
|
||||
},
|
||||
explorer = { enabled = true },
|
||||
image = { enabled = true },
|
||||
image = {
|
||||
enabled = true,
|
||||
-- Auto-detect terminal (will try: kitty, wezterm, ghostty in order)
|
||||
-- If none found, image rendering will be disabled with warnings
|
||||
-- Note: LaTeX and Mermaid features require external tools:
|
||||
-- - LaTeX: tectonic or pdflatex
|
||||
-- - Mermaid: mmdc (Mermaid CLI)
|
||||
-- These warnings are informational and won't prevent basic image rendering
|
||||
terminal = nil, -- nil = auto-detect
|
||||
},
|
||||
input = { enabled = true },
|
||||
lazygit = { enabled = true },
|
||||
notifier = { enabled = true },
|
||||
@@ -57,9 +83,24 @@ return {
|
||||
},
|
||||
})
|
||||
|
||||
-- Force dashboard module initialization
|
||||
-- Access the dashboard module to ensure its setup function runs
|
||||
vim.defer_fn(function()
|
||||
pcall(function()
|
||||
local dashboard = require("snacks.dashboard")
|
||||
-- Access the module to trigger lazy initialization if needed
|
||||
if dashboard and type(dashboard) == "table" then
|
||||
-- Module loaded successfully
|
||||
end
|
||||
end)
|
||||
end, 100)
|
||||
|
||||
-- Set up vim.ui.input and vim.ui.select for snacks
|
||||
vim.ui.input = require("snacks.input").input
|
||||
vim.ui.select = require("snacks.picker").select
|
||||
-- Use vim.schedule to ensure this runs after all plugins are loaded
|
||||
vim.schedule(function()
|
||||
vim.ui.input = require("snacks.input").input
|
||||
vim.ui.select = require("snacks.picker").select
|
||||
end)
|
||||
end,
|
||||
},
|
||||
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
|
||||
@@ -85,6 +126,15 @@ return {
|
||||
require("render-markdown").setup({
|
||||
file_types = { "markdown", "Avante" },
|
||||
latex = { enabled = false }, -- Disable latex to avoid warning
|
||||
html = { enabled = false }, -- Disable html support to avoid warnings
|
||||
yaml = { enabled = false }, -- Disable yaml support to avoid warnings
|
||||
})
|
||||
-- Enable treesitter highlighter for markdown buffers
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = { "markdown", "Avante" },
|
||||
callback = function()
|
||||
vim.treesitter.start()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
84
lua/cargdev/plugins/copilot.lua
Normal file
84
lua/cargdev/plugins/copilot.lua
Normal file
@@ -0,0 +1,84 @@
|
||||
return {
|
||||
{
|
||||
"zbirenbaum/copilot.lua",
|
||||
cmd = "Copilot",
|
||||
event = "InsertEnter",
|
||||
config = function()
|
||||
require("copilot").setup({
|
||||
panel = {
|
||||
enabled = true,
|
||||
auto_refresh = false,
|
||||
keymap = {
|
||||
jump_prev = "[[",
|
||||
jump_next = "]]",
|
||||
accept = "<CR>",
|
||||
refresh = "gr",
|
||||
open = "<M-CR>",
|
||||
},
|
||||
layout = {
|
||||
position = "bottom", -- | top | left | right
|
||||
ratio = 0.4,
|
||||
},
|
||||
},
|
||||
suggestion = {
|
||||
enabled = true,
|
||||
auto_trigger = true, -- Enable auto-trigger suggestions as you type
|
||||
debounce = 75,
|
||||
keymap = {
|
||||
accept = "<M-l>",
|
||||
accept_word = false,
|
||||
accept_line = false,
|
||||
next = "<leader>]", -- Use leader key for next suggestion
|
||||
prev = "<leader>[", -- Use leader key for previous suggestion
|
||||
dismiss = "<C-]>",
|
||||
},
|
||||
},
|
||||
filetypes = {
|
||||
markdown = true,
|
||||
help = true,
|
||||
gitcommit = true,
|
||||
gitrebase = true,
|
||||
hgcommit = true,
|
||||
svn = true,
|
||||
cvs = true,
|
||||
["."] = true,
|
||||
},
|
||||
copilot_node_command = "node", -- Node.js version must be > 16.x
|
||||
server_opts_overrides = {},
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"zbirenbaum/copilot-cmp",
|
||||
dependencies = { "zbirenbaum/copilot.lua" },
|
||||
config = function()
|
||||
require("copilot_cmp").setup()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"olimorris/codecompanion.nvim",
|
||||
dependencies = {
|
||||
"zbirenbaum/copilot.lua",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-telescope/telescope.nvim",
|
||||
},
|
||||
cmd = { "CodeCompanion" },
|
||||
config = function()
|
||||
require("codecompanion").setup({
|
||||
-- Use GitHub Copilot as the provider
|
||||
providers = {
|
||||
copilot = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
-- Configure the UI
|
||||
ui = {
|
||||
window = {
|
||||
width = 0.8,
|
||||
height = 0.8,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,5 +1,15 @@
|
||||
return {
|
||||
"CarGDev/rest.nvim",
|
||||
build = function()
|
||||
-- Install LuaRocks dependencies for Lua 5.1 (Neovim uses LuaJIT which is Lua 5.1 compatible)
|
||||
local packages = { "mimetypes", "xml2lua" }
|
||||
for _, pkg in ipairs(packages) do
|
||||
local result = vim.fn.system("luarocks install --local --lua-version=5.1 " .. pkg .. " 2>&1")
|
||||
if vim.v.shell_error ~= 0 and not result:match("already installed") then
|
||||
vim.notify("Warning: Failed to install " .. pkg .. ": " .. result, vim.log.levels.WARN)
|
||||
end
|
||||
end
|
||||
end,
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
@@ -8,6 +18,26 @@ return {
|
||||
end,
|
||||
},
|
||||
config = function()
|
||||
-- Verify LuaRocks dependencies are available
|
||||
local function check_dependency(name)
|
||||
local success = pcall(require, name)
|
||||
if not success then
|
||||
vim.notify(
|
||||
string.format(
|
||||
"rest.nvim: Missing dependency '%s'. Please run: luarocks install --local %s",
|
||||
name,
|
||||
name
|
||||
),
|
||||
vim.log.levels.WARN
|
||||
)
|
||||
end
|
||||
return success
|
||||
end
|
||||
|
||||
-- Check for required dependencies
|
||||
check_dependency("mimetypes")
|
||||
check_dependency("xml2lua")
|
||||
|
||||
-- Basic configuration for rest.nvim
|
||||
vim.g.rest_nvim = {
|
||||
-- Enable request highlighting
|
||||
|
||||
@@ -28,6 +28,7 @@ return {
|
||||
"pyright",
|
||||
"svelte",
|
||||
"tailwindcss",
|
||||
"ts_ls",
|
||||
},
|
||||
})
|
||||
|
||||
@@ -127,7 +128,9 @@ return {
|
||||
}
|
||||
}
|
||||
},
|
||||
emmet_ls = {},
|
||||
emmet_ls = {
|
||||
filetypes = { "html", "css", "sass", "scss", "less", "javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "svelte" },
|
||||
},
|
||||
eslint = {
|
||||
settings = { workingDirectory = { mode = "auto" } }
|
||||
},
|
||||
@@ -140,8 +143,12 @@ return {
|
||||
}
|
||||
}
|
||||
},
|
||||
graphql = {},
|
||||
html = {},
|
||||
graphql = {
|
||||
filetypes = { "graphql", "gql", "typescript", "javascript", "typescriptreact", "javascriptreact" },
|
||||
},
|
||||
html = {
|
||||
filetypes = { "html" },
|
||||
},
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
@@ -155,7 +162,9 @@ return {
|
||||
},
|
||||
},
|
||||
},
|
||||
prismals = {},
|
||||
prismals = {
|
||||
filetypes = { "prisma" },
|
||||
},
|
||||
pyright = {
|
||||
settings = {
|
||||
python = {
|
||||
@@ -166,17 +175,59 @@ return {
|
||||
}
|
||||
}
|
||||
},
|
||||
svelte = {},
|
||||
tailwindcss = {},
|
||||
svelte = {
|
||||
filetypes = { "svelte" },
|
||||
},
|
||||
tailwindcss = {
|
||||
filetypes = { "html", "css", "sass", "scss", "less", "javascript", "javascriptreact", "typescript", "typescriptreact", "vue", "svelte" },
|
||||
init_options = {
|
||||
userLanguages = {
|
||||
html = "html",
|
||||
css = "css",
|
||||
javascript = "javascript",
|
||||
typescript = "typescript",
|
||||
javascriptreact = "javascriptreact",
|
||||
typescriptreact = "typescriptreact",
|
||||
vue = "vue",
|
||||
svelte = "svelte",
|
||||
},
|
||||
},
|
||||
},
|
||||
ts_ls = {
|
||||
filetypes = { "typescript", "typescriptreact", "javascript", "javascriptreact" },
|
||||
settings = {
|
||||
typescript = {
|
||||
inlayHints = {
|
||||
includeInlayParameterNameHints = "all",
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
},
|
||||
},
|
||||
javascript = {
|
||||
inlayHints = {
|
||||
includeInlayParameterNameHints = "all",
|
||||
includeInlayParameterNameHintsWhenArgumentMatchesName = false,
|
||||
includeInlayFunctionParameterTypeHints = true,
|
||||
includeInlayVariableTypeHints = true,
|
||||
includeInlayPropertyDeclarationTypeHints = true,
|
||||
includeInlayFunctionLikeReturnTypeHints = true,
|
||||
includeInlayEnumMemberValueHints = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- sqls = { settings = { sqls = { connections = { /* …your dbs… */ } } } }, -- optional
|
||||
}
|
||||
|
||||
-- Set up all LSP servers with performance optimizations and error handling
|
||||
for name, cfg in pairs(servers) do
|
||||
lspconfig[name].setup({
|
||||
local server_config = {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = cfg.settings,
|
||||
flags = { debounce_text_changes = 150 },
|
||||
handlers = {
|
||||
["textDocument/publishDiagnostics"] = vim.lsp.with(
|
||||
@@ -184,7 +235,24 @@ return {
|
||||
{ virtual_text = false, signs = true, underline = true, update_in_insert = false }
|
||||
),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
-- Add settings if present
|
||||
if cfg.settings then
|
||||
server_config.settings = cfg.settings
|
||||
end
|
||||
|
||||
-- Add filetypes if present
|
||||
if cfg.filetypes then
|
||||
server_config.filetypes = cfg.filetypes
|
||||
end
|
||||
|
||||
-- Add init_options if present
|
||||
if cfg.init_options then
|
||||
server_config.init_options = cfg.init_options
|
||||
end
|
||||
|
||||
lspconfig[name].setup(server_config)
|
||||
end
|
||||
|
||||
-- Set up additional LSP servers that might not be in mason-lspconfig
|
||||
|
||||
@@ -49,6 +49,7 @@ return {
|
||||
"black", -- python formatter
|
||||
"pylint",
|
||||
"eslint_d",
|
||||
"tree-sitter-cli", -- required for nvim-treesitter parser compilation
|
||||
},
|
||||
})
|
||||
end,
|
||||
|
||||
@@ -47,10 +47,42 @@ return {
|
||||
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
|
||||
["<C-e>"] = cmp.mapping.abort(), -- close completion window
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||
-- Tab to accept Copilot suggestions, fallback to snippet expansion
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
local entry = cmp.get_selected_entry()
|
||||
-- If Copilot suggestion is available and selected, accept it
|
||||
if entry and entry.source.name == "copilot" then
|
||||
cmp.confirm({ select = true })
|
||||
else
|
||||
-- Check if we can find a Copilot entry in the completion menu
|
||||
-- Since Copilot has high priority (900), it's likely near the top
|
||||
-- Just confirm the current selection (Copilot will be selected if available)
|
||||
cmp.confirm({ select = true })
|
||||
end
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
-- Expand snippet or jump to next placeholder
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
-- Fallback to default Tab behavior
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
-- Shift-Tab to go back in snippets
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
-- sources for autocompletion
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp", priority = 1000},
|
||||
{ name = "copilot", priority = 900 }, -- GitHub Copilot suggestions
|
||||
{ name = "luasnip", priority = 750 }, -- snippets
|
||||
{ name = "buffer", priority = 500, keyword_length = 3 }, -- text within current buffer
|
||||
{ name = "path", priority = 250 }, -- file system paths
|
||||
|
||||
@@ -1,24 +1,10 @@
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"lua",
|
||||
"html", -- required by leetcode.nvim
|
||||
"python",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"cpp",
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
lazy = true,
|
||||
dependencies = {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
config = function()
|
||||
require("nvim-treesitter.configs").setup({
|
||||
textobjects = {
|
||||
|
||||
@@ -1,73 +1,81 @@
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
event = { "BufReadPost", "BufNewFile" }, -- Changed from BufReadPre to BufReadPost for better performance
|
||||
build = ":TSUpdate",
|
||||
build = function()
|
||||
-- Install tree-sitter-cli if not available, then update parsers
|
||||
if vim.fn.executable("tree-sitter") == 0 then
|
||||
vim.notify("tree-sitter-cli not found. Please install it: npm install -g tree-sitter-cli", vim.log.levels.WARN)
|
||||
end
|
||||
vim.cmd("TSUpdate")
|
||||
end,
|
||||
dependencies = {
|
||||
"windwp/nvim-ts-autotag",
|
||||
},
|
||||
config = function()
|
||||
-- import nvim-treesitter plugin
|
||||
local treesitter = require("nvim-treesitter.configs")
|
||||
|
||||
-- configure treesitter
|
||||
treesitter.setup({ -- enable syntax highlighting
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = function(lang, buf)
|
||||
-- Prevent Treesitter from parsing Copilot files
|
||||
return lang == "copilot" or vim.api.nvim_buf_get_name(buf):match("copilot.lua")
|
||||
end,
|
||||
-- Performance optimizations
|
||||
use_languagetree = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
-- enable indentation
|
||||
indent = { enable = true },
|
||||
-- enable autotagging (w/ nvim-ts-autotag plugin)
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
-- ensure these language parsers are installed
|
||||
ensure_installed = {
|
||||
"json",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"java",
|
||||
"tsx",
|
||||
"yaml",
|
||||
"html",
|
||||
"css",
|
||||
"prisma",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"svelte",
|
||||
"graphql",
|
||||
"sql",
|
||||
"bash",
|
||||
"lua",
|
||||
"vim",
|
||||
"dockerfile",
|
||||
"gitignore",
|
||||
"query",
|
||||
"vimdoc",
|
||||
"c",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
opts = {
|
||||
-- enable syntax highlighting
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = function(lang, buf)
|
||||
-- Prevent Treesitter from parsing Copilot files
|
||||
return lang == "copilot" or vim.api.nvim_buf_get_name(buf):match("copilot.lua")
|
||||
end,
|
||||
-- Performance optimizations
|
||||
playground = {
|
||||
enable = false, -- Disable playground for better performance
|
||||
use_languagetree = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
-- enable indentation
|
||||
indent = { enable = true },
|
||||
-- enable autotagging (w/ nvim-ts-autotag plugin)
|
||||
autotag = {
|
||||
enable = true,
|
||||
},
|
||||
-- ensure these language parsers are installed
|
||||
ensure_installed = {
|
||||
"json",
|
||||
"javascript",
|
||||
"typescript",
|
||||
"java",
|
||||
"tsx",
|
||||
"yaml",
|
||||
"html",
|
||||
"css",
|
||||
"scss",
|
||||
"prisma",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"svelte",
|
||||
"vue",
|
||||
"graphql",
|
||||
"sql",
|
||||
"bash",
|
||||
"lua",
|
||||
"vim",
|
||||
"dockerfile",
|
||||
"gitignore",
|
||||
"query",
|
||||
"vimdoc",
|
||||
"c",
|
||||
"python",
|
||||
"cpp",
|
||||
"latex",
|
||||
"norg",
|
||||
"typst",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
query_linter = {
|
||||
enable = false, -- Disable query linter for better performance
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
-- Performance optimizations
|
||||
playground = {
|
||||
enable = false, -- Disable playground for better performance
|
||||
},
|
||||
query_linter = {
|
||||
enable = false, -- Disable query linter for better performance
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user