5
\$\begingroup\$

Objective

Use any editor or IDE (vim, emacs, IntelliJ, etc) to write a valid "Hello, World" program in any C-like language. The "!" is optional, but you get style points if you use it. You may use publicly available plugins, a publicly available vimrc, etc, but you may not write or make modifications to them specifically for this challenge.

Winning

Fewest key presses and mouse clicks and touchscreen taps :P wins (only counted when the key is pressed down).

Submission:

A valid submission requires the number of key presses, the editor used, the language used, a list of the keystrokes pressed, and the important parts of any vimrc, a list of plugins, or anything else required to replicate your result.

\$\endgroup\$

closed as too broad by Julian Lachniet, Shaggy, dzaima, 0 ', Sriotchilism O'Zaic Sep 23 '17 at 14:05

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    \$\begingroup\$ No exclamation mark!? \$\endgroup\$ – ბიმო Sep 23 '17 at 12:45
  • \$\begingroup\$ @JonathanAllan See edits. \$\endgroup\$ – user72528 Sep 23 '17 at 13:00
  • \$\begingroup\$ @BruceForte See the other edit. \$\endgroup\$ – user72528 Sep 23 '17 at 13:01
  • 2
    \$\begingroup\$ I am voting to close this as too broad, since the user can choose the operating system, the editor, the plugins on the editor, and many other variables. This also doesn't account for the amount of time it takes to activate plugins, or what's in the clipboard. \$\endgroup\$ – Julian Lachniet Sep 23 '17 at 13:06
  • 8
    \$\begingroup\$ 1 mouse click on any of the c like languages supported by TIO \$\endgroup\$ – Sanchises Sep 23 '17 at 13:09
4
\$\begingroup\$

Vim with Ultisnips in C (gcc), 30 keystrokes

imaTabTabputs("Hello, World!");Esc:x

Explanation

To use the above you'll need the mentioned Plugin installed and g:UltiSnipsExpandTrigger and g:UltiSnipsJumpForwardTrigger bound to Tab, further you'll need this snippet in your g:UltiSnipsDir. This also makes the assumption that you opened a file which sets filetype=c:

  • ima: Change to Insert mode and enter ma
  • TabTab: Select and expand the main <snip>
  • puts("Hello, World!");: Insert the remaining characters
  • Esc: Change to Normal mode
  • :x: Write the file and exit

The resulting file looks like this:

int main(int argc, char *argv[])
{
  puts("Hello, World!");
  return 0;
}

Note: I couldn't just now find a complete vimrc but here's a StackOverflow post that mentions the relevant parts.

\$\endgroup\$
3
\$\begingroup\$

Notepad++, 17 keystrokes, R

cat("Hello, World")

19 keystrokes with !

cat("Hello, World!
\$\endgroup\$
  • 2
    \$\begingroup\$ Text editors like Sublime Text or notepad++ automatically add a closing ) and ", so in those the keystrokes boil down to cat("Hello, World. \$\endgroup\$ – Laikoni Sep 23 '17 at 17:44
  • \$\begingroup\$ @Laikoni Thanks. \$\endgroup\$ – Okx Sep 23 '17 at 17:47
1
\$\begingroup\$

WebStorm in ECMAScript, 16 keystrokes

alEnter"Hello, World

\$\endgroup\$
  • \$\begingroup\$ Are you sure this actually prints "Hello, World" when run? \$\endgroup\$ – Okx Sep 23 '17 at 13:43
  • \$\begingroup\$ @Okx Accidentally used Tab instead of Enter. \$\endgroup\$ – Karlis255 Sep 23 '17 at 13:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.