跳至内容
Python 俱乐部
用户工具
登录
站点工具
搜索
工具
显示页面
修订记录
反向链接
最近更改
媒体管理器
网站地图
登录
>
最近更改
媒体管理器
网站地图
您的足迹:
linux:vim:gui-mode
本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。
====== 判断当前是VIM还是GVIM模式 ====== ===== 方法一 ===== If Vim is running in GUI mode, or if it is in startup and knows that GUI mode will be started at the end of startup, has('gui_running') returns 1 (i.e. TRUE). Otherwise it returns 0 (i.e. FALSE). You can test this (unless running on a Vim without arithmetic evaluation) with <code> if has('gui_running') " gvim-only stuff else " non-gvim stuff endif </code> 或者 <code> if !has('gui_running') " this won't be done when staying in console mode endif </code> ==== 参考 ==== * :help has() * :help feature-list * :help no-eval-feature ===== 方法二 ===== Whenever the GUI is started (be it during startup, or, on a Unix Vim, by executing the :gui command at any time), your gvimrc is sourced and (provided, of course, that autocommands are compiled-in) the GUIEnter autocommand event is triggered. Neither happens if Vim runs in console mode. ==== 参考 ==== * :help gui.txt * :help GUIEnter
linux/vim/gui-mode.txt
· 最后更改: 2011/03/29 09:19 (外部编辑)
页面工具
显示页面
修订记录
反向链接
回到顶部