Adding command line prefixes

Far Manager Macro System

Adding command line prefixes


Like the regular macros, the added command line prefixes are loaded from Lua- and MoonScript-files, residing in the directory %FARPROFILE%\Macros\scripts and its subdirectories.

Prefixes are loaded by the global function CommandLine that takes one argument – a table with parameters. The function returns the number of successfully loaded prefixes.

CommandLine {
  description = "Adding prefixes";                  -- string (optional field)
  prefixes = "abc:def:1234";                        -- string
  action = function(prefix,text) ...... end;        -- function
}
  • The field prefixes is a list of prefixes delimited by colons. Spaces are not allowed.

  • The field action is the function that is called when the command line begins with one of the registered prefixes. It takes 2 arguments: prefix is the actual prefix in lower case; text is the rest of the command line with leading and trailing spaces stripped.