Search notes:

VIM script 9

#  Comments are introduced with a hash symbol (as used to from many other scripting languages)
#
#  Comments must be separated from a command by a whitespace
#
#  In order to refer to the alternate filename, in VIM 9, % (instead of #) must be used.

#  Multi line strings?
echo "To be verified: are
multi line strings possible  
"

# Variable declaration and assignment.
var foo = 40
foo     = foo + 2

# By default, a variable is local to the script or function

# constants
final  bar …
const  baz …

# function definition
def myLittleFunc(txt: string, val: number): string
  …

# calling the function

  # - Without assignment
myLittleFunc('Hello world, '42)

  # - with assignment
x = myLittleFunc('Hello world, '42)


# Dictionary literals
var hash = {num: 42, txt: 'hello world'}

Miscellaneous:

Index