3 ms·
This is fine and all, but in the old days we used to have a "simple" editor bound to $EDITOR and a more advanced editor bound to $VISUAL. But hey, it's YOUR sy
by dingosity 3y ago
This is fine and all, but in the old days we used to have a "simple" editor bound to $EDITOR and a more advanced editor bound to $VISUAL. But hey, it's YOUR system, so who am I to tell you what to do. Just a reminder that you might find people using $VISUAL instead of $EDITOR. I think common practice for a bazillion years has been setting BOTH $VISUAL and $EDITOR to the full path of your favorite screen editor since hardly anyone needs to worry about editing something on a feature-poor terminal.
And since we're all talking about our favorite uses of $VISUAL and/or $EDITOR, this is mine:
tcv() {
if [ "$#" -ge 1 ]; then
touch $@
chmod 755 $@
${VISUAL:-`which emacs` --color=never} $@
fi
}
I use this when I want to write a shell script that's instantaneously executable. I'm much too busy to issue the chmod command after editing the file for the first time.