This PR improves support for .syntax files, also adds another default size for the window (enabled with the -d small_window flag).
The .syntax files go in the syntax/ folder, which are loaded when you start ved. When a file is opened, ved searches the loaded syntaxes for a syntax that has the file extension, if found, that syntax is used, otherwise plain text is used.
The structure of a .syntax file is simple, it is a JSON file that contains the following:
{
"name": "", // Programming language name
"extensions": [], // File extensions used by that language
"fmt_cmd": "", // format command. `<PATH>` can be used to get the current file path, example: `v fmt -w <PATH>`.
"keywords": [], // List of keywords used by the language.
"literals": [] // List of literals used by the language.
}
This PR improves support for
.syntax
files, also adds another default size for the window (enabled with the-d small_window
flag).The
.syntax
files go in thesyntax/
folder, which are loaded when you startved
. When a file is opened,ved
searches the loaded syntaxes for a syntax that has the file extension, if found, that syntax is used, otherwise plain text is used.The structure of a
.syntax
file is simple, it is a JSON file that contains the following: