map()mutates the collection in place; if you want to avoid this you have to make a copy first.
'some string' == 0evaluates to true (
'some string' && 1evaluates to false (
- Both of the preceding results are explained because all strings convert to the number 0 (ie.
0); despite this,
'foo'is truthy and
- Line-continuation markers (
\) occur at the beginning of the continuation instead of the end of the continued line, unlike every other language.
- There are no implicit line-continuations (ie. you cannot split a long list over multiple lines after the commas; you have to use explicit line-continuation markers).
- Lists and dictionaries do not permit optional trailing commas after the last item, unlike many other languages.
- Output captured with
redirwill include wrapping (ie. newlines) based on how wide the screen was at runtime.
echoerraborts the current function, leading Vim to "not see" any pending
:endifconstructs and complain of
E171: Missing :endif; if you just want to append to the
&modifier (described in
:h :s_flags) is supposedly for applying the flags from the "previous substitute command", but "previous" doesn’t mean "most recently executed" but rather "last seen in file, even if seen inside an
ifblock body that wasn’t executed because its conditional was false".
- Many types cannot be coerced: for example, given a function
Foothat may return a Dictionary or nothing, you cannot do
if Foo()without getting the error
E728: Using a Dictionary as a Number; instead you have to do
if type(Foo()) == 4.
- Function naming is inconsistent: for example you have
deepcopy(), but also
- Despite its name
<sfile>means something completely different when evaluated inside a function.