mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 16:53:00 +00:00
feat(nvim): Add multiple edit plugins
This commit is contained in:
parent
be9a65738c
commit
a5218cdea7
13 changed files with 137 additions and 42 deletions
|
|
@ -44,5 +44,6 @@ end
|
|||
|
||||
-- which-key.nvim
|
||||
require("keymaps.which")
|
||||
require("keymaps.visual-multi")
|
||||
|
||||
return M
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ local leader_mappings = {
|
|||
{ keys = "<Tab>", cmd = "<Cmd>b#<CR>", opts = { desc = "Switch to last buffer" } },
|
||||
{ keys = "!", cmd = ":FloatermToggle<CR>", opts = { desc = "Toggle Terminal" } },
|
||||
{ keys = '"', cmd = ":!wezterm-gui &<CR>", pots = { desc = "Open External Terminal(wezterm)" } },
|
||||
{ keys = ";", cmd = ":Telescope<CR>", pots = { desc = "Show Telescope Commands" } },
|
||||
},
|
||||
b = { -- +buffer
|
||||
{ keys = "0", cmd = "<Cmd>b#<CR>", opts = { desc = "Switch to last buffer" } },
|
||||
|
|
@ -96,7 +97,7 @@ local leader_mappings = {
|
|||
},
|
||||
f = { -- +file/find
|
||||
{ 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 = "n", cmd = ":new<CR>", opts = { desc = "New File" } },
|
||||
{ keys = "s", cmd = ":write<CR>", opts = { desc = "Save File" } },
|
||||
|
|
|
|||
18
tools/nvim/lua/keymaps/visual-multi.lua
Normal file
18
tools/nvim/lua/keymaps/visual-multi.lua
Normal 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",
|
||||
}
|
||||
59
tools/nvim/lua/plugins/edit.lua
Normal file
59
tools/nvim/lua/plugins/edit.lua
Normal 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",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -29,7 +29,7 @@ require("lazy").setup({
|
|||
{ import = "plugins.completion" },
|
||||
{ import = "plugins.fileutils" },
|
||||
{ import = "plugins.lsp" },
|
||||
{ import = "plugins.syntax" },
|
||||
{ import = "plugins.edit" },
|
||||
{ import = "plugins.misc" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
|
|
|
|||
|
|
@ -66,4 +66,18 @@ return {
|
|||
"NoahTheDuke/vim-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" } },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,18 +12,4 @@ return {
|
|||
"github/copilot.vim",
|
||||
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" },
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
-- Author: shadmansaleh
|
||||
-- Credit: glepnir
|
||||
local lualine = require("lualine")
|
||||
|
||||
-- Color table for highlights
|
||||
|
|
@ -43,6 +43,7 @@ return {
|
|||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "copilot" },
|
||||
{ name = "lazydev", group_index = 0 },
|
||||
}, {
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
|
|
|
|||
37
tools/nvim/lua/plugins/mod/trouble-nvim.lua
Normal file
37
tools/nvim/lua/plugins/mod/trouble-nvim.lua
Normal 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)",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -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,
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue