Programing

vim에서 UI 언어를 어떻게 설정합니까?

lottogame 2020. 8. 21. 08:26
반응형

vim에서 UI 언어를 어떻게 설정합니까?


나는 이것을 reddit에서 보았고 , 내 vim 그립 중 하나가 생각 나게했다. 그것은 독일어로 UI를 보여준다 . 젠장, 빔! 나는 영어 를 원하지만 내 OS가 독일어 (우리 사무실의 표준)로 설정되어 있기 때문에 vim이 실제로 도움이 되려고 노력하고있는 것 같습니다.

Vim이 UI 언어를 전환하도록하려면 어떤 마법 주문을 수행해야합니까? 여러 번 인터넷 검색을 시도했지만 답을 찾을 수없는 것 같습니다 (아니요, Google, 당신은 내 친구 * pat *, * pat *이지만 구문 강조 표시를 변경하는 방법을 모두 알고 있습니다. 감사합니다!) ...

편집 : 아래의 모든 좋은 팁을 사용하여 이것을 맨 위에 추가했습니다 .vimrc(Windows 7에서 Vim 7.2 실행).

set langmenu=en_US.UTF-8    " sets the language of the menu (gvim)
language en                 " sets the language of the messages / ui (vim)

Ken이 언급했듯이 명령 이 필요 합니다:language .

당신이를두고 있음을 참고 .vimrc하거나하는 것은 .gvimrc자신의 정의는 매우 초기에 시작시 한 번로드되어 있기 때문에, gvim을의 메뉴와 함께 당신을 도울하고하지 않을 것이다 나중에 다시 다시 읽어. 따라서 실제로 환경에서 설정 LC_ALL(또는 더 구체적으로 LC_MESSAGES)해야합니다. 또는 Unixoid가 아닌 시스템 (예 : Windows)에서 --cmd스위치를 전달할 수 있습니다 ( -c옵션이 아닌 지정된 명령을 먼저 실행 ).

gvim --cmd "lang en_US"

앞서 언급했듯이 LC_ALL컴퓨팅 환경의 모든 측면을 강제로 전환하는 을 사용할 필요가 없습니다 . 더 미묘한 일을 할 수 있습니다. 예를 들어, 내 로케일 설정은 다음과 같습니다.

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

즉, 기본 정렬 순서가 ASCIIbetical (즉, 언어 규칙에 따르지 않고 코드 포인트별로 정렬)이라는 점을 제외하고는 주로 영어 시스템을 사용하지만 문자에 대한 독일어 의미 체계를 사용합니다. 다른 변형을 사용할 수 있습니다. 자세한 내용은 참조하십시오 man 7 locale.


참고로 Windows (7)에서는 방금 디렉토리를 삭제했습니다 C:\Program Files (x86)\Vim\vim72\lang. 그것은 en_US로 대체되었습니다.


_vimrc에서 시도해보십시오. 내 win7에서 작동합니다.

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

이 코드 줄을 _vimrc 파일의 맨 위에 놓으면 하루가 절약되었습니다.

set langmenu=en_US.UTF-8

이것은 vim의 메뉴 언어를 변경하는 데 효과적이었습니다.

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

그러나

language en 

en을 언어로 설정할 수 없다는 오류가 발생했지만이 줄은 작업을 수행했습니다.

:let $LANG = 'en'

후자는 Vim의 문서 에서 가져온 것입니다 . _vimrc 파일의 시작 부분에 두 줄을 모두 추가했습니다. Windows 7 64 컴퓨터를 사용합니다.

추신 :이 줄은 언어와 메뉴 언어를 모두 변경합니다.

language messages en

.vimrc 파일 (또는 Windows 인 경우 _vimrc 파일)


Ubuntu 10.10 + VIM 7.2 IMproved. 아래 코드는 콘솔 vim의 언어를 변경합니다. vim.rc 상단에 추가하십시오.

if has('unix')
    language messages C
else
    language messages en
endif

.vimrc 파일의 시작 부분에있는 다음 두 줄이 작업을 수행합니다.

let $LANG = 'en'
set langmenu=none

변경된 로케일로 vim을 시작하십시오.

LC_ALL=en_GB.utf-8 vim

또는 bashrc / profile의 기본값에 따라 해당 변수를 내 보냅니다.


: 도움말 언어

: 언어 fr_FR.ISO_8859-1


이것을 _vimrc에 추가하면 Windows 8에서 작동합니다.

set langmenu=en_US
let $LANG = 'en_US'

(_vimrc는 내 vim74 디렉토리를 포함하는 동일한 디렉토리에 있습니다. 즉, vim이 시작할 때 읽는 _vimrc 파일입니다)


위의 모든 답변이 왜 저에게 효과가 없었는지 모르겠습니다. 존재하지 않는 로케일에 대한 오류가 계속 발생했습니다. 아마도 그것은 Windows 일 것입니다. 어쨌든 내 해결책은 이것을 내 vimrc에 추가하는 것이 었습니다. let $ LANG = 'en'

아, 너무 빨리 말 했어요. gVim의 메뉴는 여전히 일본어이지만 소개 화면은 영어입니다.


Windows - Two Vim

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

  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 have tried all config settings listed here. It was useless.

2.1: Git Bash through MinGW, Cygwin, mintty

For Git Bash I have 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 next line

LANG='en_US'

or

LANG=C

but not use en_US.UTF-8 because it makes weird chars to some bash commands. For example in `find 'xxx_yyy_zzz_aaa.bbbddd' for non existing file.


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.


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.


Try adding this to your _vimrc:

let $LANG='en_US'

참고URL : https://stackoverflow.com/questions/126853/how-do-i-set-the-ui-language-in-vim

반응형