feat(nvim): Add multiple edit plugins

This commit is contained in:
js0ny 2025-01-26 18:49:49 +00:00
parent be9a65738c
commit a5218cdea7
13 changed files with 137 additions and 42 deletions

View file

@ -16,9 +16,11 @@
"flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
"gitsigns.nvim": { "branch": "main", "commit": "d8918f06624dd53b9a82bd0e29c31bcfd541b40d" }, "gitsigns.nvim": { "branch": "main", "commit": "d8918f06624dd53b9a82bd0e29c31bcfd541b40d" },
"grug-far.nvim": { "branch": "main", "commit": "635e69adf3a714621bd0a289314bc23c5848babb" },
"hover.nvim": { "branch": "main", "commit": "140c4d0ae9397b76baa46b87c574f5377de09309" }, "hover.nvim": { "branch": "main", "commit": "140c4d0ae9397b76baa46b87c574f5377de09309" },
"kanagawa.nvim": { "branch": "master", "commit": "988082eb00b845e4afbcaa4fd8e903da8a3ab3b9" }, "kanagawa.nvim": { "branch": "master", "commit": "988082eb00b845e4afbcaa4fd8e903da8a3ab3b9" },
"lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" }, "lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" },
"lazydev.nvim": { "branch": "main", "commit": "a1b78b2ac6f978c72e76ea90ae92a94edf380cfc" },
"lazygit.nvim": { "branch": "main", "commit": "77a0d42943d8265271e6e6beaed72da54eeb17e7" }, "lazygit.nvim": { "branch": "main", "commit": "77a0d42943d8265271e6e6beaed72da54eeb17e7" },
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
"luasnip-latex-snippets.nvim": { "branch": "main", "commit": "cab134611eb755abe9ba95f5d86969f5cece448d" }, "luasnip-latex-snippets.nvim": { "branch": "main", "commit": "cab134611eb755abe9ba95f5d86969f5cece448d" },
@ -40,9 +42,11 @@
"render-markdown.nvim": { "branch": "main", "commit": "ad055861d17afe058bd835e82292e14a64b51b1d" }, "render-markdown.nvim": { "branch": "main", "commit": "ad055861d17afe058bd835e82292e14a64b51b1d" },
"telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" }, "telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" },
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" }, "todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
"trouble.nvim": { "branch": "main", "commit": "50481f414bd3c1a40122c1d759d7e424d5fafe84" },
"vim-floaterm": { "branch": "master", "commit": "4e28c8dd0271e10a5f55142fb6fe9b1599ee6160" }, "vim-floaterm": { "branch": "master", "commit": "4e28c8dd0271e10a5f55142fb6fe9b1599ee6160" },
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
"vim-just": { "branch": "main", "commit": "d07978c23c967c54c04a4dff9b25bcd6de5e91e0" }, "vim-just": { "branch": "main", "commit": "d07978c23c967c54c04a4dff9b25bcd6de5e91e0" },
"vim-visual-multi-colemak-hnei": { "branch": "master", "commit": "2cc37d77590d6569d991ebd8d96ab5867eb5a47a" },
"vim-wakatime": { "branch": "master", "commit": "e46d7c4f98ee0f40782008dd60cb2a79c377fb1d" }, "vim-wakatime": { "branch": "master", "commit": "e46d7c4f98ee0f40782008dd60cb2a79c377fb1d" },
"vimtex": { "branch": "master", "commit": "b4eb43603dccf33b7d8597fbe1403c6430a24886" }, "vimtex": { "branch": "master", "commit": "b4eb43603dccf33b7d8597fbe1403c6430a24886" },
"which-key.nvim": { "branch": "main", "commit": "6cebd86917df559a88de0f806b2989799c6e6423" }, "which-key.nvim": { "branch": "main", "commit": "6cebd86917df559a88de0f806b2989799c6e6423" },

View file

