From 8803de9facfc79b0e57dd68ed088c404b47d56bc Mon Sep 17 00:00:00 2001 From: Carlos Gutierrez Date: Thu, 22 Jan 2026 22:34:34 -0500 Subject: [PATCH] updating plugins --- .gitignore | 2 +- lua/cargdev/core/options.lua | 35 +++++++++ lua/cargdev/plugins/avante.lua | 76 ------------------- lua/cargdev/plugins/bufferline.lua | 38 +++++----- lua/cargdev/plugins/codetyper.lua | 115 ----------------------------- lua/cargdev/plugins/copilot.lua | 9 +-- lua/cargdev/plugins/formatting.lua | 11 ++- lua/cargdev/plugins/linting.lua | 6 ++ lua/cargdev/plugins/lualine.lua | 13 ++++ lua/cargdev/plugins/mcphub.lua | 6 +- lua/cargdev/plugins/nvim-cmp.lua | 10 +-- lua/cargdev/plugins/vimtex.lua | 18 +++++ 12 files changed, 107 insertions(+), 232 deletions(-) delete mode 100644 lua/cargdev/plugins/avante.lua delete mode 100644 lua/cargdev/plugins/codetyper.lua create mode 100644 lua/cargdev/plugins/vimtex.lua diff --git a/.gitignore b/.gitignore index 03bd2d8..4d9a834 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,6 @@ session.vim # Local configuration overrides local.lua -# Codetyper.nvim - AI coding partner files *.coder.* .coder/ +.vscode/ diff --git a/lua/cargdev/core/options.lua b/lua/cargdev/core/options.lua index 98fa91f..acddff7 100644 --- a/lua/cargdev/core/options.lua +++ b/lua/cargdev/core/options.lua @@ -151,6 +151,14 @@ g.clipboard = { -- Lua specific settings opt.runtimepath:append(vim.fn.stdpath("config") .. "/lua") +-- Custom file type associations +vim.filetype.add({ + extension = { + strata = "html", + sts = "typescript", + }, +}) + -- Better diff opt.diffopt:append("algorithm:patience") opt.diffopt:append("indent-heuristic") @@ -296,3 +304,30 @@ vim.api.nvim_set_hl(0, "NormalFloat", { bg = "#1a1b26" }) -- Modern cursor line (subtle highlight) vim.api.nvim_set_hl(0, "CursorLine", { bg = "#292e42" }) vim.api.nvim_set_hl(0, "CursorLineNr", { fg = "#7aa2f7", bold = true }) + +-- ============================================================================= +-- WORD COUNTER (EXCLUDING SYMBOLS) +-- ============================================================================= + +-- Function to count words excluding symbols +local function count_words_no_symbols() + local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false) + local text = table.concat(lines, " ") + -- Remove all non-alphanumeric characters except spaces + local clean_text = text:gsub("[^%w%s]", "") + -- Count words (sequences of alphanumeric characters) + local count = 0 + for _ in clean_text:gmatch("%w+") do + count = count + 1 + end + return count +end + +-- Make it globally accessible for statusline +_G.word_count_no_symbols = count_words_no_symbols + +-- Create user command to display word count +vim.api.nvim_create_user_command("WordCount", function() + local count = count_words_no_symbols() + vim.notify("Words (excluding symbols): " .. count, vim.log.levels.INFO) +end, { desc = "Count words excluding symbols" }) diff --git a/lua/cargdev/plugins/avante.lua b/lua/cargdev/plugins/avante.lua deleted file mode 100644 index 7481678..0000000 --- a/lua/cargdev/plugins/avante.lua +++ /dev/null @@ -1,76 +0,0 @@ --- 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 = local_cfg.avante_dev_path, - event = "VeryLazy", - lazy = false, - version = false, - build = "make BUILD_FROM_SOURCE=true", - opts = { - provider = "cargdev", - mode = "agentic", - debug = true, - providers = { - cargdev = { - name = "cargdev", - endpoint = local_cfg.avante_endpoint, - api_key_name = local_cfg.avante_api_key_name, - model = local_cfg.avante_model, - __inherited_from = "ollama", - max_tokens = 8192, - disable_tools = false, - use_ReAct_prompt = false, - }, - }, - }, - dependencies = { - "nvim-treesitter/nvim-treesitter", - "nvim-lua/plenary.nvim", - "MunifTanjim/nui.nvim", - "echasnovski/mini.pick", - "nvim-telescope/telescope.nvim", - "hrsh7th/nvim-cmp", - "ibhagwan/fzf-lua", - "stevearc/dressing.nvim", - "folke/snacks.nvim", - "nvim-tree/nvim-web-devicons", - { - "HakonHarnes/img-clip.nvim", - event = "VeryLazy", - opts = { - default = { - embed_image_as_base64 = false, - prompt_for_file_name = false, - drag_and_drop = { insert_mode = true }, - use_absolute_path = true, - }, - }, - }, - { - "MeanderingProgrammer/render-markdown.nvim", - ft = { "markdown", "Avante" }, - config = function() - require("render-markdown").setup({ - file_types = { "markdown", "Avante" }, - latex = { enabled = false }, - html = { enabled = false }, - yaml = { enabled = false }, - }) - vim.api.nvim_create_autocmd("FileType", { - pattern = { "markdown", "Avante" }, - callback = function() - vim.treesitter.start() - end, - }) - end, - }, - }, - }, -} diff --git a/lua/cargdev/plugins/bufferline.lua b/lua/cargdev/plugins/bufferline.lua index d97a0bd..dddf817 100644 --- a/lua/cargdev/plugins/bufferline.lua +++ b/lua/cargdev/plugins/bufferline.lua @@ -74,15 +74,15 @@ return { }, tab_selected = { fg = "#c0caf5", - bg = "#1a1b26", + bg = "#1f2a48", }, tab_separator = { fg = "#16161e", bg = "#16161e", }, tab_separator_selected = { - fg = "#1a1b26", - bg = "#1a1b26", + fg = "#1f2a48", + bg = "#1f2a48", }, buffer_visible = { fg = "#565f89", @@ -90,7 +90,7 @@ return { }, buffer_selected = { fg = "#c0caf5", - bg = "#1a1b26", + bg = "#1f2a48", bold = true, italic = false, }, @@ -104,7 +104,7 @@ return { }, numbers_selected = { fg = "#c0caf5", - bg = "#1a1b26", + bg = "#1f2a48", bold = true, italic = false, }, @@ -118,7 +118,7 @@ return { }, diagnostic_selected = { fg = "#c0caf5", - bg = "#1a1b26", + bg = "#1f2a48", bold = true, italic = false, }, @@ -132,7 +132,7 @@ return { }, hint_selected = { fg = "#1abc9c", - bg = "#1a1b26", + bg = "#1f2a48", bold = true, italic = false, }, @@ -146,7 +146,7 @@ return { }, hint_diagnostic_selected = { fg = "#1abc9c", - bg = "#1a1b26", + bg = "#1f2a48", bold = true, italic = false, }, @@ -160,7 +160,7 @@ return { }, info_selected = { fg = "#0db9d7", - bg = "#1a1b26", + bg = "#1f2a48", bold = true, italic = false, }, @@ -174,7 +174,7 @@ return { }, info_diagnostic_selected = { fg = "#0db9d7", - bg = "#1a1b26", + bg = "#1f2a48", bold = true, italic = false, }, @@ -188,7 +188,7 @@ return { }, warning_selected = { fg = "#e0af68", - bg = "#1a1b26", + bg = "#1f2a48", bold = true, italic = false, }, @@ -202,7 +202,7 @@ return { }, warning_diagnostic_selected = { fg = "#e0af68", - bg = "#1a1b26", + bg = "#1f2a48", bold = true, italic = false, }, @@ -216,7 +216,7 @@ return { }, error_selected = { fg = "#f7768e", - bg = "#1a1b26", + bg = "#1f2a48", bold = true, italic = false, }, @@ -230,7 +230,7 @@ return { }, error_diagnostic_selected = { fg = "#f7768e", - bg = "#1a1b26", + bg = "#1f2a48", bold = true, italic = false, }, @@ -244,11 +244,11 @@ return { }, modified_selected = { fg = "#e0af68", - bg = "#1a1b26", + bg = "#1f2a48", }, duplicate_selected = { fg = "#c0caf5", - bg = "#1a1b26", + bg = "#1f2a48", italic = true, }, duplicate_visible = { @@ -263,7 +263,7 @@ return { }, separator_selected = { fg = "#16161e", - bg = "#1a1b26", + bg = "#1f2a48", }, separator_visible = { fg = "#16161e", @@ -275,7 +275,7 @@ return { }, indicator_selected = { fg = "#7aa2f7", - bg = "#1a1b26", + bg = "#1f2a48", }, indicator_visible = { fg = "#16161e", @@ -283,7 +283,7 @@ return { }, pick_selected = { fg = "#f7768e", - bg = "#1a1b26", + bg = "#1f2a48", bold = true, italic = false, }, diff --git a/lua/cargdev/plugins/codetyper.lua b/lua/cargdev/plugins/codetyper.lua deleted file mode 100644 index b28a088..0000000 --- a/lua/cargdev/plugins/codetyper.lua +++ /dev/null @@ -1,115 +0,0 @@ -return { - -- Codetyper.nvim - AI-powered coding partner - -- Local development version - dir = "/Volumes/Carlos_SSD/Documents/projects/nvim.plugins/codetyper.nvim", - name = "codetyper.nvim", - lazy = false, -- Load on startup to create .coder folder - priority = 100, -- Load early - dependencies = { - "nvim-lua/plenary.nvim", -- Required: async utilities - -- "nvim-treesitter/nvim-treesitter", -- Required: scope detection via Tree-sitter - -- "nvim-treesitter/nvim-treesitter-textobjects", -- Optional: better text object support - "MunifTanjim/nui.nvim", -- Optional: UI components - }, - event = { - "BufReadPre *.coder.*", - "BufNewFile *.coder.*", - }, - cmd = { - "Coder", - "CoderOpen", - "CoderClose", - "CoderToggle", - "CoderProcess", - "CoderTree", - "CoderTreeView", - "CoderAsk", - "CoderAskToggle", - "CoderAskClear", - }, - keys = { - -- Coder view commands - { "co", "Coder open", desc = "Coder: Open view" }, - { "cC", "Coder close", desc = "Coder: Close view" }, - { "ct", "Coder toggle", desc = "Coder: Toggle view" }, - { "cp", "Coder process", desc = "Coder: Process prompt" }, - { "cs", "Coder status", desc = "Coder: Show status" }, - { "cf", "Coder focus", desc = "Coder: Switch focus" }, - { "cv", "Coder tree-view", desc = "Coder: View tree" }, - { "cr", "Coder tree", desc = "Coder: Refresh tree" }, - -- Ask panel commands - { "ca", "Coder ask", desc = "Coder: Open Ask panel" }, - { "cA", "Coder ask-toggle", desc = "Coder: Toggle Ask panel" }, - { "cx", "Coder ask-clear", desc = "Coder: Clear Ask history" }, - -- Transform commands (inline /@ @/ replacement) - { "ctt", mode = "n", desc = "Coder: Transform tag at cursor" }, - { "ctt", mode = "v", desc = "Coder: Transform selected tags" }, - { "ctT", "Coder transform", desc = "Coder: Transform all tags" }, - }, - config = function() - require("codetyper").setup({ - llm = { - -- Available providers: "ollama", "claude", "openai", "gemini", "copilot" - provider = "copilot", -- Using GitHub Copilot - - -- Ollama (local LLM) - ollama = { - host = "http://localhost:11434", - model = "deepseek-coder:6.7b", - -- model = "codellama:7b", - -- model = "qwen2.5-coder:7b", - }, - - -- Claude (Anthropic) - https://console.anthropic.com/ - -- claude = { - -- api_key = vim.env.ANTHROPIC_API_KEY, -- or hardcode: "sk-ant-..." - -- model = "claude-sonnet-4-20250514", - -- -- model = "claude-3-5-sonnet-20241022", - -- -- model = "claude-3-haiku-20240307", - -- }, - - -- OpenAI - https://platform.openai.com/api-keys - -- openai = { - -- api_key = vim.env.OPENAI_API_KEY, -- or hardcode: "sk-..." - -- model = "gpt-4o", - -- -- model = "gpt-4o-mini", - -- -- model = "gpt-4-turbo", - -- }, - - -- Google Gemini - https://aistudio.google.com/apikey - -- gemini = { - -- api_key = vim.env.GEMINI_API_KEY, -- or hardcode: "AI..." - -- model = "gemini-1.5-pro", - -- -- model = "gemini-1.5-flash", - -- -- model = "gemini-2.0-flash-exp", - -- }, - - -- GitHub Copilot (uses OAuth from copilot.vim/copilot.lua) - copilot = { - model = "gpt-4o", -- or "gpt-4", "gpt-3.5-turbo" - }, - }, - window = { - width = 0.25, -- 1/4 of window - position = "left", - border = "rounded", - }, - patterns = { - open_tag = "/@", - close_tag = "@/", - file_pattern = "*.coder.*", - }, - auto_gitignore = true, - auto_open_ask = false, -- Always open Ask panel on startup - agent_mode = false, - scheduler = { - enabled = true, - ollama_scout = false, -- Disabled since using Copilot directly - escalation_threshold = 0.7, - max_concurrent = 2, - completion_delay_ms = 100, -- Delay before checking completion visibility - apply_delay_ms = 2000, -- Wait 2 seconds before applying code - }, - }) - end, -} diff --git a/lua/cargdev/plugins/copilot.lua b/lua/cargdev/plugins/copilot.lua index 2a4783c..d8f6674 100644 --- a/lua/cargdev/plugins/copilot.lua +++ b/lua/cargdev/plugins/copilot.lua @@ -18,11 +18,10 @@ return { auto_trigger = true, debounce = 75, keymap = { - -- Let codetyper handle keymaps for unified experience - accept = false, - next = false, - prev = false, - dismiss = false, + accept = "", + next = "", + prev = "", + dismiss = "", }, }, filetypes = { diff --git a/lua/cargdev/plugins/formatting.lua b/lua/cargdev/plugins/formatting.lua index f05979c..3b15427 100644 --- a/lua/cargdev/plugins/formatting.lua +++ b/lua/cargdev/plugins/formatting.lua @@ -9,9 +9,14 @@ return { sqlfluff = { command = "sqlfluff", args = { "format", "--dialect", "postgres", "-" }, - stdin = true, -- Ensure it uses stdin + stdin = true, cwd = require("conform.util").root_file({ ".git" }), }, + xmllint = { + command = "xmllint", + args = { "--format", "-" }, + stdin = true, + }, }, formatters_by_ft = { javascript = { "prettier" }, @@ -27,10 +32,12 @@ return { markdown = { "prettier" }, graphql = { "prettier" }, liquid = { "prettier" }, + xml = { "xmllint" }, + tex = { "latexindent" }, lua = { "stylua" }, python = { "isort", "black" }, - dbml = { "dbml" }, -- DBML formatting sql = { "sqlfluff" }, -- SQL formatting + java = { "google-java-format" }, }, format_on_save = function(bufnr) -- Disable autoformat for certain filetypes diff --git a/lua/cargdev/plugins/linting.lua b/lua/cargdev/plugins/linting.lua index c3f8e68..2a8b134 100644 --- a/lua/cargdev/plugins/linting.lua +++ b/lua/cargdev/plugins/linting.lua @@ -63,8 +63,14 @@ return { python = { "pylint" }, dbml = { "dbml" }, sql = { "sqlfluff" }, + html = { "htmlhint" }, + java = { "checkstyle" }, + tex = { "chktex" }, } + -- Set full path for chktex (TeX binaries may not be in Neovim's PATH) + lint.linters.chktex.cmd = "/Library/TeX/texbin/chktex" + local lint_augroup = api.nvim_create_augroup("lint", { clear = true }) api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, { diff --git a/lua/cargdev/plugins/lualine.lua b/lua/cargdev/plugins/lualine.lua index 6fd1598..dbf619e 100644 --- a/lua/cargdev/plugins/lualine.lua +++ b/lua/cargdev/plugins/lualine.lua @@ -74,6 +74,18 @@ return { return " " .. table.concat(names, ", ") end + -- Word counter (excluding symbols) + local function word_count() + local lines = vim.api.nvim_buf_get_lines(0, 0, -1, false) + local text = table.concat(lines, " ") + local clean_text = text:gsub("[^%w%s]", "") + local count = 0 + for _ in clean_text:gmatch("%w+") do + count = count + 1 + end + return "words: " .. count + end + lualine.setup({ options = { theme = theme, @@ -125,6 +137,7 @@ return { { lsp_client, color = { fg = colors.cyan, bg = colors.bg_dark } }, }, lualine_y = { + { word_count, color = { fg = colors.cyan } }, { "encoding", icon = "" }, { "fileformat", icons_enabled = true }, { "filetype", colored = true, icon_only = false }, diff --git a/lua/cargdev/plugins/mcphub.lua b/lua/cargdev/plugins/mcphub.lua index 4460bef..0278803 100644 --- a/lua/cargdev/plugins/mcphub.lua +++ b/lua/cargdev/plugins/mcphub.lua @@ -16,11 +16,7 @@ return { ---Chat-plugin related options----------------- auto_approve = false, -- Auto approve mcp tool calls auto_toggle_mcp_servers = true, -- Let LLMs start and stop MCP servers automatically - extensions = { - avante = { - make_slash_commands = true, -- make /slash commands from MCP server prompts - }, - }, + extensions = {}, --- Plugin specific options------------------- native_servers = {}, -- add your custom lua native servers here diff --git a/lua/cargdev/plugins/nvim-cmp.lua b/lua/cargdev/plugins/nvim-cmp.lua index 8d5430e..100f92c 100644 --- a/lua/cargdev/plugins/nvim-cmp.lua +++ b/lua/cargdev/plugins/nvim-cmp.lua @@ -47,15 +47,8 @@ return { [""] = cmp.mapping.complete(), -- show completion suggestions [""] = cmp.mapping.abort(), -- close completion window [""] = cmp.mapping.confirm({ select = false }), - -- Tab: codetyper suggestion > cmp selection > snippet jump > fallback + -- Tab: cmp selection > snippet jump > fallback [""] = cmp.mapping(function(fallback) - -- Check for codetyper ghost text suggestion first - local ok, suggestion = pcall(require, "codetyper.suggestion") - if ok and suggestion.is_visible() then - suggestion.accept() - return - end - -- Then cmp menu if cmp.visible() then cmp.select_next_item() elseif luasnip.expand_or_jumpable() then @@ -74,7 +67,6 @@ return { end, { "i", "s" }), }), -- sources for autocompletion - -- Note: codetyper uses ghost text suggestions (Copilot-style), not cmp source sources = cmp.config.sources({ { name = "nvim_lsp", priority = 1000 }, { name = "luasnip", priority = 750 }, -- snippets diff --git a/lua/cargdev/plugins/vimtex.lua b/lua/cargdev/plugins/vimtex.lua new file mode 100644 index 0000000..b271a03 --- /dev/null +++ b/lua/cargdev/plugins/vimtex.lua @@ -0,0 +1,18 @@ +return { + "lervag/vimtex", + ft = { "tex", "latex", "bib" }, + config = function() + -- Use Skim on macOS (or change to your preferred PDF viewer) + vim.g.vimtex_view_method = "skim" + + -- Alternatively, use the general viewer (Preview.app) + -- vim.g.vimtex_view_method = "general" + -- vim.g.vimtex_view_general_viewer = "open" + + -- Compiler settings + vim.g.vimtex_compiler_method = "latexmk" + + -- Disable quickfix auto-open (optional) + vim.g.vimtex_quickfix_mode = 0 + end, +}