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

One of the problems I have come across having complex tasks on the browser
One of the problems I often run into, is that I will include '
[update2] One of those problems I solved & can't remember how... :) [update1] could
I'm having Internet Explorer 6 problems on one of my sites, and I really
This is one of the minor CSS problems that plague me constantly. How do
This is probably one of the most common tasks / problems when programming; You
I'm having some problems displaying the contents of one NSArrayController in two windows defined
Where should one go to be kept updated on all of the security flaws/problems
Drupal Aggregator core module is a useful one but suffers many problems. There are
When writing multithreaded applications, one of the most common problems experienced is race conditions.

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.