打造cygwin
使用过e-texteditor的朋友会发现e在安装过程中会有一个安装cygwin的提示,倘若不安装它,e中很多bundle的功能将无法使用。究其原因,e将cygwin当做了默认的bundle执行环境,因此ruby、python、perl等脚本无法运行。幸运的是,通过简单的bundle环境设置,可以避免这个问题。
那什么是cygwin呢?cygwin其实是一个在windows上运行的linux模拟环境,你可以在上面使用ls、pwd、mkdir等命令,也可以在上面尝试vim、emacs等工具,对于依赖windows却又想体验linux的朋友来说,它未尝不是一个练手的好平台。cygwin的安装较为简单,但要注意几个地方:
-
找一个好的镜像,试过几个国外的,等了几十分钟,结果安装包下载到一半报错退出,让人极其郁闷;
-
倘若你选择全部安装,请做好损失3.3G硬盘空间以及等上几个钟头的心理准备。
安装完之后,在桌面上会自动生成一个快捷方式,双击运行,你会发现,你启动了以前只能在linux下才能看到的bash,以及,一个让人冲动的粗糙界面。还是先静下心来,把cygwin整合到windows上吧。方法很简单,假设你的cygwin安装路径是c:/cygwin,则将c:/cygwin/bin添加到系统变量path中,个人推荐加到windows前,如此对于相同命令,会执行cygwin的命令,而非windows的,譬如find。现在你在cmd下也能使用cygwin的命令了。
只剩下两个问题了:
- 操作界面粗糙得让人无法忍受,包括字体、颜色以及窗体大小;
- 不支持中文。
在中文操作系统里,cygwin的默认字体是新宋体,窗口大小为80x25字符长,未免让人遗憾。以前自己想了个比较笨的解决办法:将系统语言改成英文后,右键点快捷方式属性,在font项选择lucida console字体(至少是程序员偏爱的字体),同时根据自己屏幕大小手动设置layout的window size。呵呵,相信没有人愿意陪我一起犯傻。幸好有puttycyg,让一切都变得简单。puttycyg是putty的增强版本,可作为windows下免费的telnet、rlogin和ssh客户端,也同时具有充当本地cygwin终端的能力。在puttycyg下可以自定义界面样式,包括字体样式、颜色、大小的定义和全屏显示。运行putty,在window的appearance下修改字体,同时将script改成chinese gb2312(为putty支持中文输入作准备),之后回到session,在command框中写入“-”,connection type选为cygterm,对session命名,保存,之后为putty创建快捷方式,右键点击快捷方式,在shortcut下修改target,加入-load [你的session名](中括号不需要)。以后双击putty快捷方式,你就能马上进入自己定义的cygwin界面了。
接下来解决cygwin中文支持的问题。修改cygwin/home/[你的用户名]下的.inputrc和.bashrc文件:在.inputrc中加入
set convert-meta off
set input-meta on
set output-meta on
set completion-ignore-case on
在.bashrc中加入
export export LC_CTYPE=zh_CN.UTF-8
export LANG=zh_CN.UTF-8
stty cs8 -istrip
stty pass8
export LESSCHARSET=latin1
alias ls='ls -hF --color=tty --show-control-chars'
alias dir='ls --color=auto --format=vertical'
alias vdir='ls --color=auto --format=long'
重启cygwin,键入中文,显示正常,一切ok。
Aug 19, 2009 08:21:54 PM
好牛B啊~~第一个comments。。。
Oct 21, 2010 06:29:56 AM
老问题,新解答。。export LC_TYPE那些不用zh_CN用en_US.UTF-8也可以的。。
Apr 09, 2022 07:07:16 PM
This blog is so nice to me. I will keep on coming here again and again. Visit my link as well.. 온라인카지노
May 03, 2022 04:45:09 AM
You are so cool man, the post on your blogs are super great . how to sell payment processing services
====================================================
The secrets of why News and why it means a lot. Merchant Service Commission
Feb 18, 2025 04:04:58 PM
Great sites are not planned medium-term. Great sites aren't made in a quick. Great sites require significant investment, determination, arranging, an astounding background of bearing, notwithstanding the main point
Feb 18, 2025 04:44:47 PM
This blog post is excellent! The ideas are easy to understand, and the personal examples make it relatable. Thank you for sharing your knowledge in such a thoughtful way. I can’t wait to see what you write next!
Feb 18, 2025 04:46:08 PM
Great post full of useful tips! My site is fairly new and I am also having a hard time getting my readers to leave comments. Analytics shows they are coming to the site but I have a feeling “nobody wants to be first”
Feb 18, 2025 04:59:42 PM
Thank you for the sensible critique. Me and my neighbor were just preparing to do a little research about this. We got a grab a book from our area library but I think I learned more from this post. I’m very glad to see such excellent information being shared freely out there.
Feb 18, 2025 05:09:15 PM
I thought I’d post to let you know. The layout look great though! Hope you get the issue resolved soon. Thanks
Feb 18, 2025 05:10:29 PM
Excellent read, I just passed this onto a friend who was doing some research on that. And he actually bought me lunch because I found it for him smile Thus let me rephrase that: Thanks for lunch!
Feb 18, 2025 05:27:00 PM
Hey There. I found your blog using msn. This is an extremely well written article. I will be sure to bookmark it and come back to read more of your useful information. Thanks for the post. I’ll certainly return.
Feb 18, 2025 05:27:51 PM
Wow, this article is exactly what I needed! You explained everything straightforwardly, even for someone like me who’s new to this subject. I appreciate the way you broke down complex points into smaller, digestible parts.
Feb 18, 2025 05:28:11 PM
Thank you for the sensible critique. Me and my neighbor were just preparing to do a little research about this. We got a grab a book from our area library but I think I learned more from this post. I’m very glad to see such excellent information being shared freely out there.
Feb 18, 2025 05:28:32 PM
What an excellent post! You’ve explained everything so clearly and with such engaging detail. The practical tips and examples make it so easy to apply what you’ve shared. I really appreciate content that both educates and inspires, and this post does just that. I’ll definitely refer back to it when needed. Keep up the great work, and thank you for sharing your insights. I look forward to reading more from you!
Feb 18, 2025 05:28:39 PM
Excellent post. I used to be checking constantly this weblog and I’m impressed! Very helpful info particularly the remaining part.I maintain such information much. I was looking for this certain info for a very lengthy time. Thanks and good luck.
Feb 18, 2025 05:28:55 PM
Hey There. I found your blog using msn. This is an extremely well written article. I will be sure to bookmark it and come back to read more of your useful information. Thanks for the post. I’ll certainly return.
Feb 18, 2025 05:29:13 PM
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info.i never know the use of adobe shadow until i saw this post. thank you for this! this is very helpful.
Feb 18, 2025 05:29:38 PM
Thanks a bunch for sharing this with all of us you actually know what you’re talking about! Bookmarked. Kindly also visit my website =). We could have a link exchange agreement between us!
Feb 18, 2025 05:30:05 PM
First You got a great blog .I will be interested in more similar topics. i see you got really very useful topics, i will be always checking your blog thanks
Feb 18, 2025 05:38:15 PM
Thanks for sharing nice information with us. i like your post and all you share with us is uptodate and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job
Feb 18, 2025 05:39:15 PM
Thank you so much for giving everyone an exceptionally superb possiblity to read critical reviews from here. It is always so terrific plus stuffed with a great time for me personally and my office friends to search your website at the least 3 times per week to read through the fresh issues you have. And of course, we’re usually satisfied with the outstanding points you give. Selected 4 facts on this page are basically the most impressive we have all had.
Feb 18, 2025 05:40:08 PM
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info.i never know the use of adobe shadow until i saw this post. thank you for this! this is very helpful.
Feb 18, 2025 05:40:53 PM
Hey There. I found your blog using msn. This is an extremely well written article. I will be sure to bookmark it and come back to read more of your useful information. Thanks for the post. I’ll certainly return.
Feb 18, 2025 05:42:03 PM
Hello! This is my 1st comment here so I just wanted to give a quick shout out and say I genuinely enjoy reading through your posts. Can you suggest any other blogs/websites/forums that deal with the same subjects? Appreciate it!
Feb 18, 2025 05:42:17 PM
Your post was so encouraging and insightful! I really appreciate how you combine motivation with actionable advice, making it easy to connect with your message. The way you break things down into simple steps makes everything feel possible. I can already see how I can apply your tips in my own life. Thank you for sharing such valuable content that’s both inspiring and practical. I’m excited to put your advice into action and see where it takes me. Can’t wait to read your next post and see what else you have in store for us!
Feb 18, 2025 05:43:03 PM
This blog post is excellent! The ideas are easy to understand, and the personal examples make it relatable. Thank you for sharing your knowledge in such a thoughtful way. I can’t wait to see what you write next!
Feb 18, 2025 05:44:13 PM
This blog post is excellent! The ideas are easy to understand, and the personal examples make it relatable. Thank you for sharing your knowledge in such a thoughtful way. I can’t wait to see what you write next!
Feb 18, 2025 05:44:33 PM
Hey There. I found your blog using msn. This is an extremely well written article. I will be sure to bookmark it and come back to read more of your useful information. Thanks for the post. I’ll certainly return.
Mar 06, 2025 05:38:07 PM
First You got a great blog .I will be interested in more similar topics. i see you got really very useful topics, i will be always checking your blog thanks