112

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.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Daren Thomas
  • 67,947
  • 40
  • 154
  • 200
  • On my side, language en always gave me an error when I started gVim. I used language C and it worked like a charm! – ghigad Sep 20 '17 at 15:03

16 Answers16

101

For reference, in Windows (7) I just deleted the directory C:\Program Files (x86)\Vim\vim72\lang. That made it fallback to en_US.

August Lilleaas
  • 54,010
  • 13
  • 102
  • 111
40

Try this in _vimrc. It works with my win7.

set langmenu=en_US
let $LANG = 'en_US'
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
zjk
  • 2,043
  • 3
  • 28
  • 45
36

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.

Luchs
  • 1,133
  • 1
  • 9
  • 10
Aristotle Pagaltzis
  • 112,955
  • 23
  • 98
  • 97
  • 1
    I will have to check this out some more - it is not currently working AFAIR, but will only have access to the machine in question next wednesday. Thank you for your reply. – Daren Thomas Oct 05 '08 at 18:25
  • did not work for me (vim complained it could not find en_US?!) but @August-Lilleaas solution did work! – Stefano Jul 04 '11 at 09:04
  • 17
    On Windows 7 I had to use `gvim --cmd "lang English_United States"` – hfs Apr 03 '12 at 09:14
  • 2
    you can also add `language messages en` in your vimrc (note: it should be in the very beginning). – vorou Aug 10 '13 at 09:24
  • 4
    @hfs Many thanks for your comment. I've added `language English_United States` in my `_vimrc` file and it helped me under VIM 7.4 and Windows 8. – Artyom Aug 12 '13 at 09:59
  • Answer not clear for Unix user (this answer is the top result). – Rémy Hosseinkhan Boucher May 25 '21 at 16:10
18

Putting this line of code at the top of my _vimrc file saved my day:

set langmenu=en_US.UTF-8
Jerska
  • 11,722
  • 4
  • 35
  • 54
Pavel Bastov
  • 6,911
  • 7
  • 39
  • 48
11

This worked for changing vim's menu language

set langmenu=en_US.UTF-8  [or just set langmenu=en for short]

But

language en 

gave me an error sayng it couldn't set en as a language but this line did the job

:let $LANG = 'en'

The latter come from the Vim's docs. I added both lines at the beginning of the _vimrc file. I use a Windows 7 64 computer.

PS: this line changes both language and menus language

language messages en

In the .vimrc file (or _vimrc file if you are in windows)

PerseP
  • 1,177
  • 2
  • 14
  • 22
7

Ubuntu 10.10 + VIM 7.2 IMproved. Code below changes language for console vim. Add it at top of your vim.rc

if has('unix')
    language messages C
else
    language messages en
endif
Anton Orel
  • 576
  • 7
  • 8
6

Adding this to _vimrc works for me in windows 8:

set langmenu=en_US
let $LANG = 'en_US'

(note that _vimrc is in the same directory that contains my vim74 dir, thats the _vimrc file that vim reads at startup)

Ignacio
  • 345
  • 1
  • 4
  • 13
4

:help language

:language fr_FR.ISO_8859-1

Ken
  • 77,016
  • 30
  • 84
  • 101
4

These two lines at the begining of your .vimrc file will do the job:

let $LANG = 'en'
set langmenu=none
Cédric Julien
  • 78,516
  • 15
  • 127
  • 132
Marc
  • 41
  • 1
3

Start vim with a changed locale:

LC_ALL=en_GB.utf-8 vim

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

Armin Ronacher
  • 31,998
  • 13
  • 65
  • 69
3

Two Vim installations on Windows

Nothing from here around have helped me until I have realized that I have 2 Vim installed.

  1. Git Bash via MinGW (Cygwin, mintty)
  2. A separate installation in the Program Files on Windows

Next command will filter you all watched vimrc-files and their locations.

vim --version | grep vimrc
  • _vimrc (Windows & CMD)
  • .vimrc (Bash for Git)
  • vimrc (has different locations for both)

1: Vim on Windows & CMD

Only renaming (deletion) of the lang folder helped me.

You can find it here C:\Program Files (x86)\Vim\vim80\lang

I tried all config settings listed here around and it was useless.

2.1: Git Bash through MinGW, Cygwin, mintty

For Git Bash I added language messages en_US at the top of C:\Program Files\Git\etc\vimrc

Of course, if you prefer to delete the lang folder you can find it here

  • C:\Program Files\Git\usr\share\vim\vim80\lang
  • C:\Users\User_name_xxx\AppData\Local\Programs\Git\usr\share\vim\vim80\lang for a local user installation.

2.2: Tuning only Git's Bash (MinGW64, Cygwin, mintty)

At the end, for Bash on Windows I have chosen to skip manipulations with vimrc

I opened C:\Program Files\Git\etc\bash.bashrc and added the following line

LANG='en_US'

or

LANG=C

Try to do not use en_US.UTF-8 because it forces some bash commands to produce weird chars. For example in find 'xxx_yyy_zzz_aaa.bbbddd' for a non-existing file.

it3xl
  • 2,372
  • 27
  • 37
1

Try adding this to your _vimrc:

let $LANG='en_US'
Lucien
  • 118
  • 1
  • 6
1

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.

HydroKirby
  • 11
  • 2
1

I simply disabled the Native Language Support when installing gvim
(thus making it a custom installation).

'Native Language Support' unchecked.

Tested successfully with gvim82.exe under Windows 7.

Henke
  • 4,445
  • 3
  • 31
  • 44
0

Had similar issue, but neither one of above solution worked: https://superuser.com/questions/552504/vim-ui-language-issue/552523

I've resolved it by removing all vim packets and build vim from sources.

Hope it'll help someone.

Community
  • 1
  • 1
Alexander Paramonov
  • 1,441
  • 14
  • 24
0

If you're on Windows and don't want to be bothered issuing commands

To prevent the GUI from loading localization files

Just go to Program Files\Vim\vim80\lang and put an underscore as a prefix in front of all the files that look like they have something to do with your locale.

To prevent VIM itself from loading localization files

In the same folder as above, prefix with an underscore the folder named with your country code.

Note: Windows 10 will probably ask for Administrator privileges by raising a UAC warning.

By the way

This same technique can be applied to a lot of Unix/Linux tools ported on Windows, and generally all software packages where the localization files can readily be accessed. If you rename those to prevent the application from finding them, the fallback language will most probably be English.

s.m.
  • 7,895
  • 2
  • 38
  • 46