nvim-autopairs
nvim-autopairs copied to clipboard
Modify start pair after typing
Is your feature request related to a problem? Please describe.
I want to be able to add symbols before cursor after I have hit a pair trigger, for example
let |
.I press $, and text becomes let $ | $
, where | is cursor position.
Describe the solution you'd like A way to make rule modify symbols before cursor, or simply move the cursor to the right
Describe alternatives you've considered Maybe you can just move cursor somehow, haven't found a way to do that
on readme file
-- you can do anything with regex +special key
-- example press tab to uppercase text:
-- press b1234s<tab> => B1234S1234S
npairs.add_rules({
Rule("b%d%d%d%d%w$", "", "vim")
:use_regex(true,"<tab>")
:replace_endpair(function(opts)
return
opts.prev_char:sub(#opts.prev_char - 4,#opts.prev_char)
.."<esc>viwU"
end)
})