From a357aa05104d399250b2665d947e27260c98d892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Fri, 20 Oct 2023 12:06:35 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=91=EF=B8=8F=20remove(nvim):=20unneces?= =?UTF-8?q?sary=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .config/nvim/lua/plugins/smart-splits.lua | 19 +++---- .config/nvim/lua/plugins/treesitter.lua | 69 +---------------------- 2 files changed, 10 insertions(+), 78 deletions(-) diff --git a/.config/nvim/lua/plugins/smart-splits.lua b/.config/nvim/lua/plugins/smart-splits.lua index a90a25c4..76e9b7c7 100644 --- a/.config/nvim/lua/plugins/smart-splits.lua +++ b/.config/nvim/lua/plugins/smart-splits.lua @@ -1,18 +1,17 @@ return { { "mrjones2014/smart-splits.nvim", - build = "./kitty/install-kittens.bash", - enabled = false, + -- build = "./kitty/install-kittens.bash", -- stylua: ignore keys = { - { "", function() require("smart-splits").resize_left() end, desc = "Resize left", mode = "n" }, - { "", function() require("smart-splits").resize_down() end, desc = "Resize down", mode = "n" }, - { "", function() require("smart-splits").resize_up() end, desc = "Resize up", mode = "n" }, - { "", function() require("smart-splits").resize_right() end, desc = "Resize right", mode = "n" }, - { "", function() require("smart-splits").move_cursor_left() end, desc = "Move cursor left", mode = "n" }, - { "", function() require("smart-splits").move_cursor_down() end, desc = "Move cursor down", mode = "n" }, - { "", function() require("smart-splits").move_cursor_up() end, desc = "Move cursor up", mode = "n" }, - { "", function() require("smart-splits").move_cursor_right() end, desc = "Move cursor right", mode = "n" }, + -- { "", function() require("smart-splits").resize_left() end, desc = "Resize left", mode = "n" }, + -- { "", function() require("smart-splits").resize_down() end, desc = "Resize down", mode = "n" }, + -- { "", function() require("smart-splits").resize_up() end, desc = "Resize up", mode = "n" }, + -- { "", function() require("smart-splits").resize_right() end, desc = "Resize right", mode = "n" }, + -- { "", function() require("smart-splits").move_cursor_left() end, desc = "Move cursor left", mode = "n" }, + -- { "", function() require("smart-splits").move_cursor_down() end, desc = "Move cursor down", mode = "n" }, + -- { "", function() require("smart-splits").move_cursor_up() end, desc = "Move cursor up", mode = "n" }, + -- { "", function() require("smart-splits").move_cursor_right() end, desc = "Move cursor right", mode = "n" }, { "", function() require("smart-splits").swap_buf_left() end, desc = "Swap buffer left", mode = "n" }, { "", function() require("smart-splits").swap_buf_down() end, desc = "Swap buffer down", mode = "n" }, { "", function() require("smart-splits").swap_buf_up() end, desc = "Swap buffer up", mode = "n" }, diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua index fa5f8ecf..508b6b8b 100644 --- a/.config/nvim/lua/plugins/treesitter.lua +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -1,41 +1,6 @@ return { { "nvim-treesitter/nvim-treesitter", - version = false, -- last release is way too old and doesn't work on Windows - build = ":TSUpdate", - event = { "LazyFile", "VeryLazy" }, - 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" }, - keys = { - { "", desc = "Increment selection" }, - { "", desc = "Decrement selection", mode = "x" }, - }, ---@type TSConfig ---@diagnostic disable-next-line: missing-fields opts = { @@ -102,40 +67,8 @@ return { "vim", "vue", "hypr", - }, - 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" }, - }, + "java", }, }, - ---@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, }, }