2006年11月19日VI的主题安装、判断YYYY-MM-DD正则表达式考虑闰年

        2006年11月19日 星期六 天气阴         Last Modify: Nov 19 2006

==================================================================================

 

今天下载了一个VI的颜色主题

moria : A color scheme for GUI supposed to be highly readable

特点在于关键字在Mix模式下可以为粗体,虽然没有什么意思(因为在暗色模式下关键字已经高亮了),但是还是个有用的尝试。下面是他的安装指南。感觉在VI里缩进文本真是麻烦,不支持鼠标拖放,只能说是写代码的好工具……

 

判断YYYY-MM-DD正则表达式

-----------------------

这里是判断YYYY-MM-DD这种格式的,基本上把闰年和2月等的情况都考虑进去了,不过我已经忘了在哪里找到的。

 

^((((1[6-9]|[2-9]/d)/d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]/d|3[01]))|(((1[6-9]|[2-9]/d)/d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]/d|30))|(((1[6-9]|[2-9]/d)/d{2})-0?2-(0?[1-9]|1/d|2[0-8]))|(((1[6-9]|[2-9]/d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29-))$

 

 

 

下面的是加了时间验证的

 

^((((1[6-9]|[2-9]/d)/d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]/d|3[01]))|(((1[6-9]|[2-9]/d)/d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]/d|30))|(((1[

 

VI的主题安装

-------------------------

install details

 

Just put it in "~/.vim/colors" or in " /vimfiles/colors" on Windows. Do ":colo moria" to apply it. If you want to install it as your default color scheme, just add "colo moria" to your vimrc file.

 

The color scheme choses the color scheme 'dark' if 'background' is set to dark and 'light' if 'background' is set to light. One can override this by setting the variable 'moria_style'. Its possible values are 'black', 'dark', 'darkslategray', 'light', and 'white'. The 'dark' scheme has #202020 as its background, the 'light' scheme #f0f0f0, the 'darkslategray' scheme DarkSlateGray, the 'black' ('white') scheme has a black (white) background. If you want to use the 'white' scheme, just do

 

let moria_style = 'white'

colo moria

 

in your vimrc file. Alternatively, you can set the option 'background' instead of 'moria_style' to 'dark' or 'light' and the color scheme applies either the 'dark' scheme or the 'light' one.

 

In gVim you can do 'Colo black', 'Colo dark', 'Colo darkslategray', 'Colo light', and 'Colo white' to swith to the color scheme you want. In Vim (console version) these commands just swith between a dark and a light scheme.

 

In the dark schemes ('black', 'dark', and 'darkslategray') bold highlights are avoided. However, some people like the highlights 'Statement' and 'Type' to be bold. If you belong to these people, just add

 

let moria_fontface = 'mixed'

 

to your vimrc file (before 'colo moria', of course).

 

        Rev 1.0        Create Document Nov 19 2006

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值