Replace $$ with \[\] with Vim macros (Evil mode) You can name the macros whatever you want, I just use a, s, and d because that’s what I’m used to. Define macro a q a / \$\$ RET c w \[ ESC q Define macro s q s / \$\$ RET c w \] ESC q Define macro d q d @ a @ s q