diff --git a/lazyvim.json b/lazyvim.json index 7130344..ad7bad6 100644 --- a/lazyvim.json +++ b/lazyvim.json @@ -3,7 +3,7 @@ "lazyvim.plugins.extras.formatting.prettier" ], "news": { - "NEWS.md": "2123" + "NEWS.md": "2850" }, "version": 3 } \ No newline at end of file diff --git a/lua/plugins/disabled.lua b/lua/plugins/disabled.lua deleted file mode 100644 index cd6e95b..0000000 --- a/lua/plugins/disabled.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - -- disable trouble - -- { "hrsh7th:/nvim-cmp", enabled = false }, - -- { "hrsh7th/nvim-cmp", enabled = false }, -} \ No newline at end of file diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua new file mode 100644 index 0000000..517e25a --- /dev/null +++ b/lua/plugins/editor.lua @@ -0,0 +1,35 @@ +return { + { + "nvim-treesitter/nvim-treesitter", + opts = { + ensure_installed = { + "bash", + "c", + "diff", + "html", + "javascript", + "jsdoc", + "json", + "jsonc", + "lua", + "luadoc", + "luap", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "toml", + "tsx", + "typescript", + "vim", + "vimdoc", + "xml", + "yaml", + "go", + "http", + "sql", + }, + }, + }, +} diff --git a/lua/plugins/cocvim.lua b/lua/plugins/other.lua similarity index 63% rename from lua/plugins/cocvim.lua rename to lua/plugins/other.lua index f08e070..3216b0d 100644 --- a/lua/plugins/cocvim.lua +++ b/lua/plugins/other.lua @@ -1,9 +1,4 @@ return { - -- { - -- 'neoclide/coc.nvim', - -- branch = 'master', - -- build = "yarn install --frozen-lockfile", - -- }, { 'onns/bookmarks.nvim', keys = {}, @@ -14,24 +9,6 @@ return { require("telescope").load_extension("bookmarks") end }, - -- { - -- "scrooloose/nerdtree", - -- keys = { - -- { - -- "e", - -- "NERDTreeToggle", - -- desc = "NERDTreeToggle" - -- }, - -- { - -- "v", - -- "NERDTreeFind", - -- desc = "NERDTreeFind" - -- } - -- }, - -- config = function() - -- require("neo-tree").setup() - -- end - -- }, { "git@github.com:navarasu/onedark.nvim.git", lazy = false, diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 97a415f..45da7ee 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -1,149 +1,146 @@ return { - -- Treesitter is a new parser generator tool that we can - -- use in Neovim to power faster and more accurate - -- syntax highlighting. - { - "nvim-treesitter/nvim-treesitter", - version = false, -- last release is way too old and doesn't work on Windows - build = ":TSUpdate", - event = { "LazyFile", "VeryLazy" }, - init = function(plugin) - -- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early - -- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which - -- no longer trigger the **nvim-treesitter** module to be loaded in time. - -- Luckily, the only things that those plugins need are the custom queries, which we make available - -- during startup. - require("lazy.core.loader").add_to_rtp(plugin) - require("nvim-treesitter.query_predicates") - end, - dependencies = { - { - "nvim-treesitter/nvim-treesitter-textobjects", - 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, - }, - }, - cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" }, - keys = { - { "", desc = "Increment selection" }, - { "", desc = "Decrement selection", mode = "x" }, - }, - ---@type TSConfig - ---@diagnostic disable-next-line: missing-fields - opts = { - highlight = { enable = true }, - indent = { enable = true }, - ensure_installed = { - "bash", - "c", - "diff", - "html", - "javascript", - "jsdoc", - "json", - "jsonc", - "lua", - "luadoc", - "luap", - "markdown", - "markdown_inline", - "python", - "query", - "regex", - "toml", - "tsx", - "typescript", - "vim", - "vimdoc", - "xml", - "yaml", - "go", - "http", - "sql", - }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - node_incremental = "", - scope_incremental = false, - node_decremental = "", - }, - }, - textobjects = { - move = { - enable = true, - goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer" }, - goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer" }, - goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer" }, - goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer" }, - }, - }, - }, - ---@param opts TSConfig - 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) - end, - }, + -- -- Treesitter is a new parser generator tool that we can + -- -- use in Neovim to power faster and more accurate + -- -- syntax highlighting. + -- { + -- "nvim-treesitter/nvim-treesitter", + -- version = false, -- last release is way too old and doesn't work on Windows + -- build = ":TSUpdate", + -- event = { "LazyFile", "VeryLazy" }, + -- init = function(plugin) + -- -- PERF: add nvim-treesitter queries to the rtp and it's custom query predicates early + -- -- This is needed because a bunch of plugins no longer `require("nvim-treesitter")`, which + -- -- no longer trigger the **nvim-treesitter** module to be loaded in time. + -- -- Luckily, the only things that those plugins need are the custom queries, which we make available + -- -- during startup. + -- require("lazy.core.loader").add_to_rtp(plugin) + -- require("nvim-treesitter.query_predicates") + -- end, + -- dependencies = { + -- { + -- "nvim-treesitter/nvim-treesitter-textobjects", + -- 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, + -- }, + -- }, + -- cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" }, + -- keys = { + -- { "", desc = "Increment selection" }, + -- { "", desc = "Decrement selection", mode = "x" }, + -- }, + -- ---@type TSConfig + -- ---@diagnostic disable-next-line: missing-fields + -- opts = { + -- highlight = { enable = true }, + -- indent = { enable = true }, + -- ensure_installed = { + -- "bash", + -- "c", + -- "diff", + -- "html", + -- "javascript", + -- "jsdoc", + -- "json", + -- "jsonc", + -- "lua", + -- "luadoc", + -- "luap", + -- "markdown", + -- "markdown_inline", + -- "python", + -- "query", + -- "regex", + -- "toml", + -- "tsx", + -- "typescript", + -- "vim", + -- "vimdoc", + -- "xml", + -- "yaml", + -- }, + -- incremental_selection = { + -- enable = true, + -- keymaps = { + -- init_selection = "", + -- node_incremental = "", + -- scope_incremental = false, + -- node_decremental = "", + -- }, + -- }, + -- textobjects = { + -- move = { + -- enable = true, + -- goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer" }, + -- goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer" }, + -- goto_previous_start = { ["[f"] = "@function.outer", ["[c"] = "@class.outer" }, + -- goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer" }, + -- }, + -- }, + -- }, + -- ---@param opts TSConfig + -- 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) + -- end, + -- }, - -- Show context of the current function - { - "nvim-treesitter/nvim-treesitter-context", - event = "LazyFile", - enabled = true, - opts = { mode = "cursor", max_lines = 3 }, - keys = { - { - "ut", - function() - local tsc = require("treesitter-context") - tsc.toggle() - if LazyVim.inject.get_upvalue(tsc.toggle, "enabled") then - LazyVim.info("Enabled Treesitter Context", { title = "Option" }) - else - LazyVim.warn("Disabled Treesitter Context", { title = "Option" }) - end - end, - desc = "Toggle Treesitter Context", - }, - }, - }, + -- -- Show context of the current function + -- { + -- "nvim-treesitter/nvim-treesitter-context", + -- event = "LazyFile", + -- enabled = true, + -- opts = { mode = "cursor", max_lines = 3 }, + -- keys = { + -- { + -- "ut", + -- function() + -- local tsc = require("treesitter-context") + -- tsc.toggle() + -- if LazyVim.inject.get_upvalue(tsc.toggle, "enabled") then + -- LazyVim.info("Enabled Treesitter Context", { title = "Option" }) + -- else + -- LazyVim.warn("Disabled Treesitter Context", { title = "Option" }) + -- end + -- end, + -- desc = "Toggle Treesitter Context", + -- }, + -- }, + -- }, - -- Automatically add closing tags for HTML and JSX - { - "windwp/nvim-ts-autotag", - event = "LazyFile", - opts = {}, - }, + -- -- Automatically add closing tags for HTML and JSX + -- { + -- "windwp/nvim-ts-autotag", + -- event = "LazyFile", + -- opts = {}, + -- }, }