Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Set the language of time for the plugin #1

Open
Firef0x opened this issue Aug 18, 2014 · 2 comments
Open

Feature Request: Set the language of time for the plugin #1

Firef0x opened this issue Aug 18, 2014 · 2 comments

Comments

@Firef0x
Copy link

Firef0x commented Aug 18, 2014

Ol谩!

Appreciate you for the fantastic plugin. 馃憤 However, I wonder that if it could provide an option to set the language of time for the plugin. Since the language of time in Vim is set to my mother tongue by my system, which is not en_US, this plugin would update the time in the language of my system. That means, in Vim, the %b which represents the abbreviation of the month, is not Jan, Feb, Mar, and the %Z which represents the abbreviation of the time zone, is not UTC CET WET but the ones in my mother tongue. So I have to set the language time individually in some of my document using :language time en_US.UTF-8

The following is cited from vim74/doc/mlang.txt :

:lan[guage] tim[e] {name}
            With the "time" argument the language used for time
            and date messages is set.  This affects strftime().
            This sets $LC_TIME.
            Without an argument both are set, and additionally
            $LANG is set.

If this plugin could provide an global variable like g:lastmod_lantime, it would be a lot simpler for me to deal with the language of time in different documents. I could put a line of code in vimrc instead of setting the language time again and again.

let g:lastmod_lantime="en_US.UTF-8"

Many thanks and hope for your reply! Hope that it could be implemented!

@jmcantrell
Copy link
Owner

I would think about adding the :language call to your vimrc or possibly an autocmd. It's not really the responsibility of a plugin like this to be setting environment variables.

@Firef0x
Copy link
Author

Firef0x commented Sep 19, 2014

馃槖 馃槴 馃槬 馃様 馃槩 馃樋
Actually I'm not speaking English, but I have to deal with some files which requires totally English like AdBlock Plus rule list.(Which needs Last Modified: field in the head of file)

What's more, some files require totally local language like minutes of meeting.(Which needs to record the time but it's not in Last Modified: field)

I just hope that the plugin could auto switch to English time format when I need to update Last Modified: field in the AdBlock Plus rule list, and fall back to the local language time format when I am editing other file which doesn't have a Last Modified: field.

Hence I just hope the plugin could do sth. like :

let orig_lctime = v:lc_time
let lctime = s:GetAny('lantime')
language time lctime
...
(Update timestamp)
...
language time orig_lctime

Is it a reasonable feature request?

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants