Change menu/ui language of vim to english

10

4

I search on google and I read several answers but I am unable to change the menu/ui language of vim to english.

Im my .vimrc I have

set langmenu=en_US.UTF-8
language messages en_US.UTF-8

but it doesn't work, vim uses the default language of my system.

I tried

set langmenu=none

but it's the same.

locale en_US.UTF-8 is installed.

I am using vim 7.4 on ubuntu.

Thanks for the help.

res1

Posted 2014-04-26T16:03:04.880

Reputation: 344

1I've always used language messages C. – Ingo Karkat – 2014-04-26T18:52:13.773

@IngoKarkat seems to work for the messages but I am still unable to get menu in english, in my opinion vim loads the menu before reading my setting even if they are at the top of my .vimrc and so it uses the default ones – res1 – 2014-04-26T20:21:31.400

Answers

13

My native language is Chinese and I use Windows 7. I tried to do this like you did before, finally I tried to writing the following in _vimrc file and it worked for me.

set langmenu=en_US
let $LANG = 'en_US'
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim

Lanston Wu

Posted 2014-04-26T16:03:04.880

Reputation: 131

7

In case of Gvim it is quite simple to change the language of the gui part of gvim

Go to C:\Program Files (x86)\Vim\vim74\lang
and remove all folders... and restart gvim then it will open in English...

samba8514

Posted 2014-04-26T16:03:04.880

Reputation: 81

2This is not a good suggestion. Even if it works, deleting files is a very dangerous way to achieve what is a simple configuration change: it can lead to instability if it turns out that the files were more important than you thought, and cause problems for upgrades. And it's irreversible: what if the asker decides next week that they prefer vim in some other language? – David Richerby – 2015-06-12T08:26:22.230

1Also, the asker says they're using Ubuntu; the location you suggest exists only on Windows. – David Richerby – 2015-06-12T12:07:18.430

David, Thanks for your comment.. I got the same issue in the Windows machine and I tried it by removing the corresponding folder and it worked... I agreed removing of folder is not a safe way to solve this problem... but this is one of the way to solve the probleam – samba8514 – 2015-08-13T21:26:13.797

3

It works for me to simply add one line

language en_US.utf8

at the top of .vimrc.

Since en_US.utf8 is the output of you $ locale -a command, you should use

language en_US.utf8

instead of

language en_US.UTF-8

heyrict

Posted 2014-04-26T16:03:04.880

Reputation: 31

This one worked for me with Vim 8.x in Cygwin. Thanks – Tomasz W – 2017-09-28T13:04:18.210

2

I've used different settings:

language messages English_United States
set langmenu=en_US.UTF-8  

This worked for me. I added this at the top of _vimrc.

I have Windows 10 in Korean, and gVim 8.0.586

HoJin

Posted 2014-04-26T16:03:04.880

Reputation: 21

1

From :help :language:

Some systems accept aliases like "en" or
"en_US", but some only accept the full specification
like "en_US.ISO_8859-1".  On Unix systems you can use
this command to see what locales are supported:
    :!locale -a

On my Ubuntu machine, I get

$ locale -a
C
C.UTF-8
en_US.utf8
POSIX

So maybe the problem is "utf8" vs. "UTF-8".

From :help 'langmenu':

This option must be set before loading menus, switching on filetype
detection or syntax highlighting.  Once the menus are defined setting
this option has no effect.  But you could do this:
    :source $VIMRUNTIME/delmenu.vim
    :set langmenu=de_DE.ISO_8859-1
    :source $VIMRUNTIME/menu.vim

From the comments, you tried putting it at the top of your vimrc. Perhaps there is a system vimrc file that gets in the way. Check with :version or :scriptnames. If so, then add something like the suggested lines.

benjifisher

Posted 2014-04-26T16:03:04.880

Reputation: 628

0

Did you put your language settings at the beginning of the vimrc? I have encountered once when I put the lang English after some default settings like

source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim

The display of gVim will still be Chinese.

taper

Posted 2014-04-26T16:03:04.880

Reputation: 103

0

On windows it was sufficient for me to just add an environment variable LANG with value en_US.utf8
You can do this with

setx LANG en_US.utf8

or setx /M LANG en_US.utf8 if you want it system wide

user333869

Posted 2014-04-26T16:03:04.880

Reputation: 43

your headline doesn't say anything about the platform thus users on windows looking for the same problem will find your question too. In your text you state about Ubuntu but users seeking a solution for windows are then off topic. I supply an answer here for those. So don't be so selfish to accept only answers for yourself. – user333869 – 2017-07-19T08:36:15.220

Thank you; this is the best answer on Windows. The only other answer that worked for me was deleting the directory for the other language, so that it defaulted to english. – TamaMcGlinn – 2019-11-14T11:07:24.730