Tweaked vim config a bunch
This commit is contained in:
parent
c4e8869820
commit
f76340f145
7 changed files with 107 additions and 113 deletions
dotfiles/neovim/lua/my/plugins
43
dotfiles/neovim/lua/my/plugins/mini-surround.lua
Normal file
43
dotfiles/neovim/lua/my/plugins/mini-surround.lua
Normal file
|
@ -0,0 +1,43 @@
|
|||
local M = {
|
||||
"echasnovski/mini.surround",
|
||||
version = "main",
|
||||
event = "VeryLazy",
|
||||
}
|
||||
|
||||
function M.config()
|
||||
require("mini.surround").setup({
|
||||
mappings = {
|
||||
add = "<tab>s", -- Add surrounding in Normal and Visul modes
|
||||
delete = "<tab>d", -- Delete surrounding
|
||||
find = "<tab>f", -- Find surrounding (to the right)
|
||||
find_left = "<tab>F", -- Find surrounding (to the left)
|
||||
highlight = "<tab>h", -- Highlight surrounding
|
||||
replace = "<tab>r", -- Replace surrounding
|
||||
update_n_lines = "", -- Update `n_lines`
|
||||
},
|
||||
custom_surroundings = {
|
||||
["b"] = {
|
||||
input = { "%b()", "^.%s*().-()%s*.$" },
|
||||
output = { left = "(", right = ")" },
|
||||
},
|
||||
["B"] = {
|
||||
input = { "%b{}", "^.%s*().-()%s*.$" },
|
||||
output = { left = "{", right = "}" },
|
||||
},
|
||||
["r"] = {
|
||||
input = { "%b[]", "^.%s*().-()%s*.$" },
|
||||
output = { left = "[", right = "]" },
|
||||
},
|
||||
["q"] = {
|
||||
input = { '".-"', "^.().*().$" },
|
||||
output = { left = '"', right = '"' },
|
||||
},
|
||||
["a"] = {
|
||||
input = { "'.-'", "^.().*().$" },
|
||||
output = { left = "'", right = "'" },
|
||||
},
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
Loading…
Add table
Add a link
Reference in a new issue