Daren Thomas
Daren Thomas

Reputation: 70324

How do I set the UI language in vim?

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.

Upvotes: 112

Views: 79198

Answers (16)

Martin Borchert
Martin Borchert

Reputation: 21

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.

Upvotes: 1

it3xl
it3xl

Reputation: 2672

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.

Upvotes: 3

Lucien
Lucien

Reputation: 156

Try adding this to your _vimrc:

let $LANG='en_US'

Upvotes: 1

Pavel Bastov
Pavel Bastov

Reputation: 6971

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

set langmenu=en_US.UTF-8

Upvotes: 18

s.m.
s.m.

Reputation: 8043

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.

Upvotes: 0

Ignacio
Ignacio

Reputation: 345

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)

Upvotes: 6

PerseP
PerseP

Reputation: 1197

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)

Upvotes: 12

Alexander Paramonov
Alexander Paramonov

Reputation: 1501

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.

Upvotes: 0

Marc
Marc

Reputation: 41

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

let $LANG = 'en'
set langmenu=none

Upvotes: 4

Aristotle Pagaltzis
Aristotle Pagaltzis

Reputation: 117969

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.

Upvotes: 36

zjk
zjk

Reputation: 2163

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

Upvotes: 43

Anton Orel
Anton Orel

Reputation: 576

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

Upvotes: 7

HydroKirby
HydroKirby

Reputation: 11

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.

Upvotes: 1

August Lilleaas
August Lilleaas

Reputation: 54593

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

Upvotes: 101

Ken
Ken

Reputation: 78852

:help language

:language fr_FR.ISO_8859-1

Upvotes: 4

Armin Ronacher
Armin Ronacher

Reputation: 32533

Start vim with a changed locale:

LC_ALL=en_GB.utf-8 vim

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

Upvotes: 3

Related Questions