Lines Matching refs:can

33 compatibility.  That means bad choices from the past often can't be changed
38 accomplished by compiling commands into instructions that can be efficiently
39 executed. An increase in execution speed of 10 to 100 times can be expected.
44 The performance improvements can only be achieved by not being 100% backwards
57 the highest |scriptversion|. However, this can be confusing and is therefore
60 Vim9 script and legacy Vim script can be mixed. There is no requirement to
95 - Constants can be declared with `:final` and `:const`: >
109 - Executing a register with "@r" does not work, you can prepend a colon or use
122 The reason is that a double quote can also be the start of a string. In many
124 to tell what the meaning is, since both a string and a comment can be followed
128 In Vi # is a command to list text with numbers. In Vim9 script you can use
139 these can be used to start a fold.
160 reference (so that the argument and return types can be checked)
165 created yet. In this case you can call `execute()` to invoke it at runtime. >
173 cannot be a "dict" function, and can always be a closure.
183 You can call a legacy dict function though: >
192 The argument types and return type need to be specified. The "any" type can
215 The argument "_" (an underscore) can be used to ignore the argument. This is
249 Since a script-local function reference can be used without "s:" the name must
252 "funcref". In Vim9 script it can, therefore "s:Funcref" must be used to avoid
259 The result is that functions and variables without a namespace can usually be
263 Global functions can still be defined and deleted at nearly any time. In
269 You can use an autoload function if needed, or call a legacy function and have
301 Variables can be local to a script, function or code block: >
328 To intentionally hide a variable from code that follows, a block can be
360 variables, because they are not really declared. They can also be deleted
379 Global functions must be prefixed with "g:" when defining them, but can be
389 Although global functions can be called without the "g:" prefix, they must
390 exist when compiled. By adding the "g:" prefix the function can be defined
406 You can use exists_compiled() to avoid the error, but then the function would
417 For an unpack assignment the underscore can be used to ignore a list item,
418 similar to how a function argument can be ignored: >
434 can't be assigned another value a constant. JavaScript is an example. Others
436 cannot be changed. In Vim9 we can use both.
446 `:final` is used for making only the variable a constant, the value can be
466 Functions can be called without `:call`: >
471 identifier or can't be an Ex command. For a function either "(" or "->" must
495 Note that while variables need to be defined before they can be used,
496 functions can be called before being defined. This is required to allow
504 A user defined function can be used as a function reference in an expression
511 number of arguments and any return type (including void). The function can be
517 In legacy script there can be confusion between using "->" for a method call
527 "=>" (so that Vim can tell the difference between an expression in parentheses
537 But you can use a backslash to concatenate the lines before parsing: >
551 Additionally, a lambda can contain statements in {}: >
556 This can be useful for a timer, for example: >
564 The ending "}" must be at the start of a line. It can be followed by other
569 No command can follow the "{", only a comment can be used there.
572 the commands to find it. For consistency with that no command can follow the
649 splitting up a long Ex command, comments can start with '#\ ': >
787 In case the key needs to be an expression, square brackets can be used, just
791 The key type can be string, number, bool or float. Other types result in an
792 error. A number can be given with and without the []: >
801 Instead of `:x` or `:xit` you can use `:exit`.
802 Instead of `:t` you can use `:copy`.
803 Instead of `:k` you can use `:mark`.
814 following lines. This can lead to a long sequence of errors and need to type
888 result is a boolean. "!!" can be used to turn any value into boolean: >
899 can be used.
901 In Vim9 script one can use "true" for v:true, "false" for v:false and "null"
943 Some Ex commands can be confused with assignments in Vim9 script: >
962 can bail out, and the following lines are not parsed: >
994 The `exists_compiled()` function can also be used for this.
1074 later in Vim9 script. They can only be removed by
1085 variables can be accessed without the "s:" prefix. They must be defined
1099 can prepend "s:" to find script-local functions.
1125 For these the backtick expansion can be used. Example: >
1131 Or a script variable can be used: >
1186 These types can be used in declarations, but no simple value will actually
1193 A partial and function can be declared in more or less specific ways:
1222 The reference can also be a |Partial|, in which case it stores extra arguments
1226 Custom types can be defined with `:type`: >
1232 And classes and interfaces can be used as types: >
1255 value can be changed at any time, possibly changing the type. Therefore, in
1258 This can be a problem when the "any" type is undesired and the actual type is
1282 In general: Whenever the type is clear it can be omitted. For example, when
1333 If the item type was determined to be "any" it can change to a more specific
1350 A Vim9 script can be written to be imported. This means that everything in
1352 items, can then be imported in another script.
1354 You can cheat by using the global namespace explicitly. We will assume here
1360 To recognize a file that can be imported the `vim9script` statement must
1373 In Vim9 script the global "g:" namespace can still be used as before. And the
1375 declared and they can be deleted.
1397 This can only work in two ways:
1409 Exporting an item can be written as: >
1418 As this suggests, only constants, variables, `:def` functions and classes can
1422 `:export` can only be used in Vim9 script, at the script level.
1427 The exported items can be imported individually in another Vim9 script: >
1434 In case the name is ambiguous, another name can be specified: >
1441 Then you can use "That.EXPORTED_CONST", "That.someValue", etc. You are free
1446 `:import` can also be used in legacy Vim script. The imported items still
1449 `:import` can not be used in a function. Imported items are intended to exist
1452 The script name after `import` can be:
1468 `import` won't be processed yet. Therefore cyclic imports can exist, but may
1481 < This goes in .../plugin/anyname.vim. "anyname.vim" can be freely chosen.
1483 2. In the autoload script do the actual work. You can import items from
1517 Most of Vim9 script can be created without this functionality, and since
1519 For now we'll just make sure classes can be added later.
1594 number" instruction can be used, which is faster. The error can be given at
1610 We can also remove clutter, mainly things that were done to make Vim script
1622 expressions (single quote can be a string or a mark, "/" can be divide or a
1639 typing (a variable can have different types, this changes at runtime). Since
1645 just want to take those parts that we can use for Vim and we expect Vim users
1660 - TypeScript can use an expression like "99 || 'yes'" in a condition, but
1661 cannot assign the value to a boolean. That is inconsistent and can be
1668 since a type cast can remove the immutable nature. Vim locks the value,
1682 immutable we decided to use that. And then `:const` can be used for making
1718 Since we use type inference the type can be left out when it can be inferred
1732 Some details are unexpected and can be improved. For example a boolean
1758 Here you can explicitly express your intention to use the value as-is and not
1778 - By using relative paths loading can be much faster for an import inside of a
1780 - Once an import has been used, it can be cached and loading it again can be
1782 - The Vim-specific use of "s:" to make things script-local can be dropped.
1785 globally can be used, not the exported items. Alternatives considered:
1793 Note that you can also use `:import` in legacy Vim script, see above.
1801 The functions can't be compiled right away when encountered, because there may
1831 channels. We can try to make this easier somehow.
1843 dictionary. With some care this can be made to work, but it does not look