Lines Matching refs:with
34 and compatibility with Vi restricts possible solutions. Execution is quite
51 - a function defined with the `:def` command
54 - a command prefixed with the `vim9cmd` command modifier
56 When using `:function` in a Vim9 script file the legacy syntax is used, with
73 with legacy expression syntax.
85 - Comments start with #, not ": >
92 - Assign values without `:let`, declare variables with `:var`: >
95 - Constants can be declared with `:final` and `:const`: >
100 - Functions are declared with argument types and return type: >
105 and `:s` or `:d` with only flags.
107 - A range before a command must be prefixed with a colon: >
109 - Executing a register with "@r" does not work, you can prepend a colon or use
115 Comments starting with # ~
117 In legacy Vim script comments start with double quote. In Vim9 script
118 comments start with #. >
123 places, especially halfway through an expression with a line break, it's hard
128 In Vi # is a command to list text with numbers. In Vim9 script you can use
137 Do not start a comment with #{, it looks like the legacy dictionary literal
148 A function defined with `:def` is compiled. Execution is many times faster,
193 be used, type checking will then be done at runtime, like with legacy
199 Variable arguments are defined as the last argument, with a name and have a
250 start with an upper case letter even when using the "s:" prefix. In legacy
251 script "s:funcref" could be used, because it could not be referred to with
253 that the name interferes with builtin functions.
279 and variables are deleted, thus you start with a clean slate. This is useful
295 Variable declarations with :var, :final and :const ~
297 Local variables need to be declared with `:var`. Local constants need to be
298 declared with `:final` or `:const`. We refer to both as "variables" in this
341 echo 'do something with ' .. @a
345 And with autocommands: >
355 Declaring a variable with a type but without an initializer will initialize to
361 with `:unlet`.
373 Global variables must be prefixed with "g:", also at the script level. >
379 Global functions must be prefixed with "g:" when defining them, but can be
485 line starts with `substitute(` this will use the function. Prepend a colon to
489 If the expression starts with "!" this is interpreted as a shell command, not
510 When using `function()` the resulting type is "func", a function with any
542 In legacy script a lambda could be called with any number of extra arguments,
572 the commands to find it. For consistency with that no command can follow the
581 Also when confused with the start of a command block: >
590 those cases there is no need to prefix the line with a backslash (see
634 Note that this means that in heredoc the first line cannot start with a bar: >
648 In places where line continuation with a backslash is still needed, such as
649 splitting up a long Ex command, comments can start with '#\ ': >
654 Like with legacy script '"\ ' is used. This is also needed when line
655 continuation is used without a backslash and a line starts with a bar: >
717 those cases the line continuation with a backslash has to be used.
767 Traditionally Vim has supported dictionary literals with a {} syntax: >
783 var dict = {'key with space': value}
792 error. A number can be given with and without the []: >
793 var dict = {123: 'without', [456]: 'with'}
795 {'456': 'with', '123': 'without'}
800 These commands are too easily confused with local variable names.
906 Indexing a string with [idx] or taking a slice with [idx : idx] uses character
920 Numbers starting with zero are not considered to be octal, only numbers
921 starting with "0o" are octal: "0o744". |scriptversion-4|
930 Ex command ranges need to be prefixed with a colon. >
943 Some Ex commands can be confused with assignments in Vim9 script: >
961 Functions defined with `:def` compile the whole function. Legacy functions
987 Or put the unsupported code inside an `if` with a constant expression that
1008 A workaround is to invoke the command indirectly with `:execute`: >
1072 [!] is used as with `:function`. Note that
1078 :enddef End of a function defined with `:def`. It should be on
1087 legacy script, then script-local variables must be accessed with the "s:"
1102 Like `:disassemble` but with the instructions used for
1106 Like `:disassemble` but with the instructions used for
1198 func: {type} any number and type of arguments with specific
1201 func() function with no argument, does not return a
1204 func(): {type} function with no argument and return type
1206 func({type}) function with argument type, does not return
1208 func({type}): {type} function with argument type and return type
1209 func(?{type}) function with type of optional argument, does
1211 func(...{type}) function with type of variable number of
1214 function with:
1226 Custom types can be defined with `:type`: >
1228 Custom types must start with a capital letter, to avoid name clashes with
1271 after the "<" or before the ">" (to avoid them being confused with
1315 string doesn't start with a number. Quite often this leads to hard-to-find
1363 global namespace. If a file starts with: >
1378 Vim default value, like with: >
1456 - An absolute path, starting with "/" on Unix or "D:/" on MS-Windows. This
1523 - Class names are always CamelCase (to avoid a name clash with builtin types)
1525 - Single inheritance with `class ThisClass extends BaseClass`
1526 - `abstract class` (class with incomplete implementation)
1532 Again, much of this is from TypeScript with a slightly different syntax.
1536 - Extend a class with methods, using an import (like Dart)
1570 impossible, because of the overhead involved with calling a function, setting
1577 which allows for a function with different semantics. Most things still work
1582 "function" which clashes with legacy Vim script.
1600 Vim before, with some additions such as "void" and "bool".
1611 backwards compatible with the good old Vi commands.
1619 - Comments start with # instead of ", to avoid confusing them with strings.
1621 - Ex command ranges need to be prefixed with a colon, to avoid confusion with
1637 gaining popularity and has similarities with Vim script. It also has a
1646 will be happy with. TypeScript is a complex language with its own history,
1651 People familiar with other languages (Java, Python, etc.) will also find
1662 annoying. Vim recognizes an expression with && or || and allows using the
1686 What we end up with is very similar to Dart: >
1735 text not starting with a number would be converted to zero, which is
1740 used, e.g. with the `:if` command and the `||` operator, only boolean-like
1755 However, this conflicts with only allowing a boolean for a condition.
1776 - The mechanism allows for writing a big, long script with a very clear API: