How do I set the UI language in vim?

Viewed 71237

I saw this on reddit, and it reminded me of one of my vim gripes: It shows the UI in German. I want English. But since my OS is set up in German (the standard at our office), I guess vim is actually trying to be helpful.

What magic incantations must I perform to get vim to switch the UI language? I have tried googling on various occasions, but can't seem to find an answer.

16 Answers

As Ken noted, you want the :language command.

Note that putting this in your .vimrc or .gvimrc won’t help you with the menus in gvim, since their definition is loaded once at startup, very early on, and not re-read again later. So you really do need to set LC_ALL (or more specifically LC_MESSAGES) in your environment – or on non-Unixoid systems (eg. Windows), you can pass the --cmd switch (which executes the given command first thing, as opposed to the -c option):

gvim --cmd "lang en_US"

As I mentioned, you don’t need to use LC_ALL, which will forcibly switch all aspects of your computing environment. You can do more nuanced stuff. F.ex., my own locale settings look like this:

LANG=en_US.utf8
LC_CTYPE=de_DE.utf8
LC_COLLATE=C

This means I get a largely English system, but with German semantics for letters, except that the default sort order is ASCIIbetical (ie. sort by codepoint, not according to language conventions). You could use a different variation; see man 7 locale for more.

:help language

:language fr_FR.ISO_8859-1

Start vim with a changed locale:

LC_ALL=en_GB.utf-8 vim

Or export that variable per default in your bashrc/profile.

I don't know why all of the above answers did not work for me. I kept getting errors about the locales not existing. Maybe it's a Windows thing. At any rate, my solution was to add this to my vimrc: let $LANG = 'en'

Ah, I spoke too soon. The menus of gVim are still in Japanese, but the intro screen is in English.

Try adding this to your _vimrc:

let $LANG='en_US'

I simply disabled the native language support upon installation of gvim (thus making it a custom installation).

"Native Language Support" unchecked

Tested successfully with gvim82.exe under Windows 7.

Related