I know I can change the language of the Vim user interface using :language en_US.UTF-8, but how can I do that using vimscript?

set language=en_US.UTF-8 is invalid, and the Vim documentation says that the v:lang variable cannot be set directly.

  • 4
    :language is Vimscript... Do you mean change it to a value that's in a variable? You can use :execute for that, like :execute "language" mylang where the mylang variable has en_US.UTF-8 or suchlike. – filbranden Sep 1 '19 at 4:38
  • 2
    :language is a command, not a setting. Did you try simply language en_US.UTF-8 (without set and without =)? – Lie Ryan Sep 2 '19 at 3:32

Your Answer

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

Browse other questions tagged or ask your own question.