Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • \$\begingroup\$ What's the ` f<cr>` at the end for? \$\endgroup\$ Commented Aug 1, 2016 at 6:05
  • \$\begingroup\$ @Zwei 'f' is the name of the file, and the <cr> (which is a mnemonic for "enter", a single byte) is necessary to run the command. Commands that start with a colon are like a mini shell inside of vim, and the command :w is the command for writing to a file. \$\endgroup\$ Commented Aug 1, 2016 at 6:08
  • \$\begingroup\$ Should <esc> not be counted as 5 bytes and <cr> as 4, since they have to be fully typed in? \$\endgroup\$ Commented Aug 3, 2016 at 5:38
  • \$\begingroup\$ @BartvanNierop No, <esc> is just notation for "The escape key", which is 0x1B, and <cr> is notation for "The Carriage Return key" which is 0x0B \$\endgroup\$ Commented Aug 3, 2016 at 5:39
  • 1
    \$\begingroup\$ Well first off, there is a precedent to score vim with keystrokes == bytes, but second off, there are several ways to write this in vim "code" without using the vim-key notation. For example, if you use <C-v> to insert a literal escape character and a literal carriage return, then you can assign all of these strokes to a macro, and run it that way. You could also do it in vimscript with normal 'iHello World^[:w f^M which is how vim displays it, not how you enter it. ^[ and ^M are both one byte. \$\endgroup\$ Commented Aug 3, 2016 at 5:50