diff --git a/lazy-lock.json b/lazy-lock.json index 59bb909..2566023 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -28,6 +28,7 @@ "mini.indentscope": { "branch": "main", "commit": "56d42be090e8fcc68eda69cfe55af8c5e562300e" }, "neoscroll.nvim": { "branch": "master", "commit": "a731f66f1d39ec6175fd201c5bf849e54abda99c" }, "neotest": { "branch": "master", "commit": "f30bab1faef13d47f3905e065215c96a42d075ad" }, + "neotest-gtest": { "branch": "main", "commit": "b44c8afc26cea75ffc80617ce07b4e745a56e589" }, "neotest-java": { "branch": "main", "commit": "320f31c71b183f2c584198f33f93542fd0e5a768" }, "noice.nvim": { "branch": "main", "commit": "03c6a75661e68012e30b0ed81f050358b1e2233c" }, "nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" }, diff --git a/lua/custom/default.lua b/lua/custom/default.lua index 673b95a..0549b43 100644 --- a/lua/custom/default.lua +++ b/lua/custom/default.lua @@ -170,7 +170,7 @@ pcode.active_javascript_config = { pcode.active_php_config = false pcode.active_golang_config = false pcode.active_python_config = false -pcode.active_cpp_config = false +pcode.active_cpp_config = true pcode.active_java_config = { active = true, project = "gradle", -- gradle or maven diff --git a/lua/plugins/cppcfg.lua b/lua/plugins/cppcfg.lua index 561a834..cf8b598 100644 --- a/lua/plugins/cppcfg.lua +++ b/lua/plugins/cppcfg.lua @@ -5,6 +5,7 @@ if pcode.active_cpp_config then M = { { "nvim-treesitter/nvim-treesitter", + event = "VeryLazy", opts = function(_, opts) opts.ensure_installed = opts.ensure_installed or {} vim.list_extend(opts.ensure_installed, { "cpp", "c" }) diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua deleted file mode 100644 index e84b2c1..0000000 --- a/lua/plugins/treesitter.lua +++ /dev/null @@ -1,186 +0,0 @@ -return { - { - "nvim-treesitter/nvim-treesitter", - dependencies = { - { "nvim-treesitter/nvim-treesitter-context" }, - { - "JoosepAlviste/nvim-ts-context-commentstring", - lazy = true, - config = function() - require("ts_context_commentstring").setup({ - enable_autocmd = false, - }) - end, - }, - { - "windwp/nvim-autopairs", - lazy = true, - dependencies = "hrsh7th/nvim-cmp", - event = "InsertEnter", - opts = { - check_ts = true, - ts_config = { - lua = { "string", "source" }, - javascript = { "string", "template_string" }, - java = false, - }, - disable_filetype = { "TelescopePrompt", "spectre_panel" }, - fast_wrap = { - map = "", - chars = { "{", "[", "(", '"', "'", "`" }, - pattern = string.gsub([[ [%'%"%)%>%]%)%}%,] ]], "%s+", ""), - offset = 0, -- Offset from pattern match - end_key = "$", - keys = "qwertyuiopzxcvbnmasdfghjkl", - check_comma = true, - highlight = "PmenuSel", - highlight_grey = "LineNr", - }, - }, - config = function(_, opts) - require("nvim-autopairs").setup(opts) - local cmp_autopairs = require("nvim-autopairs.completion.cmp") - local cmp_status_ok, cmp = pcall(require, "cmp") - if not cmp_status_ok then - return - end - cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done({ map_char = { tex = "" } })) - end, - }, - }, - version = false, -- last release is way too old and doesn't work on Windows - build = ":TSUpdate", - -- event = { "LazyFile", "VeryLazy" }, - lazy = true, - cmd = { - "TSInstall", - "TSUninstall", - "TSUpdate", - "TSUpdateSync", - "TSInstallInfo", - "TSInstallSync", - "TSInstallFromGrammar", - }, - event = { "BufRead", "VeryLazy" }, - opts = function() - return { - highlight = { enable = true }, - indent = { enable = true }, - ensure_installed = {}, - incremental_selection = { - enable = true, - }, - autopairs = { - enable = true, - }, - } - end, - config = function(_, opts) - if type(opts.ensure_installed) == "table" then - ---@type table - local added = {} - opts.ensure_installed = vim.tbl_filter(function(lang) - if added[lang] then - return false - end - added[lang] = true - return true - end, opts.ensure_installed) - end - require("nvim-treesitter.configs").setup(opts) - vim.schedule(function() - require("lazy").load({ plugins = { "nvim-treesitter-textobjects" } }) - end) - end, - }, - { - "nvim-treesitter/nvim-treesitter-textobjects", - lazy = true, - config = function() - -- When in diff mode, we want to use the default - -- vim text objects c & C instead of the treesitter ones. - local move = require("nvim-treesitter.textobjects.move") ---@type table - local configs = require("nvim-treesitter.configs") - for name, fn in pairs(move) do - if name:find("goto") == 1 then - move[name] = function(q, ...) - if vim.wo.diff then - local config = configs.get_module("textobjects.move")[name] ---@type table - for key, query in pairs(config or {}) do - if q == query and key:find("[%]%[][cC]") then - vim.cmd("normal! " .. key) - return - end - end - end - return fn(q, ...) - end - end - end - end, - }, - -- Automatically add closing tags for HTML and JSX - { - "windwp/nvim-ts-autotag", - lazy = true, - event = "BufRead", - opts = {}, - }, - - { - "RRethy/vim-illuminate", - lazy = true, - event = "BufRead", - opts = { - options = { - -- providers: provider used to get references in the buffer, ordered by priority - providers = { - "lsp", - "treesitter", - "regex", - }, - -- delay: delay in milliseconds - delay = 120, - -- filetype_overrides: filetype specific overrides. - -- The keys are strings to represent the filetype while the values are tables that - -- supports the same keys passed to .configure except for filetypes_denylist and filetypes_allowlist - filetype_overrides = {}, - -- filetypes_denylist: filetypes to not illuminate, this overrides filetypes_allowlist - filetypes_denylist = { - "dirvish", - "fugitive", - "alpha", - "NvimTree", - "lazy", - "neogitstatus", - "Trouble", - "lir", - "Outline", - "spectre_panel", - "toggleterm", - "DressingSelect", - "TelescopePrompt", - }, - -- filetypes_allowlist: filetypes to illuminate, this is overridden by filetypes_denylist - filetypes_allowlist = {}, - -- modes_denylist: modes to not illuminate, this overrides modes_allowlist - modes_denylist = {}, - -- modes_allowlist: modes to illuminate, this is overridden by modes_denylist - modes_allowlist = {}, - -- providers_regex_syntax_denylist: syntax to not illuminate, this overrides providers_regex_syntax_allowlist - -- Only applies to the 'regex' provider - -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') - providers_regex_syntax_denylist = {}, - -- providers_regex_syntax_allowlist: syntax to illuminate, this is overridden by providers_regex_syntax_denylist - -- Only applies to the 'regex' provider - -- Use :echom synIDattr(synIDtrans(synID(line('.'), col('.'), 1)), 'name') - providers_regex_syntax_allowlist = {}, - -- under_cursor: whether or not to illuminate under the cursor - under_cursor = true, - }, - }, - config = function(_, opts) - require("illuminate").configure(opts) - end, - }, -} diff --git a/lua/plugins/treesitter_blade.lua b/lua/plugins/treesitter_blade.lua deleted file mode 100644 index 1026804..0000000 --- a/lua/plugins/treesitter_blade.lua +++ /dev/null @@ -1,36 +0,0 @@ -local ts_list = { - "lua", - "vim", - "vimdoc", -} -for _, ts in pairs(pcode.treesitter_ensure_installed or {}) do - table.insert(ts_list, ts) -end -return { - { - "nvim-treesitter/nvim-treesitter", - opts = { - ensure_installed = ts_list, - }, - config = function(_, opts) - local parser_config = require("nvim-treesitter.parsers").get_parser_configs() - - parser_config.blade = { - install_info = { - url = "https://github.com/EmranMR/tree-sitter-blade", - files = { "src/parser.c" }, - branch = "main", - }, - filetype = "blade", - } - - vim.filetype.add({ - pattern = { - [".*%.blade%.php"] = "blade", - }, - }) - - require("nvim-treesitter.configs").setup(opts) - end, - }, -}