Basic VimScript¶
Comparisons¶
:set noignorecase
:if "foo" ==? "FOO"
: echom "first"
:elseif "foo" ==? "foo"
: echom "second"
:endif
Vim displays first because ==? is the "case-insensitive no matter what the user has set" comparison operator. Now run the following commands:
Vim displays two because ==# is the "case-sensitive no matter what the user has set" comparison operator.
Enter insert mode via vimscript¶
:h startinsert