14

To indicate in questions and answers that keystrokes are being typed in normal mode or insert mode, should <kbd> be the convention?

Or should we use backticks?

Also, should we lead off ex commands to by typed in normal mode with the colon? :%!uniq or %!uniq? Or :%!uniq (hopefully not).

2
  • It is up to the personal preference and taste of the user writing the post. I don't think there is a single "best way". Feb 3, 2015 at 17:25
  • 1
    @Carpetsmoker you should add that as an answer. (Not that I agree with it, but it's definitely an answer to this question.)
    – derobert
    Feb 3, 2015 at 17:27

4 Answers 4

7

It is up to the personal preference and taste of the user writing the post. I don't think there is a single "best way". As long as the post is reasonably readable I would consider it to be fine.

One obvious downside of <kbd> is that it's awkward to type; so especially in long posts or posts with lots of examples backticks would be better (as in, lots easier to write).

1
  • 2
    Another obvious downside is that it's extremely ugly. (Counts as "personal preference" tho.)
    – yo'
    Feb 3, 2015 at 18:14
5
  • To indicate keystrokes such as /, <kbd> is clear and natural

    • In case of longer sequences such as V}x}}p where typing out <kbd> for each character would be inconvenient, backticks are acceptable
  • For Ex commands to be typed in normal mode, a leading colon as in :%!uniq is clear and natural

    • Using backticks to format these commands is clear and natural
3

I think we should let the authors of the posts do what they feel is most readable, and make edits to improve clarity if necessary.

Trying to establish a convention for "this sort of markup means insert mode, that sort of markup means normal mode," seems like a lost cause. It will be difficult/tedious to enforce, and it won't be terribly obvious to new users coming across the site.

3

As a supporter of semantics, I don't mind sticking my neck out there: I think <kbd> should be used. <code> (backtics) is for code, <kbd> is for specifically for user input. As such, I think any typed commands should use <kbd>.

However, an issue is that <kbd> is sort of a "hidden feature". I don't think it's worth making edits just to make the swap, but I'd like to see it as the site preference.

4

You must log in to answer this question.

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