VIM TIP23

Check out your .vimrc. If 'set notitle' is an entry, comment it out with a quotation mark ("). Now your xterm should inherit the title from Vim. 检查你的配置文件.vimrc.如果设置了set notitle, 请用" 注释掉。现在在图形界面x终端下可以显示Vim的标题了
e.g. 'Vim - ~/.vimrc'. This can be quite nice when programming and editing lots of files at the same time. by [[email protected]] 例如:Vim-~/.vimrc . 这样在编程和编辑多个文件时会非常方便。

Technorati Tags: ,

VIM TIP20

VimTip 20: Are .swp and ~ files littering your working directory?
清理swp、~文件

Have you ever been frustrated at swap files and backups cluttering up your working directory?
你曾有过被工作目录中的缓存文件swp和备份文件~所烦恼的时候嘛?
这就是一活生生的例子:
Untidy:
ons.txt
ons.txt~
README
README~
tester.py
tester.py~

Here are a couple of options that can help:
这是一些能够起到改善的选项:
set backupdir=./.backup,.,/tmp
set directory=.,./.backup,/tmp


This way, if you want your backups to be neatly grouped, just create a directory called '.backup' in your working directory.
这样,如果你想将你的备份文件整齐的分类,在工作目录中创建.backup的目录
Vim will stash backups there. The 'directory' option controls where swap files go. If your working directory is not writable,
Vim will put the swap file in one of the specified places.
Vim将在其中备份。directory选项控制缓存文件的位置。如果你的工作目录不是可写的,Vim将在一个给定的目录中放置缓存文件。

Technorati Tags: ,

VIM TIP21


VimTip 21: easy pasting to windows apps
方便的粘贴到Windows应用程序

In Vim, the unnamed register is the " register, and the Windows Clipboard is the * register. This means that if you yank something, you have to yank it to the * register if you want to paste it into a Windows app.
在Vim中,未命名的寄存器是" register,而在Windows中是 register。这意味这如果你粘贴一些东西,你必须从 register
中粘贴到Windows 应用程序中。
If this is too much trouble, set the 'clipboard' option to 'unnamed'. Then you always yank to .
如果这样太麻烦的话,设置'clipboard'选项为'unnamed'。这样你全部是从
中粘贴
So pasting to windows apps doesn't require prefixing " :
这样粘贴到windows应用程序中不需要前缀

set clipboard=unnamed


Technorati Tags: ,

VIM TIP19



VimTip 19: line numbers...
行号

I have started doing all my code reviews on a laptop because of the number command.
由于行号我在我的膝上电脑完成了我所有的代码回顾。
:set number will put line numbers along the left side of a window
:set number将在窗口的左侧放置行号

:help number


Technorati Tags: ,

VIM TIP17

VimTip 17: Erasing previosuly entered characters in insert mode
在插入模式删除先前录入字符


In insert mode, to erase previously entered characters, set the following option:
在插入模式下,删除先前字符可以做以下设定:
set backspace=2

By default, this option is empty. If this option is empty, in insert mode, you can not erase characters entered before this insert mode started. This is the standard Vi behavior.
默认此选项为空。如果选项为空的话,在插入模式,你将无法删掉录入的字符除非你打开backspace。这是标准的VI行为#莫非俺的vi为非标准的非传统的?有可能,我测试结果使在windows下的gvim6.4 backspace为空亦能够删除字符
To get more help on this, use
更多帮助请看:
:help 'backspace'

#奇怪?根据帮助我的backspace的默认值indent, eol, start,即backspace =2。所以嘛,传统也是要改变的……


Technorati Tags: ,

VIP TIP14

To highlight all the search pattern matches in a file set the following option: 高亮显示所有搜索的匹配项可以通过命令 :set hlsearch

After this option is set, if you search for a pattern, all the matches in the file will be highlighted in yellow. 这样设定后高亮显示所有搜索的匹配项#又唐僧了不是?! To disable the highlighting temporarily, use the command 暂时废除高亮使用命令 :nohlsearch

This command will remove the highlighting for the current search.The highlighting will come back for the next search. 命令可以取消当前搜索的高亮。下次搜索还会高亮 To disable the highlighting completely, set the following option: 废除高亮使用命令 :set nohlsearch

By default, the hlsearch option is turned off. 默认高亮搜索是关闭的#我的是开启的,哈哈 To get more help on this option, use 想知道更多,请查阅帮助

:help 'hlsearch' :help :nohlsearch

Technorati Tags:

VIM TIP15

VimTip 15: Displaying status line always
总是显示状态行

To display the status line always, set the following option in your .vimrc file:
总是显示状态行,在配置文件中加入:
set laststatus=2

The advantage of having the status line displayed always is, you can see the current mode, file name, file status, ruler, etc.
总是显示状态行的优点就是可以随时看到文件名,及其状态和标尺等等信息。
To get more help on this, use
更多信息请查阅帮助

:help laststatus



Technorati Tags:

上帝与Google,玉帝与Baidu

最早的时候,上帝很无聊,平时只能看看电视听听广播,偶尔玩玩超级玛丽,再就是和圣母玛丽亚通通电话.时间长了,这种生活越发枯燥.上帝觉得这样的生活太乏味,于是他说:“要有网”.然后就有了互联网,计算机都可以连在一起,这是第一天.  
  光是有互联网也不行,起码得有点东西看吧。上帝说:“要有网站”。然后就有了全世界各种各样的大小网站,上帝在网站上看新闻、看图片,顺便还到论坛上发发贴,觉得互联网有些意思,这是第二天。  
  圣母玛丽亚看上帝这两天没怎么打电话,比较生气,威胁上帝说要把互联网毁了,上帝觉得这样不好,于是上帝说:“要有即时通讯”。然后就有了即时通讯软件,上帝和圣母玛丽亚在互联网上视频语音聊天,圣母玛丽亚也觉得互联网很好玩,这是第三天。  
  网站的数量太多了,也不知道那个网站更好看,上帝觉得这样太杂乱,于是上帝说:“要有导航网站”,然后就有了导航网站,上帝觉得分类目录挺好的,这是第四天。  
  没想到,网站越来越多,网页也越来越多,找分类目录都找不过来了,上帝觉得比较郁闷,心想找个东西怎么这么难呢?但这难不倒上帝,上帝说:
“要有搜索引擎”,然后就有了搜索引擎,上帝使用搜索引擎,很快的就可以找到自己想要的东西,上帝觉得非常有成就感,这是第五天。  
  在第一天上帝搞互联网的时候,远在天界东边的玉皇大帝就从千里眼和顺风耳那里得到了线报。玉帝有点迷惑,“这哥们搞什么东东呢?”问了所有神仙,大家都不知道,玉帝觉得这样不行,我们得与时俱进,向西方学习。玉帝说:“要有中国互联网”。于是中国也有了互联网。  
  第二天,玉帝上互联网,全是英文网站,除了图片以外,什么都看不懂,玉帝很头大。玉帝说:“要有中文网站”。于是中文网站雨后春笋般的出现了。  
  第三天,玉帝不爽了,为什么?联系不方便啊,还是要叫千里眼和顺风耳,丫的,太麻烦了,可是ICQ、MSN都是英文的啊?玉帝说:“要有中文的及时通讯。”于是有了QQ。玉帝玩上了QQ,跟王母娘娘聊的很开心。  
  第四天,中文网站也太多了,看的玉帝眼花缭乱,心情也比较烦乱,就问太白金星怎么办。太白金星这个老家伙说:“好,一得给他们分类,二得推荐
些好网站,三得经常有新东西……”玉帝觉得他很罗嗦。玉帝说,你说什么“好一二三”?然后,hao123就解决了玉帝和中国大众上网导航的问题。    
/>白金星凑过来说,上帝那有个Google,挺不错的,推荐你用用。于是玉帝上Google,一眼看过去,全是英文的,玉帝直接爆炸了,回头把太白金星骂了
个狗血喷头:“你这什么馊主意?让我用他们搞的东西?没听过国货当自强吗?这个玩意我们得自己搞!”玉帝转过身问文曲星该怎么办,文曲星慢条斯里的吟开场
白:“众里寻她千百度,那人却在……”,玉帝说:“千你个头啊,百度!”这一瞬间,百度中文搜索引擎诞生了!  
  玉帝很满意百度。在百度,不但可以便捷的找到想要的信息,还可以在百度mp3搜索上找些小曲听听,更可以躲开王母偷偷的在百度图片搜索弄几张
嫦娥的写真照片看看,更绝的,是玉帝在百度贴吧开了个“玉皇大帝”吧来了解天下百姓对自己的歌功颂德——而这些是Google所没有的。时间长了,甚至在
众神仙为某个事上吵个不停的时候,玉帝就会说:“有问题,百度一下!”然后就没问题了。  
  然而众神仙不明白,为什么玉帝不喜欢同样有中文版的Google,仅仅因为百度更符合中国大众使用习惯吗?后来,玉帝终于自揭谜底:这些洋网站总说用户是上帝,用户是上帝,用户真的是上帝?在中国,用户是玉帝!”大家恍然大悟。

Technorati Tags:

VIM TIP8

VimTip 8: Jumping to the declaration of a local/global variable

'gd' command To jump to the declaration of a local variable in a C program, position the cursor on the name of the variable and use the gd command.
gd 在c语言中就是跳到光标下本地变量的声名处
'gD' command: To jump to the declaration of a global variable in a C program, position the cursor on the name of the variable and use the gD command.
gD 在c语言中就是跳到光标下全局变量的声名处
#其实啊,在普通的文件中我觉得两个命令跟*和#基本上是一样的
My del.icio.us Tags




Technorati Tags:

VIM TIP13

To move the cursor to the matched string, while typing the search string, set the following option in the .vimrc file: 在输入关键字的时候移动光标到匹配词,可以在配置文件中添加 set incsearch

You can complete the search by pressing the Enter key. To cancel the search, press the escape key. 可以通过按Enter完成搜索,ESC取消搜索 #又是挺无聊的一个技巧

Technorati Tags: