在 .vimrc 中确定操作系统 [英] Determine operating system in .vimrc

查看:33
本文介绍了在 .vimrc 中确定操作系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在家中在 Linux 上开发,在工作中在 Windows 上开发.我想在两种环境中使用相同的 vimrc 文件.我遇到的问题是,在 Windows 上,我想让编辑器使用 Consolas 字体,而在 linux 上使用不同的字体.如何检查环境以便有条件地设置编辑器字体?(我熟悉更改字体的实际命令;这是我没有得到的条件)

I develop on Linux at home and on Windows at work. I'd like to use the same vimrc file in both environments. The problem I have with this is that on Windows, I want to have the editor use the Consolas font, and on linux, a different font. How can I check the environment so I can conditionally set the editor font? (I am familiar with the actual command to change font; it's the conditional I don't get)

推荐答案

Exception from my .vimrc

Exception from my .vimrc

" adjust configuration for such hostile environment as Windows {{{
if has("win32") || has("win16")
  lang C
  set viminfo='20,\"512,nc:/tmp/_viminfo
  set iskeyword=48-57,65-90,97-122,_,161,163,166,172,177,179,182,188,191,198,202,209,211,230,234,241,243,143,156,159,165,175,185
else
  set shell=/bin/sh
endif
" }}}

这篇关于在 .vimrc 中确定操作系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