osx - Is autocmd always called in a vimrc? -
i have in .vimrc
:
fun! mysys() if has('win16') || has('win32') || has('win64') return "win" endif endfun
and in .gvimrc:
if mysys() == "win" autocmd guienter * simalt ~ x " start maximized" endif
for reason, autocmd being called when open macvim in mac workstation. shouldn't because i'm on mac , autocmd inside win if.
what problem can be?
the reason you're doing strange comparison.
the mysys()
function return 1
if you're on windows , 0
if you're not. you're comparing 0
"win", (for reasons don't understand) produces match.
how changing this:
fun! mysys() if has('win16') || has('win32') || has('win64') return "win" elseif has('mac') || has('maxunix') return "mac" elseif has("unix") || has("win32unix") " unix or cygwin (which acts unix) return "unix" else return "other" endif endfun
(untested)
Comments
Post a Comment