vim9script iab --> ------------------------------------------------------------------------------=abbr#Eatchar() iab ==> ===============================================================================abbr#Eatchar() # Yank the visual selection before using followng abbrevs, to get selection into register 0 or " # '"' is the default register (:h v:register), when no register is 'active' or specified. # Registers are also set, so you can use @u, @b, @i macros. # cabbr ぬ 's/0/ぬ&ぬ=abbr#Eatchar()' # setreg('u', ":s/\0/ぬ&ぬ\\") # cabbr ぼ 's/0/ぼ&ぼ=abbr#Eatchar()' # setreg('b', ":s/\0/ぼ&ぼ\\") # cabbr ち 's/0/ち&ち=abbr#Eatchar()' # setreg('i', ":s/\0/ち&ち\\") import '../../autoload/text.vim' vnoremap u text.Surround('ぬ') vnoremap b text.Surround('ぼ') vnoremap i text.Surround('ち')