nvim : add mwr macro to rewrap.

This commit is contained in:
Dmitry Voronin 2023-11-28 02:15:44 +03:00
parent 49ba758c95
commit 7fe2c859ec

View file

@ -6,9 +6,13 @@ rekey_visual("mw\"", "s\"\"<esc>P") -- wrap in "".
rekey_visual("mw3\"", "s\"\"\"\"\"\"<esc>hhP") -- wrap in 3x "".
rekey_visual("mw'", "s''<esc>P") -- wrap in "".
rekey_visual("mw(", "s()<esc>P") -- wrap in ().
rekey_visual("mw)", "s()<esc>P") -- wrap in ().
rekey_visual("mw{", "s{}<esc>P") -- wrap in {}.
rekey_visual("mw}", "s{}<esc>P") -- wrap in {}.
rekey_visual("mw<", "s<><esc>P") -- wrap in {}.
rekey_visual("mw>", "s<><esc>P") -- wrap in {}.
rekey_visual("mw[", "s[]<esc>P") -- wrap in [].
rekey_visual("mw]", "s[]<esc>P") -- wrap in [].
rekey_visual("mw`", "s``<esc>P") -- wrap in ``.
rekey_visual("mw3`", "s``````<esc>hhP") -- wrap in 3x ``.
rekey_visual("mw*", "s**<esc>P") -- wrap in **.
@ -16,6 +20,26 @@ rekey_visual("mw2*", "s****<esc>hP") -- wrap in 2x **.
rekey_visual("mw3*", "s******<esc>hhP") -- wrap in 3x **.
rekey_visual("mw ", "s <esc>P") -- wrap in spaces.
-- rewraps. <delete><backspace>
rekey_visual("mwrx", "s<delete><backspace><delete><backspace><esc>p") -- unwrap once (select only stuff inside).
rekey_visual("mwr\"", "s<delete><backspace>\"\"<esc>P") -- wrap in "".
rekey_visual("mwr3\"", "s<delete><backspace>\"\"\"\"\"\"<esc>hhP") -- wrap in 3x "".
rekey_visual("mwr'", "s<delete><backspace>''<esc>P") -- wrap in "".
rekey_visual("mwr(", "s<delete><backspace>()<esc>P") -- wrap in ().
rekey_visual("mwr)", "s<delete><backspace>()<esc>P") -- wrap in ().
rekey_visual("mwr{", "s<delete><backspace>{}<esc>P") -- wrap in {}.
rekey_visual("mwr}", "s<delete><backspace>{}<esc>P") -- wrap in {}.
rekey_visual("mwr<", "s<delete><backspace><><esc>P") -- wrap in {}.
rekey_visual("mwr>", "s<delete><backspace><><esc>P") -- wrap in {}.
rekey_visual("mwr[", "s<delete><backspace>[]<esc>P") -- wrap in [].
rekey_visual("mwr]", "s<delete><backspace>[]<esc>P") -- wrap in [].
rekey_visual("mwr`", "s<delete><backspace>``<esc>P") -- wrap in ``.
rekey_visual("mwr3`", "s<delete><backspace>``````<esc>hhP") -- wrap in 3x ``.
rekey_visual("mwr*", "s<delete><backspace>**<esc>P") -- wrap in **.
rekey_visual("mwr2*", "s<delete><backspace>****<esc>hP") -- wrap in 2x **.
rekey_visual("mwr3*", "s<delete><backspace>******<esc>hhP") -- wrap in 3x **.
rekey_visual("mwr ", "s<delete><backspace> <esc>P") -- wrap in spaces.
-- markdown.
rekey_normal("mmx", ":s/- \\[ \\]/- \\[x\\]<C-l>/<cr>") -- mark checkbox.
rekey_normal("mm ", ":s/- \\[x\\]/- \\[ \\]<C-l>/<cr>") -- unmark checkbox.