0

How can I find out the default value of a variable if it is not set? For example, the default timeout for the leader key is controlled by the timeoutlen variable, but if I do:

:echo timeoutlen

I get an "undefined variable" error. Is there any command to find out default values for variables like this?

  • 1
    I believe timeoutlen is an option, not a variable. Read the help on options. Try :set timeoutlen? – D. Ben Knoble Aug 12 '17 at 18:44
1

For options, you can use the special syntax &optionname to echo its value. This is described in the help at :h expr-option

So you would want to do: :echo &timeoutlen

1

You could type :set {option}? to show the value of an option.

If you want to inspect where it was defined:

:verbose set timeoutlen?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.