Vim - “E117:未知功能:MySys”


0

当我尝试在.vimrc中设置操作系统特定设置时,

例如:

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

我收到错误代码"E117: Unknown Function: MySys" 这在Linux和Windows上都会发生。在Windows上,我使用的是7.3,而在Linux中,我正在使用Ubuntu在其存储库中的任何内容(7.2,我相信)。

Answers:


1

我没有听说过MySys(),但has("win32")为此目的为我工作。


谢谢。这样可行。Google上的“mysys()vimrc”有1000个左右点击,所以我认为这个功能存在于早期版本的Vim中。
Yewge 2010年

它看起来像那些mysys()只是一个常用的用户函数。
Karl Bielefeldt 2010年

1
以下是至少一个人如何定义此功能的示例,供其他人未来参考。
Nick Knowlson

1

MySys看起来是Amir Salihefendic的创作。他的网站amix.dk除了简单的“hjkl移动”之外还有很多很棒的vim信息。这是一个很好的资源。

他定义MySys()函数的帖子在这里

fun! MySys()
  return "windows"
endfun

set runtimepath=~/vim_local,$VIMRUNTIME
source ~/vim_local/vimrc
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.