When I attempt to set OS specific settings in my .vimrc,

eg:

if MySys() == "Windows"  
    set guifont=Lucida\ Console:h10
endif

I get the error code "E117: Unknown Function: MySys" This happens on both Linux and Windows. On Windows I'm using 7.3, and in Linux I'm using whatever Ubuntu has in their repository (7.2, I believe).

link|improve this question
feedback

2 Answers

up vote 1 down vote accepted

I haven't heard of MySys(), but has("win32") works for me for that purpose.

link|improve this answer
Thanks. That works. There's a 1000 or so hits for "mysys() vimrc" on Google, so I assume this function existed in earlier versions of Vim. – Steve K Sep 22 '10 at 11:30
It looks from those hits like mysys() is just a commonly defined user function. – Karl Bielefeldt Sep 22 '10 at 15:54
1  
Here is an example of how at least one person defines this function, for anyone else's future reference. – Nick Knowlson Mar 31 '11 at 20:38
feedback

MySys looks to be the creation of Amir Salihefendic. His site, amix.dk has a ton of great vim information beyond the simple "move around with hjkl" stuff. It's a great resource.

The post where he defines the MySys() function is here:

fun! MySys()
  return "windows"
endfun

set runtimepath=~/vim_local,$VIMRUNTIME
source ~/vim_local/vimrc
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.