Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3214786
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:06:06+00:00 2026-05-17T15:06:06+00:00

One of my problems when creating a portable .vimrc is with locales. Let’s say

  • 0

One of my problems when creating a portable .vimrc is with locales. Let’s say I always want to use English language for messages. Depending on OS and Vim version, the command needed may be lang messages en, lang messages en_US, lang messages English_US, etc. Now, I can do this:

try
  lang messages en
catch
  try
    lang messages en_US
  catch
    try
      lang messages English_US
    catch
      ...
    endtry
  endtry
endtry

but is there a simpler way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T15:06:07+00:00Added an answer on May 17, 2026 at 3:06 pm

    According to the vim help, you can use let $LANG="en", so at least the following works (note that --cmd is executed before vimrc):

    vim --cmd 'let $LANG="en"'
    

    , but this produces the following error:

    perl: warning: Setting locale failed.
    perl: warning: Please check that your locale settings:
            LANGUAGE = "",
            LC_ALL = (unset),
            LANG = "en"
        are supported and installed on your system.
    perl: warning: Falling back to the standard locale ("C").
    

    , so this works only for english language (since C locale is english).

    You can also use execute:

    for s:lang in ["en", "en_US", "en_US.UTF-8", "English_US"]
        try
            execute 'language messages '.s:lang
            break
        catch /^Vim(language):E197:/
            " Do nothing
        endtry
    endfor
    unlet s:lang
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating multiple associations in one go and there are a few problems
I'm dealing with this problem. I'm creating math problems, each one has response. For
Why is the use of the on and off macro creating problems. I am
One of our users is experiencing problems creating their own personal views in CRM
I am having problems creating a table in python. Basically I want to build
I'm creating shopping cart and I'm having one problem: When someone orders an item
I'm creating a blog engine as a learning exercise and one particular problem has
im doing some practice sql problems one of the questions is: Prepare a shipping
We have some performance problems with one of our applications. I thought about using
Are there any concurrency problems with one thread reading from one index of an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.