开发者

Can you query what a variable/setting in vim is set to?

开发者 https://www.devze.com 2023-02-17 10:58 出处:网络
For example, in vim, if I want to know if autoread is set or not, is there a command I can run to tell me?Or to k开发者_运维百科now what my tabstop is set to?In your case, :set autoread? will give you

For example, in vim, if I want to know if autoread is set or not, is there a command I can run to tell me? Or to k开发者_运维百科now what my tabstop is set to?


In your case, :set autoread? will give you the current value of autoread. Generally, set foo? will give you the value of option foo.

:set will display all options that are different from default.


:verbose set autoread? will tell you what set autoread and its value.


You can also do, for example,

echo &ft

The & refers to the contents of the variable. I find this useful in scripts.


You can view settings in vim with this command

:set all
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号