Viml conditionals: Difference between revisions
From wikinotes
No edit summary |
|||
Line 1: | Line 1: | ||
{{ WARNING | | {{ WARNING | | ||
in vim, <code>0</code> is FALSE, and <code>1</code> is TRUE. | in vim, <code>0</code> is FALSE, and <code>1</code> is TRUE. | ||
}} | |||
{{ WARNING | | |||
comparing mis-matching types will return FALSE | |||
}} | }} | ||
Latest revision as of 03:03, 11 February 2023
WARNING:
in vim, 0
is FALSE, and 1
is TRUE.
WARNING:
comparing mis-matching types will return FALSE
If Statements
" If Statement if var == 1 echo var elseif var == 2 || var == 3 echo var else echo var endif" If Not Statement if !(var == 1) echom "var doesn't equal 1" endif" If And Statement if var == 1 && var != 0 echom "condition satisfied endif