Difference between revisions of "Saving one keystroke on entering command-line command"

From Vifm Wiki
Jump to: navigation, search
(Initial outline of the page)
 
(Why it works: Describe why it works)
Line 12: Line 12:
 
==== Why it works ====
 
==== Why it works ====
  
'''TODO:'''
+
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 <code>!</code>/<code>?</code> at the end of user-defined command name) separate the name from arguments;
 +
* whitespace characters before/between/after arguments are skipped.
  
 
==== When it works ====
 
==== When it works ====
  
 
'''TODO:'''
 
'''TODO:'''

Revision as of 11:25, 4 October 2014

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
:cd/

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

TODO: