mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43: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
|
|
@ -16,9 +16,11 @@
|
|||
"flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "d8918f06624dd53b9a82bd0e29c31bcfd541b40d" },
|
||||
"grug-far.nvim": { "branch": "main", "commit": "635e69adf3a714621bd0a289314bc23c5848babb" },
|
||||
"hover.nvim": { "branch": "main", "commit": "140c4d0ae9397b76baa46b87c574f5377de09309" },
|
||||
"kanagawa.nvim": { "branch": "master", "commit": "988082eb00b845e4afbcaa4fd8e903da8a3ab3b9" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" },
|
||||
"lazydev.nvim": { "branch": "main", "commit": "a1b78b2ac6f978c72e76ea90ae92a94edf380cfc" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "77a0d42943d8265271e6e6beaed72da54eeb17e7" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" },
|
||||
"luasnip-latex-snippets.nvim": { "branch": "main", "commit": "cab134611eb755abe9ba95f5d86969f5cece448d" },
|
||||
|
|
@ -40,9 +42,11 @@
|
|||
"render-markdown.nvim": { "branch": "main", "commit": "ad055861d17afe058bd835e82292e14a64b51b1d" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "415af52339215926d705cccc08145f3782c4d132" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "50481f414bd3c1a40122c1d759d7e424d5fafe84" },
|
||||
"vim-floaterm": { "branch": "master", "commit": "4e28c8dd0271e10a5f55142fb6fe9b1599ee6160" },
|
||||
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
|
||||
"vim-just": { "branch": "main", "commit": "d07978c23c967c54c04a4dff9b25bcd6de5e91e0" },
|
||||
"vim-visual-multi-colemak-hnei": { "branch": "master", "commit": "2cc37d77590d6569d991ebd8d96ab5867eb5a47a" },
|
||||
"vim-wakatime": { "branch": "master", "commit": "e46d7c4f98ee0f40782008dd60cb2a79c377fb1d" },
|
||||
"vimtex": { "branch": "master", "commit": "b4eb43603dccf33b7d8597fbe1403c6430a24886" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "6cebd86917df559a88de0f806b2989799c6e6423" },
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
(((
|
||||
This is a playground file.
|
||||
{(1 + 2) * 3}
|
||||
)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue