1

Some people write my-fav-editor file.txt on their answers, and I prefer they write editor file.txt instead, unless the question was specifically related to my-fav-editor. I say they should use editorbecause I suppose it's a system alias to whatever is user's default text editor. This also avoids unneeded marketing of their particular favourite.

2

If you're writing a sequence of commands, with editing a file in the middle, I'd say the easiest way to deal with it is a comment, like Michael suggests:

git checkout master
git merge topic
# edit the conflicted file foo, keeping the second version
git add foo
git commit

That avoids the issue altogether - and more to the point, it's clearer than writing an explicit command, when there is something specific that should be done in the editing. I'd say if you're going to recommend something, recommend that. This is probably too small an issue to really bother with in FAQ, though, and not worth commenting on others' answers or performing drive-by editing.

I can't really think of many situations in which you'd need to explicitly write an editor command. But if someone does, the only problem I could see happening would be choosing an obscure editor, making it hard to understand.

I'm not going to get too worked up about someone naming an editor, even if they make the "wrong" choice between vim and emacs. Sure, it's a way of saying "I prefer this editor." So? It's not inflammatory; we all have preferences. The problem is when someone writes "why are you asking how to do this with vim/emacs, just use emacs/vim".

7

I'd personally write "and then edit file.txt", but that's just me. I've never used a system where editor was aliased to anything; possibly you're talking about $EDITOR, which usually is. This seems like the kind of thing that can't be enforced and isn't a big deal though; I really doubt somebody is going to switch editors because they saw one mentioned in an answer here, and I further doubt that people are going to include their editor name in an answer in a covert attempt to get people to switch

3
  • and I further doubt that people are going to include their editor name in an answer in a covert attempt to get people to switch - it's a subtle sorta promotion
    – tshepang
    Nov 17 '10 at 9:51
  • @Tshepang It's really not though, that's my point. Most people are just going to give you the command they would use; they're not thinking "heh, I bet if I mention editor X here people will suddenly decide to use it". And if they do, oh well; at least they're giving a useful answer Nov 17 '10 at 10:18
  • 2
    On Debian and derived distributions, /usr/bin/editor is the system default editor (chosen according to packager-specified priorities, possibly overridden by the sysadmin). There's also /usr/bin/sensible-editor, a script that essentially runs the first existing editor amongst $VISUAL, $EDITOR, nano and vi. Nov 17 '10 at 23:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .