Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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).

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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

share|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

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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