@ -44,5 +44,6 @@ end
-- which-key.nvim -- which-key.nvim
require("keymaps.which") require("keymaps.which")
require("keymaps.visual-multi")
return M return M

View file

@ -55,6 +55,7 @@ local leader_mappings = {
{ keys = "<Tab>", cmd = "<Cmd>b#<CR>", opts = { desc = "Switch to last buffer" } }, { keys = "<Tab>", cmd = "<Cmd>b#<CR>", opts = { desc = "Switch to last buffer" } },
{ keys = "!", cmd = ":FloatermToggle<CR>", opts = { desc = "Toggle Terminal" } }, { keys = "!", cmd = ":FloatermToggle<CR>", opts = { desc = "Toggle Terminal" } },
{ keys = '"', cmd = ":!wezterm-gui &<CR>", pots = { desc = "Open External Terminal(wezterm)" } }, { keys = '"', cmd = ":!wezterm-gui &<CR>", pots = { desc = "Open External Terminal(wezterm)" } },
{ keys = ";", cmd = ":Telescope<CR>", pots = { desc = "Show Telescope Commands" } },
}, },
b = { -- +buffer b = { -- +buffer
{ keys = "0", cmd = "<Cmd>b#<CR>", opts = { desc = "Switch to last buffer" } }, { keys = "0", cmd = "<Cmd>b#<CR>", opts = { desc = "Switch to last buffer" } },
@ -96,7 +97,7 @@ local leader_mappings = {
}, },
f = { -- +file/find f = { -- +file/find
{ keys = "f", cmd = ":Telescope fd<CR>", opts = { desc = "Find Files" } }, { keys = "f", cmd = ":Telescope fd<CR>", opts = { desc = "Find Files" } },
{ keys = "F", cmd = ":Telescope live_grep<CR>", opts = { desc = "Grep Files" } }, { keys = "F", cmd = ":GrugFar<CR>", opts = { desc = "Search & Replace" } },
{ keys = "l", cmd = ":set filetype=", opts = { desc = "Set Filetype to ..." } }, { keys = "l", cmd = ":set filetype=", opts = { desc = "Set Filetype to ..." } },
{ keys = "n", cmd = ":new<CR>", opts = { desc = "New File" } }, { keys = "n", cmd = ":new<CR>", opts = { desc = "New File" } },
{ keys = "s", cmd = ":write<CR>", opts = { desc = "Save File" } }, { keys = "s", cmd = ":write<CR>", opts = { desc = "Save File" } },

View file

@ -0,0 +1,18 @@
vim.g.VM_mouse_mappings = 1
vim.g.VM_default_mappings = 0
vim.g.VM_custom_motions = {
-- https://github.com/mg979/vim-visual-multi/issues/93
h = "h",
n = "j",
e = "k",
i = "l",
j = "e",
}
vim.g.VM_maps = {
["Add Cursor Down"] = "<A-n>",
["Add Cursor Up"] = "<A-e>",
["i"] = "l",
["I"] = "L",
["n"] = "n",
}

View file

@ -0,0 +1,59 @@
return {
{
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {},
-- stylua: ignore
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
},
{
"js0ny/vim-visual-multi-colemak-hnei",
-- "mg979/vim-visual-multi",
},
{
"echasnovski/mini.pairs",
version = false,
config = function()
require("mini.pairs").setup()
end,
},
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end,
},
{
"MagicDuck/grug-far.nvim",
opts = { headerMaxWidth = 80 },
cmd = "GrugFar",
keys = {
{
"<leader>fF",
function()
local grug = require("grug-far")
local ext = vim.bo.buftype == "" and vim.fn.expand("%:e")
grug.open({
transient = true,
prefills = {
filesFilter = ext and ext ~= "" and "*." .. ext or nil,
},
})
end,
mode = { "n", "v" },
desc = "Search and Replace",
},
},
},
}

View file

@ -29,7 +29,7 @@ require("lazy").setup({
{ import = "plugins.completion" }, { import = "plugins.completion" },
{ import = "plugins.fileutils" }, { import = "plugins.fileutils" },
{ import = "plugins.lsp" }, { import = "plugins.lsp" },
{ import = "plugins.syntax" }, { import = "plugins.edit" },
{ import = "plugins.misc" }, { import = "plugins.misc" },
}, },
-- Configure any other settings here. See the documentation for more details. -- Configure any other settings here. See the documentation for more details.

View file

@ -66,4 +66,18 @@ return {
"NoahTheDuke/vim-just", "NoahTheDuke/vim-just",
ft = { "just" }, ft = { "just" },
}, },
{ import = "plugins.mod.trouble-nvim" },
{ import = "plugins.mod.nvim-treesitter" },
{
"folke/lazydev.nvim",
ft = "lua", -- only load on lua files
opts = {
library = {
-- See the configuration section for more details
-- Load luvit types when the `vim.uv` word is found
{ path = "${3rd}/luv/library", words = { "vim%.uv" } },
},
},
},
} }

View file

@ -12,18 +12,4 @@ return {
"github/copilot.vim", "github/copilot.vim",
lazy = false, lazy = false,
}, },
{
"folke/flash.nvim",
event = "VeryLazy",
---@type Flash.Config
opts = {},
-- stylua: ignore
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
{ "R", mode = { "o", "x" }, function() require("flash").treesitter_search() end, desc = "Treesitter Search" },
{ "<c-s>", mode = { "c" }, function() require("flash").toggle() end, desc = "Toggle Flash Search" },
},
},
} }

View file

@ -1,5 +1,3 @@
-- Author: shadmansaleh
-- Credit: glepnir
local lualine = require("lualine") local lualine = require("lualine")
-- Color table for highlights -- Color table for highlights

View file

@ -43,6 +43,7 @@ return {
{ name = "nvim_lsp" }, { name = "nvim_lsp" },
{ name = "luasnip" }, { name = "luasnip" },
{ name = "copilot" }, { name = "copilot" },
{ name = "lazydev", group_index = 0 },
}, { }, {
{ name = "buffer" }, { name = "buffer" },
{ name = "path" }, { name = "path" },

View file

@ -0,0 +1,37 @@
return {
"folke/trouble.nvim",
opts = {}, -- for default options, refer to the configuration section for custom setup.
cmd = "Trouble",
keys = {
{
"<leader>eE",
"<cmd>Trouble diagnostics toggle<cr>",
desc = "Diagnostics (Trouble)",
},
{
"<leader>ee",
"<cmd>Trouble diagnostics toggle filter.buf=0<cr>",
desc = "Buffer Diagnostics (Trouble)",
},
{
"<leader>es",
"<cmd>Trouble symbols toggle focus=false<cr>",
desc = "Symbols (Trouble)",
},
{
"<leader>el",
"<cmd>Trouble lsp toggle focus=false win.position=right<cr>",
desc = "LSP Definitions / references / ... (Trouble)",
},
{
"<leader>eL",
"<cmd>Trouble loclist toggle<cr>",
desc = "Location List (Trouble)",
},
{
"<leader>ef",
"<cmd>Trouble qflist toggle<cr>",
desc = "Quickfix List (Trouble)",
},
},
}

View file

@ -1,20 +0,0 @@
return {
{ import = "plugins.mod.nvim-treesitter" },
{
"echasnovski/mini.pairs",
version = false,
config = function()
require("mini.pairs").setup()
end,
},
{
"kylechui/nvim-surround",
version = "*", -- Use for stability; omit to use `main` branch for the latest features
event = "VeryLazy",
config = function()
require("nvim-surround").setup({
-- Configuration here, or leave empty to use defaults
})
end,
},
}

View file

@ -1,4 +0,0 @@
(((
This is a playground file.
{(1 + 2) * 3}
)))