>>107794837
-- substitute selection in line
key('v', '<Leader>x', function()
local m=vim.fn.mode()
local x=vim.fn.getregion(vim.fn.getpos('v'), vim.fn.getpos('.'),{type=m})
local ret = ':s/'
-- loop over x, pasting its values (the selected lines) and \n-s as we go
for _, v in ipairs(x) do
ret = ret .. v:
gsub([[\]], [[\\]]):
gsub([[/]], [[\/]]):
gsub([[%.]], [[\.]]):
gsub([[%[]], [[\%[]]):
gsub([=[%]]=], [=[\%]]=]):
gsub([[*]], [[\*]]):
Comment too long. Click here to view the full text.