如果您不给:colorscheme
一个参数,那么它将显示vim当前正在使用的colorcheme的名称。 vim中是否有类似的方法显示是否设置了选项,或者如果它不是 bool(boolean) 值,则显示选项的值是什么?例如,如果我想知道是否设置了autoindent
或想知道textwidth
的值,我将如何找到它?
最佳答案
使用:set
命令。
:set autoindent?
打印选项及其值(如果有)。 Vim切换选项( bool(boolean) 值,打开/关闭的选项),例如autoindent
,都以no
前缀,以表明它们已关闭,因此:set autoindent?
将显示autoindent
或noautoindent
。 :set autoindent
打开autoindent
。:set textwidth
也将打印选项的值。对于数字或字符串选项,:set option
与:set option?
等效。 :set autoindent!
反转选项。 autoindent
变为noautoindent
。 :set autoindent&
将autoindent
还原为其默认值。 :set option=value
设置数字或字符串选项,例如set tabstop=3