Saving one keystroke on entering command-line command

From Vifm Wiki
Revision as of 08:25, 4 October 2014 by Xaizek (talk | contribs) (→‎Why it works: Describe why it works)
Jump to navigation Jump to search

Here is a demonstration of one of probably not that well known property of Vim's command parser:

" change directory to root of file system

Note absence of space between name of the command (:cd) and its argument (/).

As one might guess, the same applies to Vifm.

Why it works

Because of limited number of allowed characters in command names. This makes unambiguous parsing of command name and its arguments possible in most cases as:

  • no special symbols are allowed in the middle of command names;
  • special symbols after command name (or !/? at the end of user-defined command name) separate the name from arguments;
  • whitespace characters before/between/after arguments are skipped.

When it works