

A multi-purpose EDITOR variable - zdw
http://brettterpstra.com/2013/03/30/a-multi-purpose-editor-variable/

======
dmckeon
To edit several files of one type in one call:

    
    
        #!/bin/bash
        case $1 in
            *_EDITMSG | *MERGE_MSG | *_TAGMSG) 
                            /usr/local/bin/vim      "$@" ;;
            *.md | *.txt)   /usr/local/bin/mmdc     "$@" ;;
            *)              /usr/local/bin/subl -w  "$@" ;;
        esac

------
asveikau
Don't a lot of programs first check for program-specific EDITOR values? So if
you want to change the one for git, set GIT_EDITOR? Seems a lot cleaner than
trying to recognize the filename.

------
jasonm23
Use Emacs, then you don't need several not very good editors. /flamebait

~~~
lokedhs
I was just about to post the same thing (mentioning emacsclient though). Does
that make me a troll? :-)

~~~
jasonm23
apparently, not.

------
kaens
This is not a multi-purpose EDITOR variable.

This is using a dispatch script as $EDITOR.

------
mccolin
Do people not often use "git commit -m" for commit messages? Curious as to the
common level of need to launch the full editor.

~~~
pilgrim689
depends. for small commits, a one-liner suffices. For large commits, merge
commits, etc., or for repos that require you to sign-off on the commit or
whatnot, a one-liner followed by a blank line and then a nice paragraph or
bullet-point list is necessary. "launching a full editor" is hardly a problem
with emacsclient or vi[m]

~~~
jordibunster
The smaller the commit, the more likely that it needs a proper explanation of
why it was made.

When you find a commit from two years ago that changes a constant from -1 to
-2, and the commit message says "constant change", or "bugfix in floobers"
you're left with no context.

------
mooism2
Great! Now, how do I get EDITOR (and PAGER, for that matter) on a remote
system to refer to an editor on the system I'm sshing in from?

~~~
kree10
Take a look at bcvi if your preferred local editor is vim:
<http://sshmenu.sourceforge.net/articles/bcvi/>

------
dubcanada
Your website font on Windows is just plain terrible looking.

Regardless of that... I love this!

~~~
dangrossman
Don't blame Windows for Chrome's terrible text rendering there. Firefox and IE
don't mangle fonts the same way.

~~~
drivebyacct2
Does Chrome use a different rendering in Linux? It looks fine here and I don't
really have issues with fonts. (Except Calibri, people need to stop using it.
It looks bad as is, and it looks awful in Linux without a bunch of manual
hacks)

~~~
Evbn
Not sure about windows, but Chrome definitely renders differently between Mac
and Linux-- which is why Google Drive Presentations are not cross-platform --
spacing between objects gets messed up when you switch.

