﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-网摘-文章分类- Something</title><link>http://www.blogjava.net/jvict/category/34574.html</link><description /><language>zh-cn</language><lastBuildDate>Mon, 18 Jan 2010 14:48:47 GMT</lastBuildDate><pubDate>Mon, 18 Jan 2010 14:48:47 GMT</pubDate><ttl>60</ttl><item><title>FreeBSD 8 mysql apache php java整合</title><link>http://www.blogjava.net/jvict/articles/309446.html</link><dc:creator>Documents</dc:creator><author>Documents</author><pubDate>Thu, 14 Jan 2010 05:47:00 GMT</pubDate><guid>http://www.blogjava.net/jvict/articles/309446.html</guid><wfw:comment>http://www.blogjava.net/jvict/comments/309446.html</wfw:comment><comments>http://www.blogjava.net/jvict/articles/309446.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jvict/comments/commentRss/309446.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jvict/services/trackbacks/309446.html</trackback:ping><description><![CDATA[<strong>1.下载安装FreeBSD 8，ＤＶＤ１<br />
2.安装mysql 5 - 利用ports安装<br />
</strong><font size="2">cd /usr/ports/databases/mysql50-server/ <br />
make install clean # n长的编译过程 <br />
rehash <br />
mysql_install_db --user=mysql <br />
chown -R mysql /var/db/mysql/<br />
chgrp -R mysql /var/db/mysql/<br />
/usr/local/bin/mysqld_safe -user=mysql &amp;<br />
<br />
mysqld_safe－－MySQL服务器启动脚本 <br />
mysqld_safe是在Unix或是NetWare系统推荐使用来启动MySQL服务器的方法。mysqld_safe添加了许多安全的特征，例如，当发生错误时重新启动服务器，并且可以将运行时的信息写入错误日志文件<br />
<br />
<li>The port installation will put a script file mysql-server.sh<br />
in /usr/local/etc/rc.d which will has capability to start MySQL server.<br />
To enable MySQL server to start automatically after every FreeBSD<br />
server reboot, enter the following command in CLI:
<p><span style="color: red">echo &#8216;mysql_enable=&#8221;YES&#8221;&#8216; &gt;&gt; /etc/ rc.conf<br />
</span></p>
<p>mysqladmin -u root password newpassword (改变root帐户密码）<br />
</p>
<li>MySQL 5.0 installation done. <br />
------------------------------------------------------------------------<br />
<strong>3.安装 Apache Web Server 2.2<br />
</strong>Install Apache HTTP Server 2.20 by using FreeBSD Ports Collection: <br />
cd /usr/ports/www/apache22<br />
make install clean<br />
<li>A Apache HTTP Server script apache22.sh is located at<br />
/usr/local/etc/rc.d to provide Apache HTTP Server start and shutdown <font color="#333333">.</font> <br />
service. To enable Apache web server to automatically starts whenever<br />
after server reboots, issue the following command at CLI: <br />
<span style="color: red">echo &#8216;apache22_enable =&#8221;YES&#8221;&#8216; &gt;&gt; /etc/ rc.conf<br />
</span>
<li>To start Apache HTTP web server immediately, use: <br />
/usr/local/sbin/apachectl start<br />
or<br />
/usr/local/etc/rc.d/apache22.sh start<br />
<li>Apache installation finished. <br />
<br />
<strong>4.Installing PHP Hypertext Preprocessor Scripting Language 5 and PHP 5 Extensions<br />
</strong>
<li>Install by enter the following commands on FreeBSD OS command line,<br />
wait for previous command to finish before running the next command: cd /usr/ports/lang/php5<br />
make install clean<br />
<li>If you&#8217;re prompted, select &#8220;use Apache 2.x instead&#8221;. <br />
<li>Continue with the following commands to install PHP5 extensions and modules to enable the support of the modules in Apache: <br />
cd /usr/ports/lang/php5-extensions </font>make config<br />
<li>At Options for php5-extension 1.0 menu, select all PHP<br />
extensions and modules that you may use with Apache webserver. This is<br />
a part of the configuration for PHP, where you need to enable features<br />
of PHP that come in modules, such as ability to manage user sessions,<br />
interface with databases and many others. Default extensions such as<br />
ctype functions support, HASH Message Digest Framework support, session<br />
support and etc have been selected. Other popular extensions that you<br />
most likely to be in used are MySQL database support and GD library<br />
support. Use space bar to select or unselect the extensions and press<br />
Enter when done.
<li>Continue the installation of php5-extensions with the following commands: <br />
make install clean<br />
<li>If there are any message the pops up and prompts you to select<br />
some options or configurations, you can just accept the default<br />
settings by pressing Enter. Some modules that may prompt you for action&nbsp; <br />
include php5-gd, php5-mbstring and php5-sqlite.
<li>Edit the Apache configuration file in order to enable Apache web server to load the PHP modules when initialization: <br />
<li>Go to Apache configuration file location by cd /usr/local/etc/apache2/ <br />
<li>Edit Apache configuration file by vi httpd.conf <br />
<li>Search for LoadModule lines, after the last LoadModule line, but within the same section, add the following 2 lines: <br />
AddType application/x- httpd-php .php<br />
AddType application/x- httpd-php-source .phps<br />
<li>Optionally, copy /usr/local/etc/php.ini-recommended or<br />
/usr/local/etc/php.ini-dist to /usr/local/etc/php.ini (in same<br />
directory), which will enable you to tune and change the default<br />
settings of behaviours of PHP.
<li>Start the Apache HTTP web server by using apachectl start<br />
(or restart Apache HTTP web server by using apachectl restart).<br />
apachectl is located in /usr/local/sbin, if you encounter Command not<br />
found problem, try to change directory to its location.
<li>PHP5 installation done. <font color="#333333">。</font> <br />
A web server has been setup with the FreeBSD with Apache, MySQL and<br />
PHP. The document root of the web server (where you should put your<br />
HTML and PHP files is at /usr/local/www/apache22/data/ and you will<br />
need a SecureFTP (SFTP) client such as WinSCP to upload your files to<br />
web server securely.
<p><br />
<strong>5.安装php后若apache不能启动：<br />
</strong>在 FreeBSD 下安装 apache22 会出现类似的 warming:<br />
No such file or directory: Failed to enable the 'httpready' Accept Filter</p>
<p>解决方案：<br />
#kldload accf_http并在 /boot/defaults/loader.conf 中加入下面 2 行，以便下次启动自动装载模块<br />
accf_data_load="YES"<br />
accf_http_load="YES"<br />
<br />
<strong>问题</strong><br />
[root@freebsd ~]# apachectl -t<br />
httpd: Could not reliably determine the server's fully qualified domain name, using freebsd.web for ServerName</p>
<p>解决方案：<br />
vi /usr/local/etc/apache22/httpd.conf<br />
添加这么一行：<span style="color: red">ServerName 127.0.0.1:80</span></p>
</li>
<img src ="http://www.blogjava.net/jvict/aggbug/309446.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jvict/" target="_blank">Documents</a> 2010-01-14 13:47 <a href="http://www.blogjava.net/jvict/articles/309446.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Cent OS OpenJava 1.6 Apache 2.x Tomcat 6.x JK-1.2.28(Apache Tomcat Connectors )整合</title><link>http://www.blogjava.net/jvict/articles/309345.html</link><dc:creator>Documents</dc:creator><author>Documents</author><pubDate>Wed, 13 Jan 2010 10:32:00 GMT</pubDate><guid>http://www.blogjava.net/jvict/articles/309345.html</guid><wfw:comment>http://www.blogjava.net/jvict/comments/309345.html</wfw:comment><comments>http://www.blogjava.net/jvict/articles/309345.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jvict/comments/commentRss/309345.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jvict/services/trackbacks/309345.html</trackback:ping><description><![CDATA[<strong>问题：当从apache 2.2.14换成apache 2.2.3时，已配好的jsp环境无法正常运行，mod_jk.so不能使用<br />
</strong>&nbsp;&nbsp;&nbsp;<span style="color: #0000ff">重新用yum 安装了httpd-devel套件生成了apxs后，重新对tomcat-connector源程序进行make clean,.configurage,make,make install后用新生成的mod_jk.so即可正常。当系统增加虚拟主机后，httpd.conf配置文件也要进行相应改变。下面有详细说明。</span><br />
<strong>1.下载解压&nbsp;Apache安装至 /usr/local/apache<br />
2.下载解压tomcat安装至 /usr/local/tomcat<br />
3.下载JK-1.2.28源文件(Apache Tomcat Connectors ) 在Tomcat官网界面上有相应连接<br />
4. 编译JK-1.2.28<br />
</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;进入native目录<br />
　　./configure -with-apxs=/home2/local/apache/bin/apxs<br />
　　make<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cp ./apache-2.0/mod_jk.so /usr/local/apache/modules<br />
<strong>5.修改apache配置文件httpd.conf<br />
</strong>#增加index.jsp&nbsp;&nbsp;&nbsp;&nbsp;<br />
&lt;IfModule dir_module&gt;<br />
&nbsp;&nbsp;&nbsp; DirectoryIndex index.html index.php index.jsp<br />
&lt;/IfModule&gt;<br />
<br />
<p>LoadModule jk_module&nbsp;&nbsp;&nbsp; modules/mod_jk.so<br />
<br />
JkWorkersFile /usr/local/apache/conf/workers.properties<br />
JkLogFile&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/apache/logs/mod_jk.log<br />
JkLogLevel&nbsp;&nbsp;&nbsp; info<br />
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "<br />
JkMount /*.jsp worker1<br />
JkMount /*.do worker1 // 此项为配置servlet, 在web.xml中可自由配置路径如<span style="color: red">：&lt;url-pattern&gt;/servlet/login&lt;/url-pattern&gt;<br />
</span>// 此时不宜配置成/*, 否则将会屏蔽掉php等其它脚本解析。<br />
<br />
# 以下两项可以省略不要<br />
#JkMount /servlet/* worker1<br />
#JkMount&nbsp; /*.do* worker1<br />
<br />
<span style="color: red"><strong>如果存在虚拟主机，需要进行单独配置，如下所示：<br />
</strong><span style="color: #000000">&lt;VirtualHost *:80&gt;<br />
&nbsp;&nbsp;&nbsp; DocumentRoot /var/www/html/<br />
&nbsp;&nbsp;&nbsp; ServerName&nbsp;<a href="http://www.example.com/">www.example.com</a><br />
&nbsp;&nbsp;&nbsp; ServerAlias&nbsp;example.com<br />
&nbsp;<span style="color: #0000ff">&nbsp;&nbsp; &lt;Location "/*.jsp"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JkMount worker1<br />
&nbsp;&nbsp;&nbsp; &lt;/Location&gt;<br />
</span>&lt;/VirtualHost&gt;<br />
</span></span><br />
<br />
<strong>6. 在apache/conf中增加workers.properties</strong><br />
# Define 1 real worker using ajp13<br />
worker.list=worker1</p>
<p># Set properties for worker1 (ajp13)<br />
worker.worker1.type=ajp13<br />
worker.worker1.host=localhost<br />
worker.worker1.port=8009</p>
<strong>7. 修改Tomcat/conf中的server.xml配置文件，在host中增加路径映射<br />
</strong>&lt;Context path="" docBase="/usr/local/apache/htdocs" debug="0" reloadable="true" crossContext="true" /&gt; <br />
<br />
<strong>8.配置tomcat为服务</strong><br />
编写tomcat脚本，chkconfig --list 显示已有服务，chkconfig --add 添加服务 <br />
<br />
<strong>9.自定义访问找不到相应页面时，tomcat的404错误。</strong>400错误设置方法相同<br />
编辑tomcat安装目录中conf中的web.xml在最后加入<br />
&nbsp;&nbsp;&nbsp; &lt;error-page&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;error-code&gt;404&lt;/error-code&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;location&gt;/404.html&lt;/location&gt;<br />
&nbsp;&nbsp;&nbsp; &lt;/error-page&gt;<br />
<img src ="http://www.blogjava.net/jvict/aggbug/309345.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jvict/" target="_blank">Documents</a> 2010-01-13 18:32 <a href="http://www.blogjava.net/jvict/articles/309345.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>gvim</title><link>http://www.blogjava.net/jvict/articles/305869.html</link><dc:creator>Documents</dc:creator><author>Documents</author><pubDate>Mon, 14 Dec 2009 05:10:00 GMT</pubDate><guid>http://www.blogjava.net/jvict/articles/305869.html</guid><wfw:comment>http://www.blogjava.net/jvict/comments/305869.html</wfw:comment><comments>http://www.blogjava.net/jvict/articles/305869.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jvict/comments/commentRss/305869.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jvict/services/trackbacks/305869.html</trackback:ping><description><![CDATA[原文：http://hi.baidu.com/52hack/blog/item/c8648e18ee2dddbd4aedbcba.html<br />
2005年5月，我开始用Vim。此后渐入佳境，原来因版权自律而放弃盗版UltraEdit的遗憾一扫而空。并且，从Vim我才体会到，什么才是真正的编辑利器。在<br />
<a href="http://blog.sina.com.cn/m/xbeta" target="_blank"><font color="#0000ff">善用佳软</font></a><br />
或其他论坛发文，我都是先在Vim中输入，并方便高效地编辑好格式，再贴到网上。而我的通讯录、记事、读书笔记、工作记录也是在Vim中完成的。包括一些文档、数据的处理，让Vim过一下，也会提高不少效率。一句话，自用Vim以来，对它迷恋日深，几乎要超过Total Commander。但是，正如善用佳软及论坛发文所提，我大力推荐&#8220;用IrfanView/XnView代替ACDSee、用7-zip代替WinRar/WinZip、用GIMP代替PhotoShop&#8221;，但并未推荐Vim代替UltraEdit。这并不意味着Vim不能胜任，恰恰相反，如果说IrfanView等替代品比原共享软件还有些差距的话，Vim则远胜UltraEdit。不推荐的唯一原因是，Vim对初学者有点难。<br />
　　<br />
　　但今天仍写了此文推荐给大家。原因有二：其一，编辑大人选定了题目，要向大众宣讲Vim和Emacs，这种勇气鼓舞了我。其二，已发两位高手的文章（<br />
<a href="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/865628.html" target="_blank"><font color="#0000ff">王垠之《Emacs是一种信仰！世界最强编辑器介绍》</font></a><br />
，<br />
<a href="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/877033.html" target="_blank"><font color="#0000ff">Dieken之《程序员的编辑器——Vim》</font></a><br />
）可能会吓住一些对它们产生了兴趣的人，对此我要做些修正。<br />
　　<br />
　　因此本文内容有二：一是帮新手体验Vim。这部分有些象实验教程，多用实例，且行文风格尽量傻瓜化，以便于新手（包括以前从未听说过Vim）可以照我的操作，一步步体验Vim。二是介绍我的应用，即Vim如何便利我的日常工作和生活，而非编程。<br />
　　<br />
<strong>1 对Vim的基本介绍</strong><br />
　　<br />
　　一句话介绍就是：Vim是一个超级超级强大的文本编辑器。它和Emacs是一个数量级；而我认为，比UltraEdit、Editpad、EmEditor要高一个（至少半个数量级）。如果你有兴趣，不妨一读《程序员的编辑器——Vim》，以便于对Vim有更详尽全面的理论认识。<br />
　　<br />
　　要点1：Vim及前身VI，历史悠久（可能比多数读者的年龄更大），经历了几十年的考验和发展，值得信赖。<br />
　　<br />
　　要点2：Vim有模式。通俗地做一下对比。notepad无模式（或称为只有一种编辑模式），你按下j，就是在正文中输入j；要保存，就要ctrl s；要下移一行，就要&#8595;或鼠标。而在Vim中，打开一个文件后，并不处在编辑模式，而是Normal模式，此时你按j，Vim并不认为你要在正文中输入j，而是代表光标下移一行。此时按i表示进入insert模式，即编辑模式，即notepad的模式。编辑模式按Esc退回normal模式。normal模式下按:进入命令行模式，用于输入较复杂的命令。比如:w代表保存文件，:e a.txt代表打开文件a.txt。即Vim可以不用鼠标、方向键、菜单、Ctrl、alt&#8230;&#8230;发出命令。因此，以下的体验中切记进入正确的模式：Esc到Normal；Normal下i到编辑；Normal下:到命令行。再说明一点是：文中:打头的是命令行模式，此外多数Normal模式。<br />
　　<br />
　　要点3：复杂对抗复杂。Vim有的命令行很吓人，长长一串字符恍若天书。这些貌似复杂，实际上无非是一些简单命令的组合而已。借助于此，Vim用户可以实现非常复杂的需求。如果你没有这样的需求，就无须理会它们。<br />
　　<br />
　　要点4：一能百能。这一点是Unix或命令行风格软件的显著长处，经过实用可以深刻体会。本文尽管有一些例子，但它运用之妙，存乎一心的感觉，仍未能充分展示。这里先打个比方，如果windows下某软件号称能炒菜，那意味着你点一下菜单，菜就做好了——这就是易用哲学。到底怎么做，你是没有多少发言权的，而是由软件开发者固化。而如果Vim说能，那它就是有一个&#8220;炒菜&#8221;命令，你可以把这个命令与原有的&#8220;原料&#8221;&#8220;数量&#8221;&#8220;火候&#8221;&#8220;风味&#8221;&#8220;灶具&#8221;命令结合在一起用，甚至在它前面加上&#8220;买菜&#8221;&#8220;洗菜&#8221;，后面加上&#8220;装盘&#8221;&#8220;洗碗&#8221;做成一个自动脚本，在合适的情况下自动执行。<br />
　　<br />
　　要点5：无限灵活，个性由我。你只要有具体需求，Vim几乎都能满足。因此不同人的Vim是不一样的，即，把下载来的Vim配置成自己的Vim。<br />
　　就此打住，开始体验之旅吧！<br />
　　<br />
<strong>2 下载和安装</strong><br />
　　Vim是跨平台的。在Windows下，我们用的是gVim for windows版。最新的是7.0版，下载包约8MB，完全安装后约20MB。<br />
　　注：体积太大？你如果是高手，完全可以把不用的文件删除（包括帮助文件，它是我见过的软件中最好的帮助），精简后的体积可以不到2MB。或反之，仅下载一个gVim.exe（1.5MB）就能运行。但对于这次体验，鉴于第一次使用，建议全部按默认项安装，这样才能达到文中预想的结果。<br />
　　<br />
<a href="http://dl.pconline.com.cn/html_2/1/117/id=39977&amp;pn=0.html" target="_blank"><font color="#0000ff">PCOnline下载</font></a><br />
，<br />
<a href="ftp://ftp.vim.org/pub/Vim/pc/gVim70.exe" target="_blank"><font color="#0000ff">官方下载</font></a><br />
　　<br />
　　安装，基本上，一直Agree、Next就行了。我通常是装在d:\program files\Vim下。<br />
　　可参见<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v1.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v1.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v2.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v2.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v3.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v3.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v4.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v4.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v5.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v5.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v6.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v6.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v7.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v7.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v8.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v8.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　<br />
<strong>3 体验之旅<br />
3.1 初见界面</strong><br />
　　安装完成后，按提示打开readme，你将看到<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v9.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v9.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　或自行打开桌面的快捷方式，也可直接运行d:\program files\Vim\Vim70\gVim.exe，你应该看到如此界面：<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v10.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v10.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　什么？难看？土？我第一次见到它也是这种感觉，现在却只觉得亲切。<br />
　　再一点，你有没有奇怪它是中文界面？难道我给你下载的是汉化版？会不会捆绑流氓插件啊？你如果真这样想，我只能叹息无语了。<br />
　　<br />
<strong>3.2 试读html</strong><br />
　　请把此网页保存为htm，比如test.htm，然后用Vim打开它。暂时用菜单吧！结果可能是这样：<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v11.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v11.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　平平无奇，是吧？因为它是一个标准的Vim，并且是性能优先，视效忽略的Vim。无妨，请进入命令行模式（就是按一下冒号，注意是英文冒号:），注意到最下面一行的变化了吧。再输入sy on再回车。是不是有颜色了？它应该看起来象这个样子<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v12.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v12.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　重要提醒：为简化起见，下文将用<br />
　　:sy on<br />
　　表示（先确认在Normal模式，如不确认，请按几次Esc）你先按:进入命令行模式，再输入sy on，再回车。<br />
　　补充说明：sy表示语法加亮，on当然是打开。:sy clear表示取消加亮。<br />
　　<br />
<strong>3.3 改头换面</strong><br />
　　体验Vim就要按Vim的思路，所以我们要把gVim改回Vim的本来面目。<br />
　　对了，如果你认为它的界面很土，请更要多看一眼当前的样子，因为下面的操作后可能会更土！<br />
　　执行如下命令<br />
　　:set go=<br />
　　这时的Vim应该是<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v13.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v13.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　不要大惊小怪，不就是菜单和工具栏不见了嘛？Vim中是不应该用到它们的。<br />
　　补充说明：set表示一般性设置；go是gui option的缩写，就是界面；等于空就是什么都没有<br />
　　再输入半条命令（先不要回车）<br />
　　:colo ev<br />
　　然后，按一下tab键。是不是自动补全为evening了？Vim是非常聪明的（但是不会象MS Word那样自做聪明）。<br />
　　然后你回车，看到了什么？<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v14.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v14.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　天色全黑了？没错，现在是evening嘛。<br />
　　补充说明：colo就是设置调色方案。Vim自带了近十种调色方案，当然你还可以在网上下载更多，或改编自己的调色方案。你可以直接在:colo （加一个空格）就连续tab，选择不同的配色方案来体验一下。当然，evening是比较经典的一种。我一直就用它。<br />
　　<br />
<strong>3.4 准备并打开范例文件</strong><br />
　　简化起见，请<br />
<a href="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/test.txt" target="_blank"><font color="#0000ff">下载test.txt</font></a><br />
并保存为d:\test.txt。然后，在Vim中输入半条命令<br />
　　:tabnew d:\t<br />
　　输到这里后不要回车，按一下tab，Vim会自动补全为test.txt的。如果不对，再按几次tab，直到正确为止。然后回车。<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v15.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v15.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　你会看到Vim打开了test.txt，并且是以多页签（tab page）的方式。你可以点击各页签在打开的文件中间切换（高手有更方便的键盘命令做法）。在Vim6.3中，还没有此功能。当然了，这并不意味着Vim的用户没办法享受多页签的便利，下载一个插件后——Vim有上千个插件——就可以了。面对多页签风格的流行（IE6&#8594;Maxthon&#8594;IE7），Vim7.0也新增了此功能。<br />
　　我喜欢这种简单的页签。如果你认为此页签太难看，可试一下:set go=e<br />
　　这时应如下效果<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v16.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0609/pic/060928_v16.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　<br />
<strong>3.5 统一格式，修改vimrc</strong><br />
　　上面所操作的各种命令，都是对Vim的设置。把它们写到一个_Vimrc文件中就成了默认选项。每个Vim用户的_Vimrc文件都不一样，因为每个人的需求不同。<br />
　　为了保证下面的操作得到预期的效果，请使用善用佳软提供的_Vimrc（附1）。依次执行下述操作：<br />
　　① 关闭所有的Vim<br />
　　② 找到你的d:\program files\Vim\Vim7\_vimrc，复制一份存档。<br />
　　③ 用任意文本编辑器（Vim或记事本）打开_vimrc，用本文附1的内容替换它，并保存。<br />
　　④ 重启Vim。<br />
　　注：这并不是标准做法，但对windows用户是比较方便的做法。<br />
　　<br />
<strong>3.6 打开test.txt</strong><br />
　　再次就模式进行提醒：Esc到Normal；Normal下i到编辑；Normal下:到命令行。<br />
　　运行Vim，并在命令行执行<br />
　　:e d:\test.txt<br />
　　接下来，我们把此文章排一下版。如果你认为可以手工排版，请把此文件复制到10000行再发表意见。<br />
<strong>3.7 分段并保存</strong><br />
　　原文没有分段，观察一下，发现可以在&#8220;以下是&#8230;&#8230;&#8221;前面加回车，于是<br />
　　:%s/以下是/\r&amp;/gc<br />
　　输入后，界面如下<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/pic/061008_v1.gif" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/pic/061008_v1.gif');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　并提示<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/pic/061008_v2.gif" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/pic/061008_v2.gif');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
，请回答y或a。如果回答y，则替换当前一个；到了下一个，Vim还会再问你。所以，你回答几个y后不妨一a了之，全部替换。<br />
　　补充说明：s表示替换；s/a/b 表示把a换为b；上一命令是把&#8220;以下是&#8221;换为&#8220;\r&amp;&#8221;，\r表示回车，&amp;表示被替换的部分，即&#8220;以下是&#8221;；%则表示全文；/gc表示一直替换（不是仅替换第一个），并且要用户确认。<br />
　　看一下文件，你或许想，空2行可能更好。很简单，再重复一下刚才的命令就好了。不过，对强大的Vim来说，无须笨笨地重复输入上次的命令。在命令行按下:后，再按一下&#8593;（向上的方向键），看到刚才的命令了吧？直接回车，提问时输入a，任务完成。<br />
　　既有变化，请及时保存。命令是<br />
　　:w<br />
　　当然，你也可以按ctrl s。但ctrl s之所以有效，是因为我在_Vimrc中做了定义：当按下ctrl s时，系统执行:w动作。因此，你完全可以定义其他热键，并把它映射到:w。<br />
<strong>3.8 继续编辑<br />
</strong>　　首先删除&#8220;坚持&#8221;两字，很简单，只要按gg2x就行了。为了看效果，你可以分开按：<br />
　　gg，这时光标移到文章头。<br />
　　2x，这时删掉了2个字符。<br />
　　再一次体验Vim的神奇，比如按5x，于是5个字符消失了。当然，这5个字符是要保留的，没关系，你按一次u，就回来了吧？<br />
　　再按一下Ctrl r，是不是又没了？再来一次u，是不是又回来了？没错。u和Ctrl r相当于（是相当于不是等同于）windows的undo和redo。<br />
　　再试一下dd。是不是整行没有了？没关系，u回来就行了。<br />
　　再试一下3dd。一下子删除了3行！没关系，u回来。<br />
　　再来一个dG，哇，全文都没了？！仍然u回来啊。<br />
<strong>3.9 更多编辑<br />
　　任务a：把每一句分为一行，即达到如下效果</strong><br />
　　以**为荣、<br />
　　以**为耻，<br />
　　解决：如果你记得上面的替换命令，就会想到，可以用2次替换（&#8220;为荣、&#8221;换为&#8220;为荣、&#8221;加回车，&#8220;为耻，&#8221;换为&#8220;为耻，&#8221;加回车）。但这两次替换在Vim中完全可以一次完成，即用正则表达式，在&#8220;为&#8221;及后面2字符（&#8220;荣、&#8221;或&#8220;耻，&#8221;）后加入回车。怎么表示呢？<br />
　　:%s/为../&amp;\r/gc<br />
　　看一下高亮，没问题，直接a<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/pic/061008_v3.gif" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/pic/061008_v3.gif');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　哇，是不是很壮观啊？没觉得？如果是一千行一万行呢？<br />
　　<strong>任务b：把行末的标点去掉，即&#8220;荣&#8221;后的顿号和&#8220;耻&#8221;后的逗号。</strong><br />
　　解决：办法太多了，仍可以用替换。但此处还是展示一个新功能：列操作。<br />
　　安全起见，按两下Esc，再gg$，这时光标应到了文章第一行最后一个字符，即顿号上。<br />
　　再按ctrl v，注意一下状态栏是否提示有&#8220;可视 块&#8221; 字样。（请确认你是采用了xbeta的_Vimrc文件，如果没有，请试一下ctrl q）<br />
　　再15jx，是否标点全部删除了？因为15j表示向下选中15行，x表示删除。<br />
　　<strong>任务c：错落有致</strong><br />
　　操作：这次演示一下宏的用法，请严格按本教程操作。<br />
　　先做一下确认：输入法没有打开，并Esc到normal状态，gg到文首。<br />
　　按qa（q表示开始录制宏，宏的名字为a）<br />
　　再shift &gt;&gt;（表示按住shift，连按两下&gt;，再放开shift。此时第一行应当向后tab了一下）<br />
　　再j^（此时下移一行，并置光标于行首）<br />
　　再shift &gt;&gt;再shift &gt;&gt;（即第二行向后tab两下）<br />
　　再j^（下移一行，并将光标置于行首，为后续操作做准备）<br />
　　再q（表示宏录制结束，Vim会提示记录完成）<br />
　　这样宏录完了，可以用了。<br />
　　再@a，看到了效果了吧？宏执行了一次，即3、4行成功了。还剩下6段，但是你不用按6次@a，而是只要按下<br />
[email=6@a]<font color="#0000ff">6@a</font>[/email]<br />
就行了！！！<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/pic/061008_v4.gif" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/pic/061008_v4.gif');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　太神奇了！回放一下？先u，再来一次<br />
[email=6@a]<font color="#0000ff">6@a</font>[/email]<br />
。既然可以6，当然可以千千万万！<br />
　　补充说明：高手使用Vim是千变万化的。上面的前2个操作（分行 删标点），完全可以合成一个:%s/\(为.\)./\1\r/gc；或再把第3个操作（错落有致）融合到前一个操作中。<br />
<strong>3.10 自由体验<br />
</strong>　　体验光标移动：请随意按几下j和k，看看反应；再多按几下l和h，看看反应；然后，当你的光标在英文时，请按几下w和b。<br />
　　对了，gVim的每一种功能，都有无限可能，因此，你也可以在上面几个字母前加上数字，比如 9w 2h，看它的反应。<br />
　　体验自动补全：i进来吧，到目前为止还没写过字呢！为简单起见，你直接把用鼠标放到中文的下一行，我们把 Eight Do's and Eight Don'ts 输入一遍。但是，输入一个E，先别动！按ctrl p是不是自动补全了？<br />
　　体验大小写（每次操作后，都用u恢复原状），试一下g~~和guu和gUU和g??（g??后可以不按u，再按一次g??也能恢复原状）<br />
　　神奇吗？这还是Vim功能的单个表演，真正的高手是把它们组合在一起，完成你自己独特的编辑需求。<br />
<strong>3.11 体验语法高亮和折叠</strong><br />
　　此部分讲起来太复杂。如果你有其他编辑器如UltraEdit基础，会有助于你理解。但Vim在此方面的强大灵活，UltraEdit是难忘其项背的。<br />
　　仍然是我们编辑的原文件，为简化计，请下载<br />
<a href="http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/acc/test2.txt" target="_blank"><font color="#3366cc">test2.txt</font></a><br />
；下载<br />
<a href="http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/acc/tx1.vim" target="_blank"><font color="#3366cc">tx1.vim</font></a><br />
并保存在d:\program files\Vim\Vimfiles\syntax\tx1.vim<br />
　　用Vim打开（比如要打开d:\test2.txt，请在Vim中:tabnew d:\test2.txt）它。平平无奇是吗？这是因为Vim并不知道这个文件要加亮。键入一个命令:setf tx1，这就相当于告诉Vim此文件的类型是tx1，所以就按照刚下载的tx1.vim进行高亮和折叠。<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/pic/061008_v5.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/pic/061008_v5.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　此时你会发现test2.txt完全折起来了。如何打开？你可用鼠标点最左边的 ，当然，也可以用命令zr或zR打开（zR打开全部；zr打开当前；zM折叠全部；zm折叠当前）。打开后，看到高亮效果了吧。可以对文字设定前景色、背景色、粗、斜、下划线风格。<br />
<strong>3.12 加密文件</strong><br />
　　文本文件打开最快，编辑起来最容易，并且在Vim中查找非常方便。因此，我用它来记日记，并作为通讯录。但是安全问题怎么办呢？很简单，Vim本身即可加密（录然解密也要用Vim）。在上述打开的文件中键入:X（是大写X），Vim就提示你设定密码，安全起见要确认第2次。然后，保存（键入:w）。把Vim或此文件关闭，再打开时，就要输入密码了。只有你输入正确的密码，才能得到正确的文件。<br />
<strong>4 我的应用<br />
</strong>　　Vim和Total Commander一样，我把它们都设定为开机自动运行，其应用不可胜数。<br />
　　比如说通讯录管理，我未用任何软件，就用Vim管理一个address.txt。它可以实现：快速启动（我在Vim中定义了书签，键入`A就会打开），加密（用Vim的:X），超强搜索（无须多说），分组折叠（fold），email和电话号的高亮显示（自定义语法文件）吧。<br />
　　再比如，笔者会用Vim来辅助word, excel, bbs发文，安全删除文件，制作精简的五笔词库等。具体可参见 《<br />
<a href="http://blog.sina.com.cn/u/46dac66f010004gy" target="_blank"><font color="#3366cc">我常用的Vim功能</font></a><br />
》，《<br />
<a href="http://blog.sina.com.cn/u/46dac66f010002xz" target="_blank"><font color="#3366cc">活学善用gVim，提高工作效率:实例篇(合集)</font></a><br />
》，《<br />
<a href="http://blog.sina.com.cn/u/46dac66f010002he" target="_blank"><font color="#3366cc">用gVim打造个性化记事本</font></a><br />
》等文章。<br />
　　如下两图分别是我的个性化txt示例，和用Vim写此篇文章时的情况：<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/pic/061008_v6.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/pic/061008_v6.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
　　<br />
<img src="http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/pic/061008_v7.png" border="0"  alt="" />screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.pconline.com.cn/pcedu/soft/gj/photo/0610/pic/061008_v7.png');}" onmousewheel="return imgzoom(this);" alt="" /&gt;<br />
<strong>5 后记</strong><br />
　　这篇文章比最初计划写得长很多，但仍感觉很多非常优秀的功能没有提到。比如，眼下我写这篇文章，当然用Vim。但是因为有插图，所以用了htm格式。在插入图片时，我只要输入img，Vim会自动换为&#8220;&#8221;，并把光标放到两个引号中间，以便于我输入图片名称。我输入lnk后，Vim会替换为&#8220;&#8221;。当我想看一下效果时，我只要:! g:\study\it\pconline\Vim\xbeta-Vim.htm 它就自动在浏览器中打开了。而这一个长长的路径，因为有了自动补全和命令行历史，也非常容易。而当一些url还未确定，需要标注时，我就用一个`1，Vim就会以醒目的红色块标出来，一目了然。而下次再打开此文件，它会记得我最后编辑的位置。<br />
　　在用Vim之前，我曾试过几十种pad和editor，包括长期用Editpad，也曾经比较精通过UltraEdit，也曾经测过EmEditor, EditPlus等。但用了Vim之后，我不再关心windows世界的成千上万的编辑器。因为使用它们的逻辑是&#8220;如果有新需求，只能等软件升级或换一个软件&#8221;，而使用Vim的逻辑则是&#8220;如果有新需求，请做个性化配置或下载插件&#8221;。<br />
　　Vim在手，夫复何求！<br />
　　最后，向Vim所代表的追求卓越、开源共享的精神致敬！并希望有责任感的用户逐渐减少盗版！（完）<br />
<strong>附1：_vimrc文件<br />
</strong>set nocompatible<br />
set magic<br />
set ru "标尺信息<br />
set ai<br />
set sw=4<br />
set ts=4<br />
set dy=lastline "显示最多行，不用@@<br />
"以上是缩进相关<br />
set backspace=indent,eol,start<br />
colo evening<br />
sy on<br />
set go= "无菜单、工具栏<br />
set nobackup<br />
set hlsearch<br />
set showmatch<br />
"tab mappings<br />
map 1gt<br />
map 2gt<br />
map 3gt<br />
map 4gt<br />
map 5gt<br />
map 6gt<br />
map 7gt<br />
map 8gt<br />
map 9gt<br />
map :tabnew<br />
map :tabclose<br />
map! 1gt<br />
map! 2gt<br />
map! 3gt<br />
map! 4gt<br />
map! 5gt<br />
map! 6gt<br />
map! 7gt<br />
map! 8gt<br />
map! 9gt<br />
map! :tabnew<br />
map! :tabclose<br />
<br />
" Use CTRL-S for saving, also in Insert mode<br />
noremap :update<br />
vnoremap :update<br />
inoremap :update<br />
"2006-09-13 如下：保存视图<br />
au BufWinLeave *.ztx mkview<br />
au BufWinEnter *.ztx silent loadview<br />
au BufNewFile,BufRead *.tx1 setf tx1<br />
<br />
<img src ="http://www.blogjava.net/jvict/aggbug/305869.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jvict/" target="_blank">Documents</a> 2009-12-14 13:10 <a href="http://www.blogjava.net/jvict/articles/305869.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>UltraEdit添加php、python支持（总结）</title><link>http://www.blogjava.net/jvict/articles/305729.html</link><dc:creator>Documents</dc:creator><author>Documents</author><pubDate>Sat, 12 Dec 2009 08:53:00 GMT</pubDate><guid>http://www.blogjava.net/jvict/articles/305729.html</guid><wfw:comment>http://www.blogjava.net/jvict/comments/305729.html</wfw:comment><comments>http://www.blogjava.net/jvict/articles/305729.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jvict/comments/commentRss/305729.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jvict/services/trackbacks/305729.html</trackback:ping><description><![CDATA[<p>首先，添加对于php和python语法高亮的支持</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 看了网上的介绍，需要改写wordfile，不过发现15版本之后，其实没有那么麻烦了，<a href="ftp://ultraedit.com/wf/wf.zip">ftp://ultraedit.com/wf/wf.zip</a>，下载这个文件，展开自己选择添加吧，400多种语言，加入到C:\Documents and Settings\Administrator\Application Data\IDMComp\UltraEdit\wordfiles（默认地址）下，重启UltraEdit，就ok了。<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 需要提醒一句，如果把解压包里面都添加的话，建议把原有的删除了，否则冲突。。</p>
<p>其次，设置python ide环境</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 打开UE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 菜单项：高级／工具配置<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 输入项如下设置：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 命令行： python %n%e<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 工作目录：%p<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 菜单项名称：运行python程序</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; python环境变量设置<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 选项设置：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 勾选&#8220;保存活动文件&#8221;选项<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 命令行输出（DOS命令）<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 勾选&#8220;输出到列表窗口&#8221;，&#8220;捕捉输出&#8221;</p>
<p>再次，设置php语法补全及语法检查</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 菜单项：高级/配置/编辑器/自动完成<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 将自动显示自动完成对话框前打钩</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 菜单项：高级／工具配置<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 输入项如下设置：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 命令行： D:\AppServ\php5\php.exe -l -f %F<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 工作目录：D:\AppServ\php5\ext<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 菜单项名称：<font color="#29568f"><font color="#000000">PHP</font> </font>syntax Check<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 选项设置：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 勾选&#8220;保存活动文件&#8221;选项<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 命令行输出（DOS命令）<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 勾选&#8220;输出到列表窗口&#8221;，&#8220;捕捉输出&#8221;</p>
<p>顺便把java的部分贴上来，以后或许会用到</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 菜单项：高级／工具配置<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 输入项如下设置：<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 命令行： java %n%e<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 工作目录：%p<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 菜单项名称：运行java程序</p>
<p>好了，两个都设置好了，win下，实在觉得eclipse太大了点，gvim感觉太差，还是这个好了，恩<br />
说一句，都是google出来的结果，所以还要感谢很多的热心人共享</p>
<img src ="http://www.blogjava.net/jvict/aggbug/305729.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jvict/" target="_blank">Documents</a> 2009-12-12 16:53 <a href="http://www.blogjava.net/jvict/articles/305729.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>PHP_ZendFramework相关备注-PDO_MSQL安装</title><link>http://www.blogjava.net/jvict/articles/305661.html</link><dc:creator>Documents</dc:creator><author>Documents</author><pubDate>Fri, 11 Dec 2009 15:26:00 GMT</pubDate><guid>http://www.blogjava.net/jvict/articles/305661.html</guid><wfw:comment>http://www.blogjava.net/jvict/comments/305661.html</wfw:comment><comments>http://www.blogjava.net/jvict/articles/305661.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jvict/comments/commentRss/305661.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jvict/services/trackbacks/305661.html</trackback:ping><description><![CDATA[&#183;PDO_MYSQL未安装<br />
之前安装php5.3.1时，未安装PDO_MYSQL扩展，所以ZendFramewok程序做好后无法连接mysql。直接下载PDO_MSQL扩展单独安装时提示mysql.h找不到。<br />
重新编译php5.3.1源码，编译时加上参数<br />
&nbsp;--with-mysql=/usr/local/mysql&nbsp; --with-mysqli=/usr/local/mysql/bin/mysql_config&nbsp; --with-pdo-mysql=/usr/bin/mysql_config<br />
后，程序能正常运行。
 <img src ="http://www.blogjava.net/jvict/aggbug/305661.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jvict/" target="_blank">Documents</a> 2009-12-11 23:26 <a href="http://www.blogjava.net/jvict/articles/305661.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>struts、dao、hibernate项目中遇到的问题</title><link>http://www.blogjava.net/jvict/articles/225671.html</link><dc:creator>Documents</dc:creator><author>Documents</author><pubDate>Fri, 29 Aug 2008 16:34:00 GMT</pubDate><guid>http://www.blogjava.net/jvict/articles/225671.html</guid><wfw:comment>http://www.blogjava.net/jvict/comments/225671.html</wfw:comment><comments>http://www.blogjava.net/jvict/articles/225671.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jvict/comments/commentRss/225671.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jvict/services/trackbacks/225671.html</trackback:ping><description><![CDATA[<p>&#183;内容部份使用<span  style="color: #4b4b4b; font-family: georgia; font-size: 14px; font-weight: bold; line-height: 20px; "><a id="homepage1_HomePageDays_DaysList_ctl00_DayItem_DayList_ctl00_TitleUrl" class="postTitle2" href="http://www.blogjava.net/jvict/archive/2008/09/11/228373.html" style="text-decoration: none; margin-top: 0px; padding-top: 0px; color: #638f27; ">FCKeditor</a><a id="homepage1_HomePageDays_DaysList_ctl00_DayItem_DayList_ctl00_TitleUrl" class="postTitle2" href="http://www.blogjava.net/jvict/archive/2008/09/11/228373.html" style="text-decoration: none; margin-top: 0px; padding-top: 0px; "><font  color="#000000" face="Simsun" size="4"><span  style="font-size: 16px; font-weight: normal; line-height: normal;">来进行操作Word等带格式文档</span></font></a></span></p>
<p>&#183;<span style="color: red">一个容易忽略的问题，使用Hibernate SessionFactory连接数据库并创建了session时</span><br />
buildSessionFactory.openSession<br />
　&#160;&#160;&#160;&#160;当使用完关闭 session.close()后，连接依然处于打开状态，只有当SessionFactory(工厂并闭时才真正关闭）<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;即SessionFactory.close()后才ＯＫ，不然访问到达指定连接数后就会打不开数据库连接报错，Ｔoo many connections<br />
<br />
&#183;使用EL表达式输出日期格式配合JSTL (详细：<a href="http://bbs.163jsp.com/posts/listByUser/127.html">http://bbs.163jsp.com/posts/listByUser/127.html</a> ）<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&lt;%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&lt;fmt:formatDate value="${param.date}" pattern="yyyy-MM-dd" /><br />
<br />
&#183;<span style="color: red">mysql中文问题，开始一直无法插入中文，怎么改变字符集都不行</span>。<br />
　　是因为改变字符集后没有重新用新的字符集建表，原来创建的表还是老的字符集。重新创建后即可决<br />
<br />
<br />
&#183;在页面中无法使用EL表达式语言,<br />
<font color="#ff0000">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;原因与解决方法：<br />
</font>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;可能是使用了JSTL<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;在jsp的开头需要加一条指令如下：<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&lt;%@&#160;page&#160;isELIgnored="false"%><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;这样EL就可以正常显示了,可以同时使用JSP 2.0 EL与JSTL了<br />
<br />
&#183;<span style="color: red">缺少javaee.jar包</span>引起Tomcat 异常出错<br />
</p>
<p><br />
&#183;<span style="color: red">tomcat java.lang.NoClassDefFoundError: javax/el/ExpressionFactory</span><br />
&#160;　　少了包:el-api.jar, el-ri.jar<br />
<br />
&#183;Hibernate调试没有问题，当采用Struts或Web页面前台调用时出错，原因为Hibernate和struts包不一致，<br />
下载新的commons-collections-2.1.1.jar包更新后正常</p>
<br />
&#183;ActionErrors 无法显示：ApplicationResources.properties 没有在指定的目录中，cn.....struts目录<br />
<br />
&#183;Action中向外传递错误信息时，需要使用下面格式：<br />
&#160;&#160;&#160;&#160;&#160;&#160;<span style="color: #3366ff">&#160;ActionErrors errors =new ActionErrors();<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;errors.add(errors.GLOBAL_MESSAGE, new ActionMessage("failure"));<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;this.saveErrors(request, errors);<br />
</span>
<img src ="http://www.blogjava.net/jvict/aggbug/225671.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jvict/" target="_blank">Documents</a> 2008-08-30 00:34 <a href="http://www.blogjava.net/jvict/articles/225671.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>