Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,31 @@ This above code output following.
(let = s:message (printf "hello %d" (+ 1 (* 2 3))))
```

## Vim9 script

Vim9 script is parsed after `vim9script`, inside `:def` functions and Vim9
lambdas, and for commands with the `:vim9cmd` modifier. `:function` bodies
and commands with `:legacy` use legacy syntax. This includes assignments
and function calls without `:let` and `:call`, declarations with types,
`=>` lambdas with blocks, line continuation without backslash, classes,
interfaces, enums, `:type`, `:import` and `:export`.

```vim
vim9script
var total: number = [1, 2, 3]
->reduce((acc, n) => acc + n)
total += 1
```

```
(vim9script)
(var = total: number (method (list 1 2 3) (reduce (lambda (acc n) (+ acc n)))))
(assign += total 1)
```

The Vim script parser is recursive, deeply nested expressions may need a
larger 'maxfuncdepth'.

## About project name

We know a name "VimL" is not the common short form of "Vim scripting language".
Expand Down
Loading