Use an editor to write "Hello, World"

5

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.

user72528

Posted 2017-09-23T12:34:43.237

Reputation: 1 383

Question was closed 2017-09-23T14:05:02.957

2No exclamation mark!? – ბიმო – 2017-09-23T12:45:59.233

@JonathanAllan See edits. – user72528 – 2017-09-23T13:00:51.273

@BruceForte See the other edit. – user72528 – 2017-09-23T13:01:01.377

2I 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. – Julian Lachniet – 2017-09-23T13:06:53.153

Even though it would be a fairly obvious loophole it is probably worth explicitly banning all other input methods. – Jonathan Allan – 2017-09-23T13:07:15.920

81 mouse click on any of the c like languages supported by TIO – Sanchises – 2017-09-23T13:09:33.263

Answers

4

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.

ბიმო

Posted 2017-09-23T12:34:43.237

Reputation: 15 345

3

Notepad++, 17 keystrokes, R

cat("Hello, World")

19 keystrokes with !

cat("Hello, World!

Okx

Posted 2017-09-23T12:34:43.237

Reputation: 15 025

2Text editors like Sublime Text or notepad++ automatically add a closing ) and ", so in those the keystrokes boil down to cat("Hello, World. – Laikoni – 2017-09-23T17:44:25.913

@Laikoni Thanks. – Okx – 2017-09-23T17:47:28.873

1

WebStorm in ECMAScript, 16 keystrokes

alEnter"Hello, World

Karlis255

Posted 2017-09-23T12:34:43.237

Reputation: 41

Are you sure this actually prints "Hello, World" when run? – Okx – 2017-09-23T13:43:21.620

@Okx Accidentally used Tab instead of Enter. – Karlis255 – 2017-09-23T13:54:56.947