News for hackers. Stuff that matters.
Re:A multi-purpose EDITOR variable by dmckeon on Saturday March 30, 2013 @07:22PM (#5467021)
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
Re:A multi-purpose EDITOR variable by asveikau on Saturday March 30, 2013 @07:55PM (#5467099)
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.
Re:A multi-purpose EDITOR variable by jasonm23 on Saturday March 30, 2013 @07:53PM (#5467095)
Use Emacs, then you don't need several not very good editors. /flamebait
Re:A multi-purpose EDITOR variable by lokedhs on Saturday March 30, 2013 @08:18PM (#5467156)
I was just about to post the same thing (mentioning emacsclient though). Does that make me a troll? :-)
Re:A multi-purpose EDITOR variable by jasonm23 on Saturday March 30, 2013 @11:01PM (#5467521)
apparently, not.
Re:A multi-purpose EDITOR variable by jlgreco on Sunday March 31, 2013 @01:14AM (#5467795)
Frankly I don't see the point with Vim either, or any other editor that is capable of some concept of modes. Why doesn't the author find sublime suitable for git commit messages?
Re:A multi-purpose EDITOR variable by alecdbrooks on Sunday March 31, 2013 @05:29AM (#5468195)
I would guess it has something to do with Vim having a console version and Sublime not. Commit messages are so short he probably just wants it to pop up in his shell, rather than in another window.
Re:A multi-purpose EDITOR variable by dlitz on Sunday March 31, 2013 @03:26PM (#5469866)
With Emacs, you get a single not very good editor to rule them all! :P
Re:A multi-purpose EDITOR variable by jasonm23 on Saturday April 13, 2013 @03:07AM (#5542805)
says the Vim guy.
Re:A multi-purpose EDITOR variable by kaens on Sunday March 31, 2013 @04:00AM (#5468058)
This is not a multi-purpose EDITOR variable.

This is using a dispatch script as $EDITOR.

Re:A multi-purpose EDITOR variable by mccolin on Saturday March 30, 2013 @08:27PM (#5467172)
Do people not often use "git commit -m" for commit messages? Curious as to the common level of need to launch the full editor.
Re:A multi-purpose EDITOR variable by pilgrim689 on Saturday March 30, 2013 @08:34PM (#5467189)
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]
Re:A multi-purpose EDITOR variable by jordibunster on Sunday March 31, 2013 @04:59AM (#5468146)
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.

Re:A multi-purpose EDITOR variable by obilgic on Saturday March 30, 2013 @08:33PM (#5467186)
Writing descriptive commit messages with multiple lines.
Re:A multi-purpose EDITOR variable by ams6110 on Saturday March 30, 2013 @11:21PM (#5467566)

  $ commit -m 'This is 
  > my long
  > multi-line message'
Granted, if you really want to write a novel that gets inconvenient, but I try to keep commit message short and reference a story or bug id# for more details when necessary.
Re:A multi-purpose EDITOR variable by ibotty on Sunday March 31, 2013 @03:53AM (#5468047)
i know it was not your point, but pls use a blank line between title and body.
Re:A multi-purpose EDITOR variable by mhd on Saturday March 30, 2013 @10:55PM (#5467505)
If I'm not using some integrated VCS system (which currently happens quite often), it's still mostly the case that I just switched from an editor when I'm writing my CLI commit command. So the mental context switch to transfer back into an editor setting is pretty minimal. And with the editor running (or EDITOR being vi(m)/emacsclient), the startup is negligible, too. So since the time of CVS, and now with either SVN or git, I just don't care too make a difference between small or larger commit messages and completely ignore options of expressing my commit message on the shell, going to the editor all the time.

I found that this also encourages me to be a bit more specific about the reasons for the changes committed. A few lines don't really hurt.

On the other hand, it might be that my commit schedule might still be too influenced by the older VCS systems, and a more frequent git-ish approach would encourage a more in-line approach. But right now I think that my one or two additional lines help more than they hurt.

Re:A multi-purpose EDITOR variable by octo_t on Sunday March 31, 2013 @07:00AM (#5468342)
Please do not do this. Please.

Build up your commit with git add -p (which requires an editor), then git commit -v and check what you are committing again.

Re:A multi-purpose EDITOR variable by vq on Sunday March 31, 2013 @05:29AM (#5468194)
Even if you do you'll still need EDITOR for interactive rebase.
Re:A multi-purpose EDITOR variable by mooism2 on Sunday March 31, 2013 @04:39AM (#5468109)
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?
Re:A multi-purpose EDITOR variable by kree10 on Sunday March 31, 2013 @11:26AM (#5468882)
Take a look at bcvi if your preferred local editor is vim: http://sshmenu.sourceforge.net/articles/bcvi/
Re:A multi-purpose EDITOR variable by dubcanada on Saturday March 30, 2013 @08:53PM (#5467224)
Your website font on Windows is just plain terrible looking.

Regardless of that... I love this!

Re:A multi-purpose EDITOR variable by dangrossman on Saturday March 30, 2013 @10:20PM (#5467427)
Don't blame Windows for Chrome's terrible text rendering there. Firefox and IE don't mangle fonts the same way.
Re:A multi-purpose EDITOR variable by drivebyacct2 on Sunday March 31, 2013 @01:26AM (#5467822)
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)
Re:A multi-purpose EDITOR variable by Evbn on Sunday March 31, 2013 @02:23AM (#5467907)
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.