获取 Vim 中设置的当前值 [英] Get current value of a setting in Vim

查看:40
本文介绍了获取 Vim 中设置的当前值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种简单的方法可以找出指定 Vim 设置的当前值?如果我想知道 tabstop 的当前值,我可以运行:

Is there a simple way of finding out the current value of a specified Vim setting? If I want to know the current value of, say tabstop, I can run:

:set tabstop

不传递参数,Vim 会告诉我当前值.这对于许多设置都很好,但对于那些真假的设置都没有好处.例如,如果我想找出expandtab的当前值,运行:

without passing an argument, and Vim will tell me the current value. This is fine for many settings, but it is no good for those that are either true or false. For example, if I want to find out the current value of expandtab, running:

:set expandtab

实际上会启用expandtab.我只是想知道它是否启用.

will actually enable expandtab. I just want to find out if it is enabled or not.

这就是我想要的:

:echo &l:expandtab

但看起来很冗长.有没有更快捷的方法?

but it seems quite verbose. Is there a quicker way?

推荐答案

添加 ?在设置名称后标记,它会显示值

Add a ? mark after the setting name and it will show the value

:set expandtab?

这篇关于获取 Vim 中设置的当前值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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