Vimscript 中是否有获取当前操作系统的命令? [英] Is there a command in Vimscript to get the current Operating System?

查看:20
本文介绍了Vimscript 中是否有获取当前操作系统的命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标题所说的.我可以想到一些骇人听闻的方法来做到这一点,但有没有正确的方法来做到这一点?

What the title says. I can think of some hackish ways to do it, but is there a correct way to do this?

推荐答案

为了检查 Windows,我见过的大多数脚本都使用以下内容:

To check for Windows, most scripts I have seen use the following:

let s:win = has("win16") || has("win32") || has("win64")

如果这些都没有定义,那么它是一个非 Windows 系统,你可以尝试 Martín Fixman.

If none of these are defined, then it is a non-windows system and you can try the uname suggestion by Martín Fixman.

这篇关于Vimscript 中是否有获取当前操作系统的命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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