3 ms·
Yikes, we can shorten that a bit. :-) function vimify() { (vim - -esbnN -c $@ -c 'w!/dev/fd/3|q!' >/dev/null) 3>&1 } $ echo '<h1>Change Me<
by andrewstuart2 11y ago
Yikes, we can shorten that a bit. :-)
function vimify() {
(vim - -esbnN -c $@ -c 'w!/dev/fd/3|q!' >/dev/null) 3>&1
}
$ echo '<h1>Change Me</h1>' | vimify 'norm vitxiOK I Will'
(Don't forget '-c' if you have more than one transform.)
- markmontymark 11y agoAnd further shorten that to echo '<h1>Change Me</h1>' | vimify 'norm vitcOK I Will'
- alexdme 11y agoAnd further shorten that to echo '<h1>Change Me</h1>' | vimify 'norm citOK I Will'
- pif 11y agoFor robustness sake, you may change $@ with "$*".