🗑️ remove(nvim): unnecessary code
This commit is contained in:
parent
b7b3c9d77f
commit
a357aa0510
2 changed files with 10 additions and 78 deletions
|
@ -1,18 +1,17 @@
|
|||
return {
|
||||
{
|
||||
"mrjones2014/smart-splits.nvim",
|
||||
build = "./kitty/install-kittens.bash",
|
||||
enabled = false,
|
||||
-- build = "./kitty/install-kittens.bash",
|
||||
-- stylua: ignore
|
||||
keys = {
|
||||
{ "<C-A-Left>", function() require("smart-splits").resize_left() end, desc = "Resize left", mode = "n" },
|
||||
{ "<C-A-Down>", function() require("smart-splits").resize_down() end, desc = "Resize down", mode = "n" },
|
||||
{ "<C-A-Up>", function() require("smart-splits").resize_up() end, desc = "Resize up", mode = "n" },
|
||||
{ "<C-A-Right>", function() require("smart-splits").resize_right() end, desc = "Resize right", mode = "n" },
|
||||
{ "<C-h>", function() require("smart-splits").move_cursor_left() end, desc = "Move cursor left", mode = "n" },
|
||||
{ "<C-j>", function() require("smart-splits").move_cursor_down() end, desc = "Move cursor down", mode = "n" },
|
||||
{ "<C-k>", function() require("smart-splits").move_cursor_up() end, desc = "Move cursor up", mode = "n" },
|
||||
{ "<C-l>", function() require("smart-splits").move_cursor_right() end, desc = "Move cursor right", mode = "n" },
|
||||
-- { "<C-A-Left>", function() require("smart-splits").resize_left() end, desc = "Resize left", mode = "n" },
|
||||
-- { "<C-A-Down>", function() require("smart-splits").resize_down() end, desc = "Resize down", mode = "n" },
|
||||
-- { "<C-A-Up>", function() require("smart-splits").resize_up() end, desc = "Resize up", mode = "n" },
|
||||
-- { "<C-A-Right>", function() require("smart-splits").resize_right() end, desc = "Resize right", mode = "n" },
|
||||
-- { "<C-h>", function() require("smart-splits").move_cursor_left() end, desc = "Move cursor left", mode = "n" },
|
||||
-- { "<C-j>", function() require("smart-splits").move_cursor_down() end, desc = "Move cursor down", mode = "n" },
|
||||
-- { "<C-k>", function() require("smart-splits").move_cursor_up() end, desc = "Move cursor up", mode = "n" },
|
||||
-- { "<C-l>", function() require("smart-splits").move_cursor_right() end, desc = "Move cursor right", mode = "n" },
|
||||
{ "<C-A-h>", function() require("smart-splits").swap_buf_left() end, desc = "Swap buffer left", mode = "n" },
|
||||
{ "<C-A-j>", function() require("smart-splits").swap_buf_down() end, desc = "Swap buffer down", mode = "n" },
|
||||
{ "<C-A-k>", function() require("smart-splits").swap_buf_up() end, desc = "Swap buffer up", mode = "n" },
|
||||
|
|
|
@ -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<string,fun(...)>
|
||||
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<string,string>
|
||||
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 = {
|
||||
{ "<c-space>", desc = "Increment selection" },
|
||||
{ "<bs>", 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 = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
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<string, boolean>
|
||||
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,
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue