VERSION5
*version5.txt* For Vim version 7.1. 最近更新: 2006年12月
VIM å‚考手册 by Bram Moolenaar
译者: Willis
http://vimcdoc.sf.net
欢迎æ¥åˆ° Vim 5.0 版本ï¼
本文档列出 Vim 4.x å’Œ Vim 5.0 çš„ä¸åŒä¹‹å¤„。尽管这里æåˆ° 5.0,但也适用于
5.1,5.2 版本ç‰ã€‚
|vi_diff.txt| æä¾› Vi å’Œ Vim 5.0 的区别的一个概述。
|version4.txt| 说明 Vim 3.0 和 Vim 4.0 的区别。
ä¸ å…¼ 容 点: |incompatible-5|
æ”¹å˜ 'compatible' 缺çœå€¼ |cp-default|
æ”¹å˜æ–‡æœ¬æŽ’版命令 "Q" |Q-command-changed|
改å˜å‘½ä»¤è¡Œå‚æ•° |cmdline-changed|
ä¿ç•™è‡ªåЍ命令 |autocmds-kept|
æ”¹å˜ 'hidden' 的使用 |hidden-changed|
æ”¹å˜æ–‡æœ¬å¯¹è±¡å‘½ä»¤ |text-objects-changed|
åˆ é™¤ X-Windows èµ„æº |x-resources|
$VIM 的使用 |$VIM-use|
MS-DOS 和 Win32 的 $HOME 的使用 |$HOME-use|
æ”¹å˜æ ‡ç¾æ–‡ä»¶æ ¼å¼ |tags-file-changed|
改å˜çš„选项 |options-changed|
å–æ¶ˆæ’入命令的 CTRL-B |i_CTRL-B-gone|
新 特 性: |new-5|
è¯æ³•高亮 |new-highlighting|
内建的脚本è¯è¨€ |new-script|
Perl å’Œ Python æ”¯æŒ |new-perl-python|
Win32 GUI 版本 |added-win32-GUI|
VMS 版本 |added-VMS|
BeOS 版本 |added-BeOS|
Macintosh GUI 版本 |added-Mac|
和 Vi 更兼容 |more-compatible|
ä»Žæ ‡å‡†è¾“å…¥è¯»å–输入 |read-stdin|
æ£è§„è¡¨è¾¾å¼æ¨¡å¼ |added-regexp|
é‡è½½çš„æ ‡ç¾ |tag-overloaded|
新命令 |new-commands|
新选项 |added-options|
æ–°å‘½ä»¤è¡Œå‚æ•° |added-cmdline-args|
其它新增 |added-various|
改 进 |improvements-5|
ç¼– 译 æ—¶ çš„ 改 å˜ |compile-changes-5|
æ¼ æ´ž ä¿® æ£ |bug-fixes-5|
5.1 版 本 |version-5.1|
改动 |changed-5.1|
新增 |added-5.1|
ä¿®æ£ |fixed-5.1|
5.2 版 本 |version-5.2|
长行å¯ç¼–辑 |long-lines|
åŠ å…¥æ–‡ä»¶æµè§ˆå™¨ |file-browser-5.2|
åŠ å…¥å¯¹è¯æ¡† |dialogs-added|
åŠ å…¥å¼¹å‡ºå¼èœå• |popup-menu-added|
åŠ å…¥é€‰æ‹©æ¨¡å¼ |new-Select-mode|
åŠ å…¥ä¼šè¯æ–‡ä»¶ |new-session-files|
用户定义的函数和命令 |new-user-defined|
æ–°æŽ¥å£ |interfaces-5.2|
æ–°ç§»æ¤ç‰ˆæœ¬ |ports-5.2|
多å—èŠ‚æ”¯æŒ |new-multi-byte|
新函数 |new-functions-5.2|
新选项 |new-options-5.2|
新 Ex 命令 |new-ex-commands-5.2|
改动 |changed-5.2|
新增 |added-5.2|
ä¿®æ£ |fixed-5.2|
5.3 版 本 |version-5.3|
改动 |changed-5.3|
新增 |added-5.3|
ä¿®æ£ |fixed-5.3|
5.4 版 本 |version-5.4|
引入è¿è¡Œæ—¶ç›®å½• |new-runtime-dir|
引入文件类型 |new-filetype-5.4|
Vim 脚本ç»è¡Œç¬¦ |new-line-continuation|
æ”¹è¿›ä¼šè¯æ–‡ä»¶ |improved-sessions|
改进自动命令 |improved-autocmds-5.4|
åŠ å¯† |new-encryption|
GTK GUI ç§»æ¤ç‰ˆæœ¬ |new-GTK-GUI|
èœå•æ”¹å˜ |menu-changes-5.4|
改进 Viminfo |improved-viminfo|
若干新命令 |new-commands-5.4|
若干新选项 |new-options-5.4|
Vim 脚本 |new-script-5.4|
é¿å… hit-enter æç¤º |avoid-hit-enter|
改进 quickfix |improved-quickfix|
æ£è§„è¡¨è¾¾å¼ |regexp-changes-5.4|
改动 |changed-5.4|
新增 |added-5.4|
ä¿®æ£ |fixed-5.4|
5.5 版 本 |version-5.5|
改动 |changed-5.5|
新增 |added-5.5|
ä¿®æ£ |fixed-5.5|
5.6 版 本 |version-5.6|
改动 |changed-5.6|
新增 |added-5.6|
ä¿®æ£ |fixed-5.6|
5.7 版 本 |version-5.7|
改动 |changed-5.7|
新增 |added-5.7|
ä¿®æ£ |fixed-5.7|
5.8 版 本 |version-5.8|
改动 |changed-5.8|
新增 |added-5.8|
ä¿®æ£ |fixed-5.8|
(译者注: å„版本的修æ£ä¸€èŠ‚ï¼Œå› å†…å®¹è¿‡äºŽç碎,ä¿ç•™åŽŸæ–‡æœªç¿»è¯‘)
æ”¹å˜ 'compatible' 缺çœå€¼ *cp-default*
Vim 5.0 版本试图å˜å¾—å’Œ Vi 更兼容。这有助于那些使用 Vim 作为 Vi çŸæœŸä»£æ›¿å“çš„
人,但导致了和 4.x 版本的部分ä¸å…¼å®¹ã€‚
4.x 版本里,'compatible' 选项的缺çœå€¼æ˜¯å…³é—çš„ã€‚çŽ°åœ¨ç¼ºçœæ‰“å¼€äº†ã€‚ç¬¬ä¸€ä»¶äº‹ä½ å°±ä¼š
注æ„到,"u" å‘½ä»¤æ’¤é”€äº†å®ƒè‡ªå·±ã€‚å…¶å®ƒçš„å‰¯ä½œç”¨åŒ…æ‹¬æ˜ å°„å¯èƒ½å·¥ä½œæ–¹å¼ä¸åŒï¼Œç”šè‡³å®Œå…¨ä¸
工作。
å› ä¸ºè®¸å¤šä»Ž 4.x 切æ¢åˆ° 5.0 的人觉得这很讨厌,如果 Vim 找到了 vimrc 文件,
'compatible' 选项被关é—。这有点åƒé”æœ¯ï¼Œä½†å®ƒç¡®ä¿ 90% çš„ Vim 用户ä¸ä¼šå› 为这个改
å˜è€Œå—å½±å“。
è¿™æ„味什么呢?
- å¦‚æžœä½ å好è¿è¡Œåœ¨ 'compatible' 模å¼é‡Œä¸”没有 vimrc æ–‡ä»¶ï¼Œä½ ä¸éœ€è¦åšä»»ä½•事。
- å¦‚æžœä½ å好è¿è¡Œåœ¨ 'nocompatible' 模å¼é‡Œä¸”有 vimrc æ–‡ä»¶ï¼Œä½ ä¸éœ€è¦åšä»»ä½•事。
- å¦‚æžœä½ å好è¿è¡Œåœ¨ 'compatible' 模å¼é‡Œï¼Œä½†ä½ 有 vimrc æ–‡ä»¶ï¼Œä½ åº”è¯¥åœ¨ vimrc æ–‡
件先放上这行:
:set compatible
- å¦‚æžœä½ å好è¿è¡Œåœ¨ 'nocompatible' 模å¼é‡Œï¼Œä½†ä½ 没有 vimrc æ–‡ä»¶ï¼Œä½ å¯ä»¥é€‰æ‹©ä»¥ä¸‹
方法之一:
- 建立空的 vimrc 文件 (比如: Unix 的 "~/.vimrc")。
- åœ¨ä½ çš„ .exrc 文件或 $EXINIT 里放上这个命令:
:set nocompatible
- 以 "-N" 傿•°å¯åЍ Vim。
å¦‚æžœä½ æ˜¯ Vi å’Œ Vim 的新用户,强烈建议使用 'nocompatible'ã€‚å› ä¸º Vi æœ‰å¾ˆå¤šæ„æƒ³ä¸
到的副作用,这个设置å¯ä»¥é¿å…ã€‚è§ 'compatible'。
å¦‚æžœä½ å–œæ¬¢ 'compatible' 的一些设置,ä¸å–œæ¬¢å¦ä¸€äº›ï¼Œä½ å¯ä»¥ç”¨ 'cpoptions' 兼容性
选项微调。
如果用 "ex" 或 "gex" å¯åЍ Vim,Vim 总是以兼容模å¼å¯åŠ¨ã€‚
æ”¹å˜æ–‡æœ¬æŽ’版命令 "Q" *Q-command-changed*
"Q" 命令以å‰ä½¿ç”¨ 'textwidth' 选项指定的宽度对行进行排版。现在这个命令是 "gq"
(è¯¦æƒ…è§ |gq|)。这个改å˜çš„åŽŸå› æ˜¯ "Q" æ˜¯ä¸ªæ ‡å‡† Vi 的命令,用以进入 "Ex" 模å¼ï¼Œè€Œ
事实上,Vim 现在有了 "Ex" æ¨¡å¼ (è¯¦æƒ…è§ |Q|)。
å¦‚æžœä½ ä»ç„¶æƒ³ç”¨ "Q" è¿›è¡ŒæŽ’ç‰ˆï¼Œä½¿ç”¨æ¤æ˜ å°„:
:noremap Q gq
å¦‚æžœä½ åŒæ—¶æƒ³ç”¨ "Q" 的功能:
:noremap gQ Q
改å˜å‘½ä»¤è¡Œå‚æ•° *cmdline-changed*
现在å¯ä»¥æ··åˆå‘½ä»¤è¡Œæ–‡ä»¶å‚æ•°å’Œé€‰é¡¹å‚æ•°ã€‚ä½ å¯ä»¥åœ¨æ–‡ä»¶å之åŽç»™å‡ºé€‰é¡¹ã€‚例如:
vim main.c -g
è¿™ä¸èƒ½ç”¨æ¥ç¼–辑 '-' 开始的文件。使用 "--" 傿•° |---|,然åŽ:
vim -g -- -main.c
"-v" 现在æ„味ç€å¯åЍ Ex 进入 Vi 模å¼ï¼Œä½¿ç”¨ "-R" 进入åªè¯»æ¨¡å¼ã€‚
旧版: "vim -v file" |-v|
新版: "vim -R file" |-R|
"-e" 现在æ„味ç€å¯åЍ Vi 进入 Ex 模å¼ï¼Œä½¿ç”¨ "-q" 进入 quickfix。
旧版: "vim -e errorfile" |-e|
新版: "vim -q errorfile" |-q|
Ex 模å¼é‡Œçš„ "-s" 现在æ„味ç€è¿›å…¥å®‰é™ (批处ç†) 模å¼ã€‚|-s-ex|
"-x" ä¸ºåŠ å¯†é€‰é¡¹ä¿ç•™ï¼Œä½¿ç”¨ "-f" æ¥é¿å…å¯åŠ¨æ—¶è¿›å…¥æ–° CLI (Amiga)。
旧版: "vim -x file" |-x|
新版: "vim -f file" |-f|
Vim å…许有ä¸è¶…过å个的 "+cmd" å’Œ "-c cmd" 傿•°ã€‚过去,Vim åªæ‰§è¡Œæœ€åŽä¸€ä¸ªã€‚
"-n" 现在覆盖 vimrc 文件里 'updatecount' 的任何设置,但ä¸ä¼šè¦†ç›– gvimrc 文件的
设置。
ä¿ç•™è‡ªåЍ命令 *autocmds-kept*
5.0 版本以å‰ï¼Œæœ‰ç›¸åŒçš„äº‹ä»¶ã€æ–‡ä»¶å模å¼å’Œå‘½ä»¤çš„自动命令åªèƒ½å‡ºçŽ°ä¸€æ¬¡ã€‚å¯¹ç®€å•的自
动命令这没有问题 (比如设置选项值)ï¼Œä½†å¯¹æ›´å¤æ‚的自动命令,相åŒçš„命令å¯èƒ½ä¼šå‡ºçް
两次。这个é™åˆ¶å¯¼è‡´äº†ä¸€äº›é—®é¢˜ã€‚å› æ¤ï¼ŒVim è®°ä½æ‰€æœ‰çš„自动命令,并以它们定义的顺åº
ä¿å˜ã€‚
- 在定义自动命令之å‰ï¼Œåˆ 除任何å¯èƒ½å®šä¹‰ä¸¤æ¬¡çš„自动命令。例如:
:au! * *.ext
:au BufEnter *.ext ...
- 把自动命令放到 ":if" 命令里é¢ã€‚例如:
if !exists("did_ext_autocmds")
let did_ext_autocmds = 1
autocmd BufEnter *.ext ...
endif
- 把自动命令放到ä¸åŒçš„è‡ªåŠ¨å‘½ä»¤ç»„é‡Œï¼Œè¿™æ ·ä½ å¯ä»¥åœ¨å®šä¹‰ä¹‹å‰åˆ 除它们 |:augroup|:
augroup uncompress
au!
au BufReadPost *.gz ...
augroup END
æ”¹å˜ 'hidden' 的使用 *hidden-changed*
在 4.x ç‰ˆæœ¬é‡Œï¼Œåªæœ‰ä¸€äº›å‘½ä»¤ä½¿ç”¨ 'hidden' 选项。现在任何缓冲区从窗å£é‡Œæ¶ˆå¤±çš„命
令都使用之。
以å‰ï¼Œä½ å¯ä»¥åªé˜¿æ”¹å˜è¿‡çš„缓冲区里使用 ":buf xxx",那个缓冲区就会éšè—。é™åˆ¶é˜¿ï¼Œ
ä½ å¿…é¡»ç½®ä½ 'hidden' 选项æ¥åšæ¤å·¥ä½œã€‚
新的行为更简å•: Vim 是å¦éšè—缓冲区ä¸å†å–å†³äºŽä½ ä½¿ç”¨çš„ç‰¹å®šå‘½ä»¤ã€‚
- æ²¡æœ‰ç½®ä½ 'hidden'ï¼Œä½ æ°¸è¿œä¸ä¼šå¾—到éšè—的缓冲区。特例包括 ":hide" å’Œ ":close!"
命令,还有,在罕è§çš„æƒ…å†µä¸‹ï¼Œå½“ä½ ä¸è¿™ä¹ˆåšå°±ä¼šä¸¢å¤±ç¼“冲区里的改动的情况。
- ç½®ä½äº† 'hidden'ï¼Œä½ å‡ ä¹Žä¸ä¼šå¸è½½ç¼“冲区。例外是 ":bunload" 或 ":bdel" 命令。
":buffer" çŽ°åœ¨æ”¯æŒ "!": 放弃当å‰ç¼“冲区的改动,":bnext"ã€":brewind" ç‰äº¦ç„¶ã€‚
æ”¹å˜æ–‡æœ¬å¯¹è±¡å‘½ä»¤ *text-objects-changed*
文本对象命令现在有了新的åå—。这å…许更多的文本对象,并且使这些å—符å¯ç”¨äºŽå…¶å®ƒçš„
å¯è§†æ¨¡å¼å‘½ä»¤ã€‚å› ä¸ºä¸å†æä¾›å•å—符的åå—,文本对象åå—现在需è¦ä¸¤ä¸ªå—符。第一个å—
符总是 'i' 或 'a'。
旧版 新版
a aw 一个å•è¯ |v_aw|
A aW 一个å—串 |v_aW|
s as 一个å¥å |v_as|
p ap ä¸€ä¸ªæ®µè½ |v_ap|
S ab 一个 () å— |v_ab|
P aB 一个 {} å— |v_aB|
有å¦å¤–一组文本对象,它们以 "i" 开始,代表 "inner" (内部)。它们选择相åŒçš„对象,
但排除空白。
åˆ é™¤ X-Windows èµ„æº *x-resources*
Vim ä¸å†æ”¯æŒä¸‹é¢çš„ X 资æº:
- boldColor
- italicColor
- underlineColor
- cursorColor
Vim 现在使用高亮组设定颜色。这é¿å…和使用粗体å—体的混淆,其ä¸éšå«ç€ä½¿ç”¨ç‰¹å®šé¢œ
è‰²ã€‚è§ |:highlight| å’Œ |gui-resources|。
$VIM 的使用 *$VIM-use*
Vim 现在使用 VIM 环境å˜é‡æ¥æ‰¾åˆ°æ‰€æœ‰çš„ Vim 系统文件。其ä¸åŒ…括全局 vimrcã€
gvimrc å’Œ menu.vim æ–‡ä»¶ä»¥åŠæ‰€æœ‰çš„åœ¨çº¿å¸®åŠ©å’Œè¯æ³•æ–‡ä»¶ã€‚è§ |$VIM|。从 5.4
版本开始,也å¯ä»¥ä½¿ç”¨ |$VIMRUNTIME|。
Unix 上,Vim 在 "make install" 的时候设置 $VIM 的缺çœå€¼ã€‚
如果没有设置 $VIM,它的缺çœå€¼å–自 'helpfile' 所在的目录,å‡åŽ»åŽé¢çš„
"/doc/help.txt"。
MS-DOS 和 Win32 的 $HOME 的使用 *$HOME-use*
MS-DOS å’Œ Win32 版本的 Vim 现在在æœç´¢ vimrc 或 exrc 文件和读写 viminfo 文件的
时候,检查 $HOME。以å‰ï¼ŒVim 在这些系统上使用 $VIM,但在有多个用户的系统上这会
有问题。现在 Vim åªæœ‰åœ¨ $HOME 没有设置或者在 $HOME 里没找到文件的时候æ‰ä½¿ç”¨
$VIMã€‚è§ |_vimrc|。
æ”¹å˜æ ‡ç¾æ–‡ä»¶æ ¼å¼ *tags-file-changed*
æ ‡ç¾æ–‡ä»¶é‡Œï¼Œåªæœ‰åˆ¶è¡¨å¯ä»¥ç”¨æ¥åˆ†éš”åŸŸã€‚è¿™æ ·ï¼Œæ–‡ä»¶å里就å¯ä»¥å…è®¸æœ‰ç©ºæ ¼ï¼Œè€Œä¸”ä»ç„¶å’Œ
Vi 兼容。以å‰çš„ Vim 版本里,任何的空白都å¯ä»¥ç”¨æ¥åˆ†éš”åŸŸã€‚å¦‚æžœä½ çš„æ–‡ä»¶ä¸ä½¿ç”¨å•个
制表分隔域,编辑 tags 文件,并执行下é¢çš„命令:
:%s/\(\S*\)\s\+\(\S*\)\s\+\(.*\)/\1\t\2\t\3/
改å˜çš„选项 *options-changed*
'errorfile' 的缺çœå€¼ä»Ž "errors.vim" 改为 "errors.err"ã€‚åŽŸå› æ˜¯åªæœ‰ Vim 脚本æ‰åº”
该有 ".vim" 扩展å。
":make" 命令ä¸åœ¨ä½¿ç”¨ 'errorfile' é€‰é¡¹ã€‚è¿™æ ·é¿å…了 ":make" 命令的输出覆盖手动ä¿
å˜çš„错误文件。":make" 使用 'makeef' 选项代替。它也å¯ä»¥äº§ç”Ÿå”¯ä¸€çš„åå—,防æ¢åŒæ—¶
è¿è¡Œçš„ ":make" 命令覆盖对方的文件。
'insertmode' ç½®ä½ä»¥åŽï¼Œæ›´å¤šçš„东西改å˜äº†:
- 普通模å¼é‡Œçš„ <Esc> 进入æ’入模å¼ã€‚
- æ’入模å¼é‡Œçš„ <Esc> ä¸é€€å‡ºæ’入模å¼ã€‚
- 执行 ":set im" 时,立å³è¿›å…¥æ’入模å¼ã€‚
'fileformat' (以剿˜¯ 'textmode' 选项) 和缓冲区的åˆå§‹æ ¼å¼ä¸åŒæ—¶ï¼ŒVim 把缓冲区当
作已改å˜ã€‚
å–æ¶ˆæ’入命令的 CTRL-B *i_CTRL-B-gone*
Vim ç¼–è¯‘æ—¶åŠ å…¥ |+rightleft| ç‰¹æ€§æ—¶ï¼Œä½ å¯ä»¥ä½¿ç”¨ CTRL-B åˆ‡æ¢ 'revins' 选项。ä¸å¹¸
的是,有的人想按 CTRL-V 或者 CTRL-N 的时候ä¸å°å¿ƒæŒ‰äº† 'B' 键,然åŽä¸çŸ¥é“怎么撤
销æ¤åŠŸèƒ½ã€‚å› ä¸ºåˆ‡æ¢ 'revins' 选项å¯ä»¥å¾ˆå®¹æ˜“用下é¢çš„æ˜ 射执行,CTRL-B 键的该功能
è¢«å–æ¶ˆäº†ã€‚为æ¤ç›®çš„ï¼Œä½ ä»ç„¶å¯ç”¨ CTRL-_ é”® |i_CTRL-_|。
:imap <C-B> <C-O>:set revins!<CR>
新 特 性 *new-5*
è¯æ³•高亮 *new-highlighting*
Vim 现在有了éžå¸¸çµæ´»çš„为所有文件件类型设定高亮的方å¼ã€‚
è§ |syntax|。一个å°ç»“:
:syntax on
è¯æ³•高亮å¯ä»¥è®¾ç½®è‰²å½©å’Œå±žæ€§ï¼Œä¹Ÿå¯ä»¥ç”¨ 'highlight' çš„ ':' æ ‡å¿—ä½ä¸ºå…¶å®ƒé«˜äº®é¡¹ç›®è®¾
置色彩和属性。所有的高亮项目被分é…了一个高亮组,它指定这些项目的高亮方å¼ã€‚è§
|:highlight|。缺çœé¢œè‰²ä¹Ÿæœ‰æ”¹è¿›ã€‚
ä½ å¯ä»¥ç”¨ "Normal" 组æ¥è®¾å®šè‰²å½©ç»ˆç«¯çš„缺çœå‰/背景色。对于 GUIï¼Œä½ åŒæ ·å¯ä»¥ä½¿ç”¨è¯¥
é“¸æ¥æŒ‡å®šå—体。
"2html.vim" 脚本å¯ä»¥ç”¨æ¥æŠŠä»»ä½•æœ‰è¯æ³•高亮的文件转化为 HTML。其ä¸çš„è‰²å½©å’Œä½ åœ¨
Vim çœ‹åˆ°çš„ä¸€æ¨¡ä¸€æ ·ã€‚ä½¿ç”¨ HTML æµè§ˆå™¨ï¼Œä½ å¯ä»¥æ‰“å°å½©è‰²çš„æ–‡ä»¶ã€‚
内建的脚本è¯è¨€ *new-script*
ä¸€äº›é™„åŠ çš„å‘½ä»¤å’Œè¡¨è¾¾å¼è®¡ç®—å™¨æ˜¯ä½ å¯ä»¥ç¼–写简å•但强大的脚本。命令包括 ":if" å’Œ
":while"。表达å¼å¯ä»¥å¤„ç†æ•°å€¼å’Œå—ç¬¦ä¸²ã€‚ä½ å¯ä»¥ç”¨ '=' 寄å˜å™¨æ¥ç›´æŽ¥æ’入表达å¼çš„结
æžœã€‚è§ |expression|。
Perl å’Œ Python æ”¯æŒ *new-perl-python*
Vim å¯ä»¥ç”¨ ":perldo"ã€":perl" ç‰è°ƒç”¨ Perl å‘½ä»¤ã€‚è§ |perl|。
è¡¥ä¸ç”± Sven Verdoolaege å’Œ Matt Gerassimoff æä¾›ã€‚
Vim å¯ä»¥ç”¨ ":python" å’Œ ":pyfile" 调用 Python å‘½ä»¤ã€‚è§ |python|。
两者都必须在编译时打开æ‰èƒ½å¾—到。
Win32 GUI 版本 *added-win32-GUI*
GUI 被移æ¤åˆ° MS Windows 95 å’Œ NT 上。Windows 用户现在å¯ä»¥ä½¿ç”¨ X11 GUI 的所有特
性了。|gui-w32|
这也修æ£äº†åœ¨ Windows 95 里è¿è¡Œ Win32 控制å°çš„问题,那里,控制å°çš„æ”¯æŒæ€»æ˜¯å¾ˆå·®ã€‚
è¿˜æœ‰ä¸€ä¸ªæ”¯æŒ OLE automation 接å£çš„版本。|if_ole.txt|
使用 VisVim DLL,Vim å¯ä»¥å’Œ Microsoft Developer Studio 集æˆã€‚
使用 Borland C++,å¯ä»¥äº§ç”Ÿ gvim çš„ DLL 版本 (Aaron)。
VMS 版本 *added-VMS*
Vim 现在å¯ä»¥ç”¨äºŽ VMS 系统。移æ¤ç”± Henk Elbers æä¾›ã€‚
还没有充分测试。但应该å¯ä»¥ç”¨äº†ã€‚
对ä¸èµ·ï¼Œæ²¡æœ‰æ–‡æ¡£ã€‚
BeOS 版本 *added-BeOS*
Vim å¯ä»¥ç”¨äºŽ BeOS 系统上 (包括 BeBox)。(Olaf Seibert)
è§ |os_beos.txt|。
Macintosh GUI 版本 *added-Mac*
Vim 现在å¯ä»¥ç”¨äºŽ Macintosh。(Dany St-Amant)
还没有充分测试,è¦å°å¿ƒï¼
è§ |os_mac.txt|。
和 Vi 更兼容 *more-compatible*
现在,有一个真æ£çš„ Ex 模å¼ã€‚以 "Q" 命令执行,或者å¯ç”¨å¯æ‰§è¡Œç¨‹åº "ex" 或
"gex"。|Ex-mode|
如果 'cpoptions' é‡ŒåŒ…å« 'u' æ ‡å¿—ä½ï¼Œå³ä½¿åœ¨ Vi 兼容模å¼é‡Œï¼Œä¹Ÿå…许多层撤销。
CTRL-R 用于é‡å¤æ’¤é”€æˆ–é‡åš (åƒ Nvi 里的 ".")。
ä»Žæ ‡å‡†è¾“å…¥è¯»å–输入 *read-stdin*
使用 "-" å‘½ä»¤è¡Œå‚æ•°æ—¶ï¼ŒVim ä»Žæ ‡å‡†è¾“å…¥è¯»å…¥æ–‡æœ¬è¾“å…¥ã€‚
è¿™å¯ä»¥ç”¨æ¥åœ¨ç®¡é“的末端使用 Vim:
grep "^a.*" *.c | vim -
è§ |--|。
æ£è§„è¡¨è¾¾å¼æ¨¡å¼ *added-regexp*
å¢žåŠ äº†æŒ‡å®šåŒ¹é…åŽŸåŒ¹é…æ¬¡æ•°çš„范围: "\{a,b}"。|/\{|
å¢žåŠ äº† "最çŸåŒ¹é…" æ£è§„è¡¨è¾¾å¼ "\{-}" (Webb)。
å¢žåŠ äº† "\s",匹é…空白å—符。å¯ä»¥æ›¿æ¢ "[ \t]"。 |/\s|
å¢žåŠ äº† "\S",匹é…éžç©ºç™½å—符,å¯ä»¥æ›¿æ¢ "[^ \t]"。|/\S|
é‡è½½çš„æ ‡ç¾ *tag-overloaded*
使用 C++ è¿™æ ·çš„è¯è¨€çš„æ—¶å€™ï¼Œå¯èƒ½æœ‰å¤šä¸ªæ ‡ç¾å¯¹åº”相åŒçš„æ ‡ç¾åã€‚å¢žåŠ äº†å‘½ä»¤ï¼Œå¯ä»¥è·³
转到任何一个é‡è½½çš„æ ‡ç¾:
|:tselect| 列出匹é…çš„æ ‡ç¾ï¼Œå¹¶è·³è½¬åˆ°å…¶ä¸ä¸€ä¸ªã€‚
|:stselect| åŒä¸Šï¼Œå¹¶åˆ†å‰²çª—å£ã€‚
|g_CTRL-]| ä½¿ç”¨å…‰æ ‡æ‰€åœ¨çš„å•è¯æ‰§è¡Œ ":tselect"。
":ta {tagname}" 如有多个匹é…,之åŽ:
|:tnext| 转到下一个匹é…çš„æ ‡ç¾ã€‚
|:tprevious| 转到å‰ä¸€ä¸ªåŒ¹é…çš„æ ‡ç¾ã€‚
|:trewind| 转到第一个匹é…çš„æ ‡ç¾ã€‚
|:tlast| 转到最åŽä¸€ä¸ªåŒ¹é…çš„æ ‡ç¾ã€‚
":tag" 命令现在也接å—通é…ç¬¦ã€‚æ‰§è¡Œå‘½ä»¤è¡Œæ ‡ç¾è¡¥å…¨æ—¶ï¼Œä¹Ÿå¯ä»¥ (在最åŽ) 使用大å°å†™
䏿•感的匹é…。
新命令 *new-commands*
|:amenu| 定义所有模å¼ä¸‹çš„èœå•,在æ’入模å¼é‡Œæ’å…¥ CTRL-O,å¯è§†æ¨¡å¼ä¸‹
ESC,命令行模å¼ä¸‹ CTRL-C。"amenu" 用于定义缺çœèœå•å’Œ Syntax èœ
å•。
|:augroup| 设置åŽé¢çš„自动命令使用的组。自动命令的编组å…许了指定组内部的åˆ
除。
|:crewind| 转到第一个错误。
|:clast| 转到最åŽä¸€ä¸ªé”™è¯¯ï¼Œ
|:doautoall| 在所有载入的缓冲区里执行自动命令。
|:echo| 回显表达å¼å‚数。å¯ä»¥ç”¨æ¥æ˜¾ç¤ºåŒ…å«å˜é‡çš„æ¶ˆæ¯ã€‚
|:execute| 执行表达å¼å‚数。å¯ä»¥ç”¨æ¥æž„é€ ä»»æ„çš„ Ex 命令。
|:hide| 和 ":close" 类似。
|:if| æ¡ä»¶æ‰§è¡Œï¼Œç”¨äºŽå†…建脚本è¯è¨€ã€‚
|:intro| æ˜¾ç¤ºä»‹ç»æ–‡å—。Vim å¯åЍå¼ï¼Œå¦‚æžœæ²¡æœ‰æ–‡ä»¶å‚æ•°ï¼Œæ€»æ˜¯æ‰§è¡Œå®ƒã€‚
|:let| 给内部å˜é‡èµ‹å€¼ã€‚
|:omap| åªç»™æ“作符ç‰å¾…模å¼å®šä¹‰æ˜ 射。从而å¯ä»¥æ˜ 射文本命令。
|:redir| 把消æ¯çš„输出é‡å®šå‘到文件里。
|:update| ç¼“å†²åŒºæ”¹å˜æ—¶å†™å›žã€‚
|:while| While 循环,用于内建脚本è¯è¨€ã€‚
å¯è§†æ¨¡å¼:
|v_O| å¯è§†åˆ—å—æ¨¡å¼é‡Œçš„ "O" æ°´å¹³ç§»åŠ¨å…‰æ ‡åˆ°å¦ä¸€ä¸ªè§’。
|v_D| å¯è§†åˆ—å—æ¨¡å¼é‡Œçš„ "D" åˆ åˆ°è¡Œå°¾ã€‚
æ’入模å¼:
|i_CTRL-]| 切æ¢ç¼©å†™ã€æ— é¡»æ’入任何å—符。
新选项 *added-options*
'background' 用于选择缺çœçš„高亮色。"syntax.vim" ä¹Ÿç”¨äºŽé€‰æ‹©è¯æ³•颜色。通常自
åŠ¨æ ¹æ®ä½¿ç”¨çš„终端自动设置。
'complete' 指定æ’入模å¼è¡¥å…¨å¦‚何完æˆã€‚
'eventignore' å¯ä»¥æš‚æ—¶å±è”½è‡ªåŠ¨å‘½ä»¤ã€‚
'fileformat' ç›®å‰çš„æ–‡ä»¶æ ¼å¼ã€‚替æ¢äº† 'textmode'。
'fileformats' ç›®å‰çš„æ–‡ä»¶æ ¼å¼åˆ—表。替æ¢äº† 'textauto'。
新的特点还包括对 Macintosh æ ¼å¼çš„æ”¯æŒ: å•个 <CR> 分隔行。
'fileformats' 在 MS-DOSã€Win32 å’Œ OS/2 çš„ç¼ºçœæ˜¯ "dos,unix",å³
使 'compatible' ç½®ä½ä¹Ÿæ˜¯å¦‚æ¤ã€‚Unix 类型的文件在 'fileformats'
ä¸ºç©ºçš„æ—¶å€™æ— è®ºå¦‚ä½•éƒ½æ— æ³•å·¥ä½œã€‚
'guicursor' è®¾ç½®å…‰æ ‡åœ¨ä¸åŒæ¨¡å¼é‡Œçš„形状和闪çƒã€‚缺çœä¸ºæ’å…¥å’Œæ›¿æ¢æ¨¡å¼å’Œç‰å¾…æ“
ä½œç¬¦æ—¶è°ƒæ•´å…‰æ ‡ã€‚ç¼ºçœä¹Ÿæ‰“开闪çƒã€‚
'fkmap' 波斯è¯é”®ç›˜æ˜ 射。
'hlsearch' 高亮所有的最近使用的æœç´¢æ¨¡å¼çš„匹é…。
'hkmapp' 'æ ¹æ®è¯»éŸ³çš„希伯æ¥è¯' æ˜ å°„ (Ilya Dogolazky)
'iconstring' 如果éžç©ºï¼Œå®šä¹‰å›¾æ ‡åå—。(5.2 版本: 按本义使用该å—ç¬¦ä¸²ï¼Œå¯æ˜¯ç”¨
æ¢è¡Œå»ºç«‹ä¸¤è¡Œã€‚)
'lazyredraw' 执行å®ã€å¯„å˜å™¨æˆ–其它ä¸é 输入的命令时,ä¸é‡ç”»å±å¹•。
'makeef' ":make" 使用的错误文件。"##" è¢«å”¯ä¸€çš„æ•°å—æ›¿æ¢ã€‚å¯ä»¥é¿å…两个
Vim 会è¯è¦†ç›–å½¼æ¤çš„错误文件的情况。Unix çš„ç¼ºçœæ˜¯
"/tmp/vim##.err";Amiga 是 "t:vim##.Err",其它 "vim##.err"。
'matchtime' 如果打开了 'showmatch',1/10 秒计算的括å·åŒ¹é…显示的时间。类似
于 Nvi。
'mousehide' 输入文本时éšè—é¼ æ ‡æŒ‡é’ˆã€‚
'nrformats' 定义使用 CTRL-A å’Œ CTRL-X 命令时 Vim 考虑的数值的基底。缺çœ
为: "hex,octal"。
'shellxquote' å›´ç»•æ•´ä¸ªå¤–å£³å‘½ä»¤çš„é™„åŠ å¼•å·ï¼ŒåŒ…括é‡å®šå‘。
'softtabstop' ä½¿å¾—è¾“å…¥çš„æ„Ÿè§‰å°±åƒ tabstop 设为æ¤å€¼ä¸€æ ·ï¼Œè€Œä¸ç”¨å®žé™…改å˜
'tabstop' çš„å€¼ã€‚ä½¿å¾—ä¿æŒ 'ts' 为 8 更简å•,而实际上输入 <Tab>
ä»ç„¶å¯ä»¥å¾—åˆ°å››ä¸ªç©ºæ ¼ã€‚
'titlestring' 如果éžç©ºï¼Œçª—壿 ‡é¢˜å—符串。(5.2 版本: 按本义使用该å—ç¬¦ä¸²ï¼Œå¯æ˜¯
用æ¢è¡Œå»ºç«‹ä¸¤è¡Œã€‚)
'verbose' 详细程度。å¯ä»¥ç”¨æ¥æ˜¾ç¤ºåˆå§‹åŒ–时使用了哪个 .vimrcã€.exrcã€
.viminfo 文件ç‰ç‰ã€‚也å¯ä»¥æ˜¾ç¤ºæ‰§è¡Œä¸çš„自动命令。也å¯ä»¥ç”¨ "-V"
å‘½ä»¤è¡Œå‚æ•°è®¾ç½®ã€‚
æ–°å‘½ä»¤è¡Œå‚æ•° *added-cmdline-args*
|-U| 指定è¦ç”¨çš„ gvimrc 文件。类似于指定 vimrc çš„ "-u"。
|-V| 设置 'verbose' 选项。比如 "vim -V10"。
|-N| 以éžå…¼å®¹æ¨¡å¼å¯åŠ¨ã€‚
|-C| 以兼容模å¼å¯åŠ¨ã€‚
|-Z| 以å—陿¨¡å¼å¯åŠ¨ï¼Œç¦æ¢å¤–壳命令。也å¯ä»¥ç”¨æ‰§è¡Œå¯æ‰§è¡Œç¨‹åº "rvim" 完
æˆã€‚
|-h| 显示使用信æ¯å¹¶é€€å‡ºã€‚
其它新增 *added-various*
å¢žåŠ äº†å’Œ SNiFF+ 连接的功能 (Toni Leherbauer æäº¤)。Vim å¯ä»¥ç”¨åš SNiFF 的编辑
器。没有文档...
è¦äº§ç”Ÿæ¼æ´žæŠ¥å‘Šï¼Œå¯ç”¨åŒ…å«çš„ bugreport.vim 脚本。
å¯ä»¥è¿™æ ·ä½¿ç”¨: ":so $VIMRUNTIME/bugreport.vim",它在当å‰ç›®å½•建立文件
"bugreport.txt"。|bugs|
":normal" å‘½ä»¤å¢žåŠ äº†èŒƒå›´ã€‚çŽ°åœ¨ä½ å¯ä»¥ä¸ºæŸèŒƒå›´å†…çš„æ¯è¡Œé‡å¤ç›¸åŒçš„命令。
|:normal-range|
åŠ å…¥äº†æ³¢æ–¯è¯çš„æ”¯æŒ (Shiran)ã€‚åªæœ‰åœ¨ç¼–译时打开æ‰èƒ½ä½¿ç”¨ã€‚è§ |farsi|。
性能:
- 如果设置了 'showcmd'ï¼Œæ˜ å°„çš„æ‰§è¡Œè¿‡åŽ»ä¼šæ…¢çš„å¤šï¼Œå› ä¸ºéœ€è¦é¢‘ç¹åˆ·æ–°è¾“å‡ºã€‚è¿™å¯¹ä½ æ‰§
行 "至关é‡è¦çš„" å®ä¸”需è¦ç½®ä½ 'showcmd' 时太有帮助了。
- 包å«äº†å…³äºŽæ ‡ç¾æ–‡ä»¶è¿›è¡ŒäºŒåˆ†æ³•查找的补ä¸ã€‚(David O'Neill)
å¯ä»¥é€šè¿‡å¤ä½ 'tagbsearch' 选项关é—。
- é‡å¤æ’å…¥æ—¶ï¼Œä¸æ›´æ–°æ ‡å°º (ä¼šæ˜¾è‘—å‡æ…¢)。
- Unix ä¸Šï¼Œæ–‡ä»¶åæ‰©å±•现在在内部完æˆäº†ï¼Œä¸ç”¨å¯åЍ外壳æ¥å¤„ç†ã€‚
- 用 expand_env() 扩展环境å˜é‡ï¼Œè€Œä¸ç”¨è°ƒç”¨å¤–壳。使得
":so $VIMRUNTIME/syntax/syntax.vim" 快的_多_了。
- å‡å°‘äº†å…‰æ ‡å®šä½çš„输出: 用 CR-LF ç§»åŠ¨åˆ°ä¸‹é¢æ•°è¡Œçš„å‰é¢æ•°åˆ—。使用 termios 时,ä¸
输出 CR 两次。
- ä¼˜åŒ–äº†å…‰æ ‡å®šä½ã€‚用 CRã€BS å’Œ NLï¼Œå¦‚æžœäº§ç”Ÿçš„ä»£ç æ¯”å…‰æ ‡ç»å¯¹å®šä½è¦çŸçš„è¯ã€‚
- é‡å¤æ’å…¥ "1000ii<Esc>" 时,关é—é‡ç”»ã€‚
- 使长行的 "d$" 或 "D" 快的多 (ä¸€æ¬¡åˆ é™¤æ‰€æœ‰çš„å—ç¬¦ï¼Œè€Œä¸æ˜¯ä¸€ä¸ªä¸€ä¸ªåˆ )。
- ç”¨åœ°ä¸€ä¸ªå—æ¯è®¿é—®é€‰é¡¹è¡¨ï¼Œè€Œä¸æ˜¯ä»Žå¤´å¼€å§‹æœç´¢ã€‚
- 使用 highlight_attr[]ï¼Œè€Œä¸æ˜¯ä»Ž 'highlight' å—符串里æœç´¢ï¼Œè¿™ä½¿è®¾ç½®ç‰¹æ®Šé«˜äº®å±ž
性快的多。
- é‡ç”»å…³é—æ—¶ï¼Œä¸æ˜¾ç¤ºæ¨¡å¼ã€‚
- è®¾ç½®é€‰é¡¹æ—¶ï¼Œåªæœ‰åœ¨éœ€è¦çš„æ—¶å€™æ‰é‡ç”»å±å¹•。
- é€šè¿‡ç¬¬ä¸€ä¸ªå—æ¯çš„æŸ¥æ‰¾è¡¨ï¼Œæé«˜ Ex 命令的性能。
选项:
'cinoptions' åŠ å…¥ 'g' æ ‡å¿—ä½ï¼Œç”¨äºŽ C++ 作用域定义。
'cpoptions' åŠ å…¥ 'E' æ ‡å¿—ä½: ç¦æ¢æŠ½å‡ºã€åˆ 除ç‰ä½œç”¨äºŽç©ºæ–‡æœ¬åŒºåŸŸã€‚缺çœå…许抽
å‡ºç©ºåŒºåŸŸã€‚å¦‚æžœåŒ…å« 'E',在空行上 "y$" 现在被处ç†ä¸ºé”™è¯¯ (Vi å…¼
容)。
åŠ å…¥ 'j' æ ‡å¿—ä½: 连接åªåœ¨ '.' 之åŽï¼Œè€Œä¸æ˜¯ '?' 或 '!' 之åŽåŠ å…¥
ä¸¤ä¸ªç©ºæ ¼ã€‚
åŠ å…¥ 'A' æ ‡å¿—ä½: ä¸ç»™å‡º ATTENTION 消æ¯ã€‚
åŠ å…¥ 'L' æ ‡å¿—ä½: 如果ä¸ç»™å‡ºå¹¶ä¸”ç½®ä½äº† 'list','textwidth' 排版
å¦‚åŒæ²¡æœ‰ç½®ä½ 'list' é‚£æ ·ã€‚
åŠ å…¥ 'W' æ ‡å¿—ä½: 使 ":w!" 的行为类似 Vi: ä¸è¦†ç›–åªè¯»æ–‡ä»¶æˆ–者别
人拥有的文件。
'highlight' åŠ å…¥ '@' æ ‡å¿—ä½ï¼Œç”¨äºŽç½®ä½ 'list' 时,å±å¹•最åŽä¸€è¡Œä¹‹åŽçš„ '@' å—
符和行尾的 '$'。
åŠ å…¥ 'i' æ ‡å¿—ä½: 设置 'incsearch' 的高亮。缺çœä½¿ç”¨ "IncSearch"
高亮组,它是 "Visual" 的链接。
ä¸å†å…许 'highlight' çš„ 'h' æ ‡å¿—ä½ (3.0 之åŽå°±ä¸å†ç”¨äº†)。
'guifont' ä»…é™äºŽ Win32 GUI: 设置为 "*" 时弹出å—体请求器。
'guipty' 缺çœå¤šï¼Œå› 为太多人需è¦å®ƒäº†ã€‚
'path' å¯ä»¥åŒ…å«é€šé…符,"**" å¯ç”¨äºŽæœç´¢æ•´ä¸ªæ ‘。
'shortmess' åŠ å…¥ 'I' æ ‡å¿—ä½å·²é¿å…ä»‹ç»æ–‡å—。
'viminfo' åŠ å…¥ '%' æ ‡å¿—ä½: 在 viminfo 文件里ä¿å˜ç¼“冲区列表。
- æé«˜äº† 'maxmem' å’Œ 'maxmemtot' 在 Unix å’Œ Win32 上的缺çœå€¼ã€‚许多机器现在有更
多的 RAMï¼Œå› ä¸ºä»·é’±ä¾¿å®œå¤šäº†ã€‚
- 实现了 ":set all&",设置所有选项为其缺çœå€¼ã€‚|:set|
äº¤æ¢æ–‡ä»¶:
- ä¸ä¸ºåªè¯»æ–‡ä»¶å»ºç«‹äº¤æ¢æ–‡ä»¶ã€‚åªæœ‰åœ¨ç¬¬ä¸€æ¬¡ä¿®æ”¹æ—¶ï¼Œæˆ–在需è¦çš„内å˜å¤ªé«˜çš„æ—¶å€™å»ºç«‹äº¤
æ¢æ–‡ä»¶ã€‚|swap-file|
- 如有å¯èƒ½ï¼Œä½¿å¾—äº¤æ¢æ–‡ä»¶ "éšè—"。Unix ä¸Šæ˜¯é€šè¿‡åœ¨äº¤æ¢æ–‡ä»¶å‰é™„åŠ å¥å·å®Œæˆçš„。如果
使用长文件å,DJGPP å’Œ Win32 版本也在å‰é¢é™„åŠ å¥å·ï¼Œè¿™æ ·åœ¨ç¼–辑 Unix 文件系统
上装载的文件时就有效果了。|:swapname| MSDOS 上,_ä¸_éšè—æ–‡ä»¶å±žæ€§ï¼Œå› ä¸ºè¿™ä¼š
导致 share.exe 的问题。
- 'updatecount' ç¼ºçœæ€»æ˜¯éžé›¶ï¼Œå³ä½¿åœ¨ Vi 兼容模å¼ä¹Ÿæ˜¯å¦‚æ¤ã€‚
è¿™æ„å‘³ç€æ€»ä¼šæœ‰äº¤æ¢æ–‡ä»¶ï¼Œå®ƒå¯ä»¥ç”¨æ¥æ¢å¤ã€‚
æ ‡ç¾:
- 包å«äº† ctags 2.0 (Darren Hiebert)ã€‚é™æ€æ ‡ç¾çš„è¯æ³•从
{tag}:{fname} {fname} {command}
改为
{tag} {fname} {command};" file:
è¿™æ ·ï¼Œåˆ†æžæ›´å¿«ï¼Œæ›´çŸï¼Œè€Œä¸”å’Œ Vi 兼容。ä»ç„¶æŽ¥å—æ—§çš„æ ¼å¼ï¼Œé™¤éžåœ¨ src/feature.h
é‡Œå…³é— (è§ OLD_STATIC_TAGS)。|tags-file-format|
- æ ‡ç¾çš„补全现在也包å«äº†å…¶å®ƒæ–‡ä»¶çš„陿€æ ‡ç¾ï¼Œæ”¾åœ¨æœ€åŽã€‚
- 包å«äº† Stephen Riehm çš„ "shtags"。
- å¯»æ‰¾æ ‡ç¾åŒ¹é…但文件ä¸å˜åœ¨æ—¶ï¼Œç»§ç»å¯»æ‰¾ä¸‹ä¸€ä¸ªåŒ¹é…。有助于为ä¸åŒç‰ˆæœ¬çš„æºä»£ç 使用
相åŒçš„æ ‡ç¾æ–‡ä»¶ (通过链接)。
- 和其它文件的全局匹é…ç›¸æ¯”ï¼Œç»™å½“å‰æ–‡ä»¶çš„å…¨å±€æ ‡ç¾åŒ¹é…更高优先级。
åŒ…å« xxd V1.8 版本 (Juergen Weigert)。
自动命令:
- VimLeave 自动命令å†å†™å…¥ viminfo æ–‡ä»¶ä¹‹åŽæ‰§è¡Œï¼Œè€Œä¸æ˜¯åœ¨å®ƒä¹‹å‰ã€‚|VimLeave|
- å…许在执行自动命令时修改之。å¯ç”¨äºŽè‡ªä¿®æ”¹çš„自动命令。(Goldberg 的想法)
- 使用两个或更多模å¼çš„自动命令时,ä¸èƒ½æŠŠ ":if/:endif" 分到两行上。现在所有匹é…
的自动命令在一个 do_cmdline() 里执行。
- 自动命令ä¸å†æ”¹å˜ "." é‡å¤çš„命令。
- æ‰§è¡Œè‡ªåŠ¨å‘½ä»¤ä¹‹åŽæ¢å¤æœç´¢æ¨¡å¼ã€‚则é¿å…了自动命令弄乱了 'hlsearch' 高亮。
- è¯•å›¾æ‰§è¡Œè‡ªåŠ¨å‘½ä»¤æ—¶ï¼ŒåŒæ—¶å°è¯•ç”¨çŸæ–‡ä»¶ååŒ¹é…æ¨¡å¼ã€‚æœ‰åŠ©äºŽçŸæ–‡ä»¶å和长文件åä¸åŒ
çš„åœºåˆ (扩展åŽçš„符å·é“¾æŽ¥)。|autocmd-patterns|
- 使得 ":autocmd" 的输出更çŸä¸”更好。
- ":autocmd" 在定义时扩展 <sfile>。|<sfile>|
- ":autocmd" åŠ å…¥ "nested" æ ‡å¿—ä½ï¼Œå…许嵌套。|autocmd-nested|
- ":autocmd" åŠ å…¥ [group] 傿•°ã€‚覆盖目å‰è®¾ç½®çš„组。 |autocmd-groups|
- 新事件:
|BufUnload| 缓冲区å¸è½½å‰
|BufDelete| ç¼“å†²åŒºä»Žç¼“å†²åŒºåˆ—è¡¨åˆ é™¤å‰
|FileChangedShell| 执行外壳命令åŽï¼Œæ–‡ä»¶ä¿®æ”¹æ—¶é—´è¢«æ”¹å˜
|User| 用户定义的自动命令
- 如果 BufRead* 自动命令置ä½äº† 'modified',过去在它之åŽåˆä¼šå¤ä½ã€‚现在会记ä½
":set modified"。
GUI:
- 改进 GUI 滚动æ¡åœ¨é‡ç”»æ¯”产生滚动事件时的处ç†ã€‚
- "vim -u NONE" 现在也ä¸å†è½½å…¥ .gvimrc 和其它 GUI åˆå§‹åŒ–设置。|-u|
用 "-U" æ¥ä½¿ç”¨åˆ«çš„ gvimrc 文件。|-U|
- 处ç†å¤–部命令的 CTRL-Cï¼Œä¹ŸåŒ…æ‹¬æ”¯æŒ "setsid()" 的系统。
- å¯åЍ GUI 时,é™åˆ¶çª—å£å¤§å°ä¸ºå±å¹•大å°ã€‚
- 缺çœèœå•从 $VIMRUNTIME/menu.vim 里读入。这使得缺çœèœå•å¯ä»¥å®šåˆ¶ã€‚|menu.vim|
- 改进缺çœèœå•ã€‚åŠ å…¥ File/Printã€Window èœå•ã€Syntax èœå•ç‰ç‰ã€‚
- åŠ å…¥ ":menu" 命令的优先级。现在æ¯ä¸ªèœå•å¯ä»¥æ”¾åœ¨ä½ 想è¦çš„地方,和èœå•定义的顺
åºç›¸äº’独立。|menu-priority|
在 Windows 95 上è¿è¡Œ Win32 控制å°ç‰ˆæœ¬æ—¶ï¼Œä»‹ç»æ–‡å—å±å¹•给出è¦å‘Šï¼Œå› 为在 Windows
95 上è¿è¡Œæ¤ç‰ˆæœ¬ä¼šæœ‰é—®é¢˜ã€‚|win32-problems|
":substitute" åŠ å…¥ 'e' æ ‡å¿—ä½: 找ä¸åˆ°åŒ¹é…ä¸ä¼šæŠ±æ€¨ (Campbell)。|:s|
æ˜ å°„ä¸ä½¿ç”¨æœç´¢å‘½ä»¤æ—¶ï¼ŒåªæŠŠæœ€åŽä¸€ä¸ªä¿å˜è¿›åކå²ã€‚é¿å…è¿‡é•¿çš„æ˜ å°„æ»¥ç”¨åŽ†å²ã€‚
检查å¯åŠ¨æ¨¡å¼æ—¶ï¼Œå¿½ç•¥ "ex"ã€"view" å’Œ "gvim" 之åŽçš„æ‰€æœ‰å—符。å¯ç”¨æ¥ä½¿ç”¨ "gvim5"
ç‰åå—。|gvim| "gview" å¯åЍåªè¯»æ¨¡å¼çš„ GUI。|gview|
调整窗å£å¤§å°æ—¶ï¼Œå°½å¯èƒ½ä½¿å…‰æ ‡çš„相对ä½ç½®ä¿æŒä¸å˜ã€‚(Webb)
":all" å’Œ ":ball" ä¸å†ä¸ºåŒä¸€ç¼“冲区关é—ç„¶åŽç„¶åŽæ‰“开窗å£ã€‚é¿å…选项ã€è·³è½¬è¡¨å’Œå…¶å®ƒ
ä¿¡æ¯çš„丢失。
现在如果 Vim 编译时ä¸å¸¦ GUI,忽略 "-f" å‘½ä»¤è¡Œå‚æ•°ã€‚|-f|
å¯è§†åˆ—å—æ¨¡å¼é‡Œï¼Œé¼ æ ‡å³é”®é€‰æ‹©æœ€è¿‘的一角。
修改了 DOS ç‰çš„ç¼ºçœæ˜ å°„ã€‚åˆ é™¤ DOS ä¸“ç”¨çš„æ˜ å°„ï¼Œç”¨ Windows 的那些就å¯ä»¥äº†ã€‚åŠ å…¥
Shift-Insertã€Ctrl-Insertã€Ctrl-Del å’Œ Shift-Del。
修改 ":jumps" 输出的编å·ï¼Œä½¿ä½ èƒ½å¤Ÿçœ‹è§ {count} CTRL-O 到哪里。|:jumps|
用 "~" 代替 $HOME 现在适用于所有系统。|$HOME|
Unix: 除了 CTRL-C 以外,也å¯ç”¨ tty 设置的 INTR å—符。有人把 INTR 设为 DEL。
å…许 ":help" 命令傿•°é‡Œçš„ <LF> 结æŸå¸®åŠ©å‘½ä»¤ï¼Œä»Žè€Œå¯ä»¥è·Ÿéšä¸‹ä¸€ä¸ªå‘½ä»¤ã€‚
" #if" 开头的行上按 "%" 过去ä¸è·³è½¬åˆ°åŒ¹é…çš„ "#else"。
'cpo' åŒ…å« '%' 时,'%' ä¸è¯†åˆ« "#if"ã€"#else" ç‰ã€‚|%|
改进了用 "CTRL-N"ã€"CTRL-P" å’Œ "CTRL-X" çš„æ’å…¥æ¨¡å¼æ‰©å±• |ins-completion|:
- åŠ å…¥ 'complete' 选项。
- ç½®ä½ 'nowrapscan' è€Œæ²¡æœ‰åŒ¹é…æ—¶ï¼Œé”™è¯¯ä¿¡æ¯é‡ŒæŠ¥å‘Šæœç´¢çš„æ–¹å‘。
- é‡å¤æ‰§è¡Œ CTRL-X å‘½ä»¤åŠ å…¥åŒ¹é…之åŽçš„å•è¯/行。
- åŠ å…¥æ‰©å±•æ—¶ï¼ŒæŽ¥å—å•个å—符的匹é…。
- é‡å¤çš„ CTRL-X CTRL-N ä¸æŠŠæ’¤é”€æ–å¼€ï¼Œè¿™æ · "." 会é‡å¤æ•´ä¸ªæ’入过程。也修æ£äº†ä¸èƒ½
在用 CTRL-N æ’入的å•è¯ä¸Šé€€æ ¼çš„问题。
æ’入模å¼ç”¨ CTRL-E 或 CTRL-Y 从上/下行å¤åˆ¶å—符时,ä¸å†ä½¿ç”¨ 'textwidth'。
|i_CTRL-E|
åœ¨å‚æ•°è¡¨å†…移动的命令,如 ":n" å’Œ ":rew"ï¼Œä¿æŒæ–‡ä»¶åŽŸæœ‰çš„å…‰æ ‡ä½ç½®ã€‚(主è¦ä¸ºäº†å’Œ
Vi 兼容)。
Vim çŽ°åœ¨è®°ä½æ¯ä¸ªç¼“冲区的 '< å’Œ '> ä½ç½®æ ‡è®°ã€‚ä¿®æ£äº†åœ¨ä¸€ä¸ªç¼“å†²åŒºåˆ é™¤è¡ŒåŽä½¿å¦ä¸€ç¼“
冲区的 '< å’Œ '> ä½ç½®æ ‡è®°éžæ³•的问题。|'<|
MSDOSã€Unix å’Œ OS/2: 如果没有设置 $VIMï¼Œä½¿ç”¨å¯æ‰§è¡Œæ–‡ä»¶çš„è·¯å¾„ã€‚ç”¨å¯æ‰§è¡Œæ–‡ä»¶è·¯å¾„
代替 $VIM 时如果å˜åœ¨ "src/"ï¼Œåˆ é™¤ä¹‹ã€‚ç¼–è¯‘åŽç›´æŽ¥è¿è¡Œ Vim 时,这个方法使得 Vim
å¯ä»¥æ‰¾åˆ°æ–‡æ¡£å’Œè¯æ³•文件。|$VIM|
用 <Esc> 退出å¯è§†æ¨¡å¼æ—¶ï¼Œå…‰æ ‡ä½äºŽå¯è§†åŒºåŸŸå¼€å§‹å¤„ (å°±åƒæ‰§è¡Œæ“作符之åŽçš„æƒ…况)。
Win32 å’Œ Unix 版本: åˆ é™¤å¤–éƒ¨å‘½ä»¤çš„ 1100 å—符é™åˆ¶ã€‚
åŠ å…¥ ":edit +command" 傿•°åŒ…å«ç©ºæ ¼çš„å¯èƒ½æ€§ã€‚在它之å‰åŠ ä¸Šåæ–œæ 。|+cmd|
æ¢å¤åŽï¼Œæä¾› BufReadPost 自动命令。|:recover|
åŠ å…¥ "os2ansi",OS/2 控制å°ï¼Œçš„色彩支æŒã€‚(Slootman) |os2ansi|
% ä¸ºç©ºä¹Ÿèƒ½æŽ¥å— "%:p:h"。|:_%|
åŒ…å« "<sfile>": ":source" 命令的文件å。|<sfile>|
åŠ å…¥ "<Bslash>" 特殊å—符。有助于é¿å…æ˜ å°„å’Œèœå•里的多é‡åæ–œæ 。
帮助窗å£é‡Œï¼ŒåŒå‡»è·³è½¬åˆ°å…‰æ ‡æ‰€åœ¨çš„æ ‡ç¾ (类似 CTRL-])。
<C-Left> å’Œ <C-Right> 现在和 <S-Left> å’Œ <S-Right> 类似,æ£å‘/åå‘移动一个å•è¯
(和 Windows 兼容),|<C-Left>|
åˆ é™¤ .vimrc 文件对 ":version" 命令的需è¦ã€‚没有任何用处。用 ":if" å¯ä»¥å¤„ç†ç‰ˆæœ¬
间的差异。|:version|
MS-DOSã€Win32 å’Œ OS/2: 自动命令比较文件时,ä¸åŒºåˆ«è·¯å¾„分隔符 '/' å’Œ '\'。
新的 termcap 选项:
"mb": é—ªçƒã€‚åªèƒ½èµ‹äºˆå…¶å®ƒé«˜äº®é€‰é¡¹ä¹‹ä¸€ã€‚|t_mb|
"bc": é€€æ ¼å—符。|t_bc|
"nd": GUI 上用于å‘å³ç§»åŠ¨å…‰æ ‡ï¼Œé¿å…åˆ é™¤ä»Žæœ€åŽä¸€ä¸ªç²—体å—符开始的整行åƒç´ 行。
|t_nd|
"xs": 对 hpterm 而言,高亮ä¸ç”¨è¦†ç›–æ¥åˆ 除。和 'weirdinvert' 组åˆä½¿ç”¨ã€‚hpterm 现
在å¯ä»¥ç”¨å¯è§†æ¨¡å¼äº†ã€‚|t_xs|
Unix: è¡¥ä¸å’Œå¤‡ä»½æ–‡ä»¶çš„æ—¶é—´è®¾ç½®ä¸ºå’ŒåŽŸæ¥æ–‡ä»¶ç›¸åŒçš„æ—¶é—´ã€‚(Hiebert).
Amiga: QuickFix 模å¼ä¸å†æ‰“å¼€å¦ä¸€ä¸ªçª—å£ã€‚现在å¯ä»¥ç”¨å¤–壳命令。
åŠ å…¥ David Binette çš„ decmouse è¡¥ä¸ã€‚åªè¦ç¼–译时打开。现在å¯ä»¥ä½¿ç”¨ Dec å’Œ
Netterm é¼ æ ‡ã€‚
åŠ å…¥ '#' 寄å˜å™¨: è½®æ¢æ–‡ä»¶å |quote#|。":dis" 命令显示 '#' 寄å˜å™¨ã€‚|:display|
Unix 上从 'isfname' 的缺çœå€¼é‡Œåˆ 除 ':'。总是检查文件å里的 "://"。MS-DOS 也检
查 ":\\"。
"K"eyword å‘½ä»¤åŠ å…¥è®¡æ•°ï¼Œå¦‚æžœ 'keywordprg' 为 "man",计数æ’å…¥ man 命令。"2K" 产
生 "!man 2 <cword>"。|K|
相对路径å上用 "gf" åˆ é™¤æ–‡ä»¶å里的 "../"ï¼Œå’Œæ ‡ç¾æ–‡ä»¶é‡Œå¯¹æ–‡ä»¶å的处ç†ç›¸åŒã€‚|gf|
结æŸçºªå½•æ—¶ï¼Œä¸æŠŠè®°å½•çš„å¯„å˜å™¨è®¾ç½®ä¸ºæ”¾ç½® (put) 用的缺çœå¯„å˜å™¨ã€‚
使用 "!!" æ—¶ï¼Œå‘½ä»¤è¡Œä¸Šä¸æ”¾ ":5,5!",而是 ":.!"。还有一些改进,å¯èƒ½çš„æƒ…况下把具
ä½“çš„è¡Œå·æ¢æˆ "." 或 "$"。
MSDOS ç‰: $VIM/viminfo æ¢å为 $VIM/_viminfo。和下é¢è¿™äº›æ›´ä¸€è‡´: .vimrc/_vimrc
和 .viminfo/_viminfo
文件å大å°å†™ä¸æ•感的系统 (MSDOSã€Amiga) ä¸Šï¼Œç»™æ–‡ä»¶åæŽ’åºæ—¶å¿½ç•¥å¤§å°å†™ã€‚也包括缓
冲区的åå—。
ä»Žæ ‡å‡†è¾“å…¥è¯»å–å¦‚æžœå¤±è´¥ï¼Œæ”¹ä¸ºä»Žæ ‡å‡†é”™è¯¯è¯»å– (å¯ç”¨äºŽ "foo | xargs vim")。
32 ä½ MS-DOS 版本: 把 csdpmi3 改为 csdpmi4。
<C-Left> å’Œ <C-Right> 改为跳过å—串 (WORD) è€Œä¸æ˜¯å•è¯ (word)。
Unix 之外的系统现在也支æŒè¦†ç›–文件时关于修改时间被改å˜çš„è¦å‘Šã€‚
Unix: 修改 configure 的缺çœï¼Œä½¿ä¹‹å’Œ Makefile 的缺çœä¸€è‡´: 这包括 GUIã€Perl å’Œ
Python ç‰æ–¹é¢ã€‚
一些 Motif çš„ç‰ˆæœ¬éœ€è¦ "-lXpm"。configure æ—¶åŠ å…¥è¿™æ–¹é¢çš„æ£€æŸ¥ã€‚
link 行ä¸åŠ å…¥ "-L/usr/lib",一些系统å¯èƒ½æœ‰é—®é¢˜ã€‚
编译时,å…许通过修改 src/feature.h 的一行,简å•的选择 minimalã€normal 还是
maximal 特性包。
DOS16 版本使用 minimal 特性包编译,以å…内å˜å¤ªå¿«æº¢å‡ºã€‚|dos16|
Win32ã€DJGPP å’Œ OS/2 版本使用 maximal ç‰¹æ€§åŒ…ï¼Œå› ä¸ºå®ƒä»¬æœ‰è¶³å¤Ÿçš„å†…å˜ã€‚
Amiga å¯ä»¥æœ‰ normal å’Œ maximal 特性包的ä¸åŒç‰ˆæœ¬ã€‚
在 Unix 版本的 Makefile é‡ŒåŠ ä¸Šäº† "make test"。å…许快速检查是å¦å¤šæ•° "普通" 命令
å¯ä»¥æ£ç¡®å·¥ä½œã€‚也测试一些特定的命令。
DJGPP ç‰ˆæœ¬é‡Œï¼ŒåŠ å…¥ setlocale() 支æŒä»£ç 页。
autoconf:
- autoconf å¢žåŠ -lXdmcp 检查。
- åŒ…å« -lXmu 的检查,为æ¤ä¸å†éœ€è¦ç¼–辑 Makefile。
- 切æ¢åˆ° autoconf 2.12。
- configure å¢žåŠ å¯¹ <poll.h> 的检查。Linux ä¸ŠåŒ…å« Perl 的时候看æ¥éœ€è¦ï¼Ÿ
- 现在,在 termcap 之剿£€æŸ¥ termlib。
- configure å¢žåŠ å¯¹ strncasecmp()ã€stricmp() å’Œ strnicmp() æ£€æŸ¥ã€‚åŠ å…¥
vim_stricmp(),如果没有 stricmp() 库函数的è¯ã€‚
- 在 configure 里使用 "datadir"ï¼Œè€Œä¸æ˜¯æˆ‘们自己对 HELPDIR 的检查。
从 Makefile.manx é‡Œåˆ é™¤ "make proto"。没有很多的 #ifdefï¼Œæ— æ³•ä½¿å®ƒå·¥ä½œã€‚
从 proto.h çš„ paths é‡Œåˆ é™¤ "proto/"。Mac ç§»æ¤ç‰ˆæœ¬éœ€è¦å¦‚æ¤ã€‚
Makefile.mint è¿›è¡Œäº†å¤§æ”¹åŠ¨ã€‚çŽ°åœ¨å®ƒåŒ…å« Unix Makefile。
Makefile.b32 åŠ äº† Dos16 çš„æ”¯æŒ (Makefile.b32 æ¢å为 Makefile.bor)。
所有的æºç¨‹åºçŽ°åœ¨ç¼–è¾‘æ—¶ä½¿ç”¨ tabstop 为 8 è€Œä¸æ˜¯ 4,对于调试和其它工具的使用,这
æ ·æ›´åˆé€‚。为了方便编辑。'softtabstop' 设为 4。
Unix: åŠ å…¥ "link.sh" 脚本,它从 link å‘½ä»¤é‡Œåˆ é™¤ä¸€äº›ä¸å¿…è¦çš„库。
缺çœï¼ŒHPUX 上ä¸ä½¿ç”¨äºŒåˆå—æ¯ã€‚除éžå®šä¹‰äº† HPUX_DIGRAPHS æ‰å¦‚æ¤ã€‚
|digraphs-default|
注æ„: è¿™äº›ä¿®æ£æœ‰çš„åªé€‚用于 4.6 之åŽä½†åœ¨ 5.0 之å‰çš„æµ‹è¯•版。
When doing ":bdel", try going to the next loaded buffer. Don't rewind to the
start of the buffer list.
mch_isdir() for Unix returned TRUE for "" on some systems.
Win32: 'shell' set to "mksnt/sh.exe" breaks ":!" commands. Don't use
backslashes in the temp file names.
On linux, with a FAT file system, could get spurious "file xxx changed since
editing started" messages, because the time is rounded off to two seconds
unexpectedly.
Crash in GUI, when selecting a word (double click) and then extend until an
empty line.
For systems where isdigit() can't handle characters > 255, get_number() caused
a crash when moving the mouse during the prompt for recovery.
In Insert mode, "CTRL-O P" left the cursor on the last inserted character.
Now the cursor is left after the last putted character.
When quickfix found an error type other than 'e' or 'w', it was never printed.
A setting for 'errorfile' in a .vimrc overruled the "-q errorfile" argument.
Some systems create a file when generating a temp file name. Filtering would
then create a backup file for this, which was never deleted. Now no backup
file is made when filtering.
simplify_filename() could remove a ".." after a link, resulting in the wrong
file name. Made simplify_filename also work for MSDOS. Don't use it for
Amiga, since it doesn't have "../".
otherfile() was unreliable when using links. Could think that reading/writing
was for a different file, when it was the same.
Pasting with mouse in Replace mode didn't replace anything.
Window height computed wrong when resizing a window with an autocommand (could
cause a crash).
":s!foo!bar!" wasn't possible (Vi compatible).
do_bang() freed memory twice when called recursively, because of autocommands
(test11). Thanks to Electric Fence!
"v$d" on an empty line didn't remove the "-- VISUAL --" mode message from the
command-line, and inverted the cursor.
":mkexrc" didn't check for failure to open the file, causing a crash.
(Felderhoff).
Win32 mch_write() wrote past fixed buffer, causing terminal keys no longer to
be recognized. Both console and GUI version.
Athena GUI: Crash when removing a menu item. Now Vim doesn't crash, but the
reversing of the menu item is still wrong.
Always reset 'list' option for the help window.
When 'scrolloff' is non-zero, a 'showmatch' could cause the shown match to be
in the wrong line and the window to be scrolled (Acevedo).
After ":set all&", 'lines' and 'ttytype' were still non-default, because the
defaults never got set. Now the defaults for 'lines' and 'columns' are set
after detecting the window size. 'term' and 'ttytype' defaults are set when
detecting the terminal type.
For (most) non-Unix systems, don't add file names with illegal characters when
expanding. Fixes "cannot open swapfile" error when doing ":e *.burp", when
there is no match.
In X11 GUI, drawing part of the cursor obscured the text. Now the text is
drawn over the cursor, like when it fills the block. (Seibert)
when started with "-c cmd -q errfile", the cursor would be left in line 1.
Now a ":cc" is done after executing "cmd".
":ilist" never ignored case, even when 'ignorecase' set.
"vim -r file" for a readonly file, then making a change, got ATTENTION message
in insert mode, display mixed up until <Esc> typed. Also don't give ATTENTION
message after recovering a file.
The abbreviation ":ab #i #include" could not be removed.
CTRL-L completion (longest common match) on command-line didn't work properly
for case-insensitive systems (MS-DOS, Windows, etc.). (suggested by Richard
Kilgore).
For terminals that can hide the cursor ("vi" termcap entry), resizing the
window caused the cursor to disappear.
Using an invalid mark in an Ex address didn't abort the command.
When 'smarttab' set, would use 'shiftround' when inserting a TAB after a
space. Now it always rounds to a tabstop.
Set '[ and '] marks for ":copy", ":move", ":append", ":insert", ":substitute"
and ":change". (Acevedo).
"d$" in an empty line still caused an error, even when 'E' is not in
'cpoptions'.
Help files were stored in the viminfo buffer list without a path.
GUI: Displaying cursor was not synchronized with other displaying. Caused
several display errors. For example, when the last two lines in the file
start with spaces, "dd" on the last line copied text to the (then) last line.
Win32: Needed to type CTRL-SHIFT-- to get CTRL-_.
GUI: Moving the cursor forwards over bold text would remove one column of bold
pixels.
X11 GUI: When a bold character in the last column was scrolled up or down, one
column of pixels would not be copied.
Using <BS> to move the cursor left can sometimes erase a character. Now use
"le" termcap entry for this.
Keyword completion with regexp didn't work. e.g., for "b.*crat".
Fixed: With CTRL-O that jumps to another file, cursor could end up just after
the line.
Amiga: '$' was missing from character recognized as wildcards, causing $VIM
sometimes not to be expanded.
":change" didn't adjust marks for deleted lines.
":help [range]" didn't work. Also for [pattern], [count] and [quotex].
For 'cindent'ing, typing "class::method" doesn't align like a label when the
second ':' is typed.
When inserting a CR with 'cindent' set (and a bunch of other conditions) the
cursor went to a wrong location.
'cindent' was wrong for a line that ends in '}'.
'cindent' was wrong after "else {".
While editing the cmdline in the GUI, could not use the mouse to select text
from the command-line itself.
When deleting lines, marks in tag stack were only adjusted for the current
window, not for other windows on the same buffer.
Tag guessing could find a function "some_func" instead of the "func" we were
looking for.
Tags file name relative to the current file didn't work.
":g/pat2/s//pat2/g", causing the number of subs to be reported, used to cause
a scroll up. Now you no longer have to hit <CR>.
X11 GUI: Selecting text could cause a crash.
32 bit DOS version: CTRL-C in external command killed Vim. When SHELL is set
to "sh.exe", external commands didn't work. Removed using of command.com, no
longer need to set 'shellquote'.
Fixed crash when using ":g/pat/i".
Fixed (potential) crash for X11 GUI, when using an X selection. Was giving a
pointer on the stack to a callback function, now it's static.
Using "#" and "*" with an operator didn't work. E.g. "c#".
Command-line expansion didn't work properly after ":*". (Acevedo)
Setting 'weirdinvert' caused highlighting to be wrong in the GUI.
":e +4 #" didn't work, because the "4" was in unallocated memory (could cause
a crash).
Cursor position was wrong for ":e #", after ":e #" failed, because of changes
to the buffer.
When doing ":buf N", going to a buffer that was edited with ":view", the
readonly flag was reset. Now make a difference between ":e file" and ":buf
file": Only set/reset 'ro' for the first one.
Avoid |hit-enter| prompt when not able to write viminfo on exit.
When giving error messages in the terminal where the GUI was started, GUI
escape codes would be written to the terminal. In an xterm this could be seen
as a '$' after the message.
Mouse would not work directly after ":gui", because full_screen isn't set,
which causes starttermcap() not to do its work.
'incsearch' did not scroll the window in the same way as the actual search.
When 'nowrap' set, incsearch didn't show a match when it was off the side of
the screen. Now it also shows the whole match, instead of just the cursor
position (if possible).
":unmap", ":unab" and ":unmenu" did not accept a double quote, it was seen as
the start of a comment. Now it's Vi compatible.
Using <Up><Left><Left><Up> in the command-line, when there is no previous
cmdline in the history, inserted a NUL on the command-line.
"i<Esc>" when on a <Tab> in column 0 left the cursor in the wrong place.
GUI Motif: When adding a lot of menu items, the menu bar goes into two rows.
Deleting menu items, reducing the number of rows, now also works.
With ":g/pat/s//foo/c", a match in the first line was scrolled off of the
screen, so you could not see it.
When using ":s//c", with 'nowrap' set, a match could be off the side of the
screen, so you could not see it.
When 'helpfile' was set to a fixed, non-absolute path in feature.h, Vim would
crash. mch_Fullname can now handle file names in read-only memory. (Lottem)
When using CTRL-A or CTRL-@ in Insert mode, there could be strange effects
when using CTRL-D next. Also, when repeating inserted text that included "0
CTRL-D" or "^ CTRL-D" this didn't work. (Acevedo)
Using CTRL-D after using CTRL-E or CTRL-Y in Insert mode that inserted a '0'
or '^', removed the '0' or '^' and more indent.
The command "2".p" caused the last inserted text to be executed as commands.
(Acevedo)
Repeating the insert of "CTRL-V 048" resulted in "^@" to be inserted.
Repeating Insert completion could fail if there are special characters in the
text. (Acevedo)
":normal /string<CR>" caused the window to scroll. Now all ":normal" commands
are executed without scrolling messages.
Redo of CTRL-E or CTRL-Y in Insert mode interpreted special characters as
commands.
Line wrapping for 'tw' was done one character off for insert expansion
inserts.
buffer_exists() function didn't work properly for buffer names with a symbolic
link in them (e.g. when using buffer_exists(#)).
Removed the "MOTIF_COMMENT" construction from Makefile. It now works with
FreeBSD make, and probably with NeXT make too.
Matching the 'define' and 'include' arguments now honor the settings for
'ignorecase'. (Acevedo)
When one file shown in two windows, Visual selection mixed up cursor position
in current window and other window.
When doing ":e file" from a help file, the 'isk' option wasn't reset properly,
because of a modeline in the help file.
When doing ":e!", a cursor in another window on the same buffer could become
invalid, leading to "ml_get: invalid lnum" errors.
Matching buffer name for when expanded name has a different path from not
expanded name (Brugnara).
Normal mappings didn't work after an operator. For example, with ":map Q gq",
"QQ" didn't work.
When ":make" resulted in zero errors, a "No Errors" error message was given
(which breaks mappings).
When ":sourcing" a file, line length was limited to 1024 characters. CTRL-V
before <EOL> was not handled Vi compatible. (Acevedo)
Unexpected exit for X11 GUI, caused by SAVE_YOURSELF event. (Heimann)
CTRL-X CTRL-I only found one match per line. (Acevedo)
When using an illegal CTRL-X key in Insert mode, the CTRL-X mode message
was stuck.
Finally managed to ignore the "Quit" menu entry of the Window manager! Now
Vim only exists when there are no changed buffers.
Trying to start the GUI when $DISPLAY is not set resulted in a crash.
When $DISPLAY is not set and gvim starts vim, title was restored to "Thanks
for flying Vim".
When $DISPLAY not set, starting "gvim" (dropping back to vim) and then
selecting text with the mouse caused a crash.
"J", with 'joinspaces' set, on a line ending in ". ", caused one space too
many to be added. (Acevedo)
In insert mode, a CTRL-R {regname} which didn't insert anything left the '"'
on the screen.
":z10" didn't work. (Clapp)
"Help "*" didn't work.
Renamed a lot of functions, to avoid clashes with POSIX name space.
When adding characters to a line, making it wrap, the following lines were
sometimes not shifted down (e.g. after a tag jump).
CTRL-E, with 'so' set and cursor on last line, now does not move cursor as
long as the last line is on the screen.
When there are two windows, doing "^W+^W-" in the bottom window could cause
the status line to be doubled (not redrawn correctly).
This command would hang: ":n `cat`". Now connect stdin of the external
command to /dev/null, when expanding.
Fixed lalloc(0,) error for ":echo %:e:r". (Acevedo)
The "+command" argument to ":split" didn't work when there was no file name.
When selecting text in the GUI, which is the output of a command-line command
or an external command, the inversion would sometimes remain.
GUI: "-mh 70" argument was broken. Now, when menuheight is specified, it is
not changed anymore.
GUI: When using the scrollbar or mouse while executing an external command,
this caused garbage characters.
Showmatch sometimes jumped to the wrong position. Was caused by a call to
findmatch() when redrawing the display (when syntax highlighting is on).
Search pattern "\(a *\)\{3} did not work correctly, also matched "a a".
Problem with brace_count not being decremented.
Wildcard expansion added too many non-matching file names.
When 'iskeyword' contains characters like '~', "*" and "#" didn't work
properly. (Acevedo)
On Linux, on a FAT file system, modification time can change by one second.
Avoid a "file has changed" warning for a one second difference.
When using the page-switching in an xterm, Vim would position the cursor on
the last line of the window on exit. Also removed the cursor positioning for
":!" commands.
":g/pat/p" command (partly) overwrote the command. Now the output is on a
separate line.
With 'ic' and 'scs' set, a search for "Keyword", ignore-case matches were
highlighted too.
"^" on a line with only white space, put cursor beyond the end of the line.
When deleting characters before where insertion started ('bs' == 2), could not
use abbreviations.
CTRL-E at end of file puts cursor below the file, in Visual mode, when 'so' is
non-zero. CTRL-E didn't work when 'so' is big and the line below the window
wraps. CTRL-E, when 'so' is non-zero, at end of the file, caused jumping
up-down.
":retab" didn't work well when 'list' is set.
Amiga: When inserting characters at the last line on the screen, causing it
to wrap, messed up the display. It appears that a '\n' on the last line
doesn't always cause a scroll up.
In Insert mode "0<C-D><C-D>" deleted an extra character, because Vim thought
that the "0" was still there. (Acevedo)
"z{count}l" ignored the count. Also for "zh" et. al. (Acevedo)
"S" when 'autoindent' is off didn't delete leading white space.
"/<Tab>" landed on the wrong character when 'incsearch' is set.
Asking a yes/no question could cause a |hit-enter| prompt.
When the file consists of one long line (>4100 characters), making changes
caused various errors and a crash.
DJGPP version could not save long lines (>64000) for undo.
"yw" on the last char in the file didn't work. Also fixed "6x" at the end of
the line. "6X" at the start of a line fails, but does not break a mapping. In
general, a movement for an operator doesn't beep or flush a mapping, but when
there is nothing to operate on it beeps (this is Vi compatible).
"m'" and "m`" now set the '' mark at the cursor position.
Unix: Resetting of signals for external program didn't work, because SIG_DFL
and NULL are the same! For "!!yes|dd count=1|, the yes command kept on
running.
Partly fixed: Unix GUI: Typeahead while executing an external command was lost.
Now it's not lost while the command is producing output.
Typing <S-Tab> in Insert mode, when it isn't mapped, inserted "<S-Tab>". Now
it works like a normal <Tab>, just like <C-Tab> and <M-Tab>.
Redrawing ruler didn't check for old value correctly (caused UMR warnings in
Purify).
Negative array index in finish_viminfo_history().
":g/^/d|mo $" deleted all the lines. The ":move" command now removes the
:global mark from the moved lines.
Using "vG" while the last line in the window is a "@" line, didn't update
correctly. Just the "v" showed "~" lines.
"daw" on the last char of the file, when it's a space, moved the cursor beyond
the end of the line.
When 'hlsearch' was set or reset, only the current buffer was redrawn, while
this affects all windows.
CTRL-^, positioning the cursor somewhere from 1/2 to 1 1/2 screen down the
file, put the cursor at the bottom of the window, instead of halfway.
When scrolling up for ":append" command, not all windows were updated
correctly.
When 'hlsearch' is set, and an auto-indent is highlighted, pressing <Esc>
didn't remove the highlighting, although the indent was deleted.
When 'ru' set and 'nosc', using "$j" showed a wrong ruler.
Under Xfree 3.2, Shift-Tab didn't work (wrong keysym is used).
Mapping <S-Tab> didn't work. Changed the key translations to use the shortest
key code possible. This makes the termcode translations and mappings more
consistent. Now all modifiers work in all combinations, not only with <Tab>,
but also with <Space>, <CR>, etc.
For Unix, restore three more signals. And Vim catches SIGINT now, so CTRL-C
in Ex mode doesn't make Vim exit.
""a5Y" yanked 25 lines instead of 5.
"vrxxx<Esc>" in an empty line could not be undone.
A CTRL-C that breaks ":make" caused the errorfile not to be read (annoying
when you want to handle what ":make" produced so far).
":0;/pat" didn't find "pat" in line 1.
Search for "/test/s+1" at first char of file gave bottom-top message, or
didn't work at all with 'nowrapscan'.
Bug in viminfo history. Could cause a crash on exit.
":print" didn't put cursor on first non-blank in line.
":0r !cat </dev/null" left cursor in line zero, with very strange effects.
With 'showcmd' set and 'timeoutlen' set to a few seconds, trick to position
the cursor leftwards didn't work.
AIX stty settings were restored to cs5 instead of cs8 (Winn).
File name completion didn't work for "zsh" versions that put spaces between
file names, instead of NULs.
Changed "XawChain*" to "XtChain*", should work for more systems.
Included quite a few fixes for rightleft mode (Lottem).
Didn't ask to |hit-enter| when GUI is started and error messages are printed.
When trying to edit a file in a non-existent directory, ended up with editing
"No file".
"gqap" to format a paragraph did too much redrawing.
When 'hlsearch' set, only the current window was updated for a new search
pattern.
Sometimes error messages on startup didn't cause a |hit-enter| prompt,
because of autocommands containing an empty line.
Was possible to select part of the window in the border, below the command
line.
'< and '> marks were not at the correct position after linewise Visual
selection.
When translating a help argument to "CTRL-x", prepend or append a '_', when
applicable.
Blockwise visual mode wasn't correct when moving vertically over a special
character (displayed as two screen characters).
Renamed "struct option" to "struct vimoption" to avoid name clash with GNU
getopt().
":abclear" didn't work (but ":iabclear" and ":cabclear" did work).
When 'nowrap' used, screen wasn't always updated correctly.
"vim -c split file" displayed extra lines.
After starting the GUI, searched the termcap for a "gui" term.
When 'hls' used, search for "^$" caused a hang.
When 'hls' was set, an error in the last regexp caused trouble.
Unix: Only output an extra <EOL> on exit when outputted something in the
alternate screen, or when there is a message that needs to be cleared.
"/a\{" did strange things, depending on previous search.
"c}" only redrew one line (with -u NONE).
For mappings, CTRL-META-A was shown as <M-^A> instead of <MC-A>, while :map
only accepts <MC-A>. Now <M-C-A> is shown.
Unix: When using full path name in a tags file, which contains a link, and
'hidden' set and jumping to a tag in the current file, would get bogus
ATTENTION message. Solved by always expanding file names, even when starting
with '/'.
'hlsearch' highlighting of special characters (e.g., a TAB) didn't highlight
the whole thing.
"r<CR>" didn't work correctly on the last char of a line.
sometimes a window resize or other signal caused an endless loop, involving
set_winsize().
"vim -r" didn't work, it would just hang (using tgetent() while 'term' is
empty).
"gk" while 'nowrap' set moved two lines up.
When windows are split, a message that causes a scroll-up messed up one of the
windows, which required a CTRL-L to be typed.
Possible endless loop when using shell command in the GUI.
Menus defined in the .vimrc were removed when GUI started.
Crash when pasting with the mouse in insert mode.
Crash with ":unmenu *" in .gvimrc for Athena.
"5>>" shifted 5 lines 5 times, instead of 1 time.
CTRL-C when getting a prompt in ":global" didn't interrupt.
When 'so' is non-zero, and moving the scrollbar completely to the bottom,
there was a lot of flashing.
GUI: Scrollbar ident must be long for DEC Alpha.
Some functions called vim_regcomp() without setting reg_magic, which could
lead to unpredictable magicness.
Crash when clicking around the status line, could get a selection with a
backwards range.
When deleting more than one line characterwise, the last character wasn't
deleted.
GUI: Status line could be overwritten when moving the scrollbar quickly (or
when 'wd' is non-zero).
An ESC at the end of a ":normal" command caused a wait for a terminal code to
finish. Now, a terminal code is not recognized when its start comes from a
mapping or ":normal" command.
Included patches from Robert Webb for GUI. Layout of the windows is now done
inside Vim, instead of letting the layout manager do this. Makes Vim work
with Lesstif!
UMR warning in set_expand_context().
Memory leak: b_winlnum list was never freed.
Removed TIOCLSET/TIOCLGET code from os_unix.c. Was changing some of the
terminal settings, and looked like it wasn't doing anything good. (suggested
by Juergen Weigert).
Ruler overwrote "is a directory" message. When starting up, and 'cmdheight'
set to > 1, first message could still be in the last line.
Removed prototype for putenv() from proto.h, it's already in osdef2.h.in.
In replace mode, when moving the cursor and then backspacing, wrong characters
were inserted.
Win32 GUI was checking for a CTRL-C too often, making it slow.
Removed mappings for MS-DOS that were already covered by commands.
When visually selecting all lines in a file, cursor at last line, then "J".
Gave ml_get errors. Was a problem with scrolling down during redrawing.
When doing a linewise operator, and then an operator with a mouse click, it
was also linewise, instead of characterwise.
When 'list' is set, the column of the ruler was wrong.
Spurious error message for "/\(b\+\)*".
When visually selected many lines, message from ":w file" disappeared when
redrawing the screen.
":set <M-b>=^[b", then insert "^[b", waited for another character. And then
inserted "<M-b>" instead of the real <M-b> character. Was trying to insert
K_SPECIAL x NUL.
CTRL-W ] didn't use count to set window height.
GUI: "-font" command-line argument didn't override 'guifont' setting from
.gvimrc. (Acevedo)
GUI: clipboard wasn't used for "*y". And some more Win32/X11 differences
fixed for the clipboard (Webb).
Jumping from one help file to another help file, with 'compatible' set,
removed the 'help' flag from the buffer.
File-writable bit could be reset when using ":w!" for a readonly file.
There was a wait for CTRL-O n in Insert mode, because the search pattern was
shown.
Reduced wait, to allow reading a message, from 10 to 3 seconds. It seemed
nothing was happening.
":recover" found same swap file twice.
GUI: "*yy only worked the second time (when pasting to an xterm)."
DJGPP version (dos32): The system flags were cleared.
Dos32 version: Underscores were sometimes replaced with y-umlaut (Levin).
Version 4.1 of ncurses can't handle tputs("", ..). Avoid calling tputs() with
an empty string.
<S-Tab> in the command-line worked like CTRL-P when no completion started yet.
Now it does completion, last match first.
Unix: Could get annoying "can't write viminfo" message after doing "su". Now
the viminfo file is overwritten, and the user set back to the original one.
":set term=builtin_gui" started the GUI in a wrong way. Now it's not
allowed anymore. But "vim -T gui" does start the GUI correctly now.
GUI: Triple click after a line only put last char in selection, when it is a
single character word.
When the window is bigger than the screen, the scrolling up of messages was
wrong (e.g. ":vers", ":hi"). Also when the bottom part of the window was
obscured by another window.
When using a wrong option only an error message is printed, to avoid that the
usage information makes it scroll off the screen.
When exiting because of not being able to read from stdin, didn't preserve the
swap files properly.
Visual selecting all chars in more than one line, then hit "x" didn't leave an
empty line. For one line it did leave an empty line.
Message for which autocommand is executing messed up file write message (for
FileWritePost event).
"vim -h" included "-U" even when GUI is not available, and "-l" when lisp is
not available.
Crash for ":he <C-A>" (command-line longer than screen).
":s/this/that/gc", type "y" two times, then undo, did reset the modified
option, even though the file is still modified.
Empty lines in a tags file caused a ":tag" to be aborted.
When hitting 'q' at the more prompt for ":menu", still scrolled a few lines.
In an xterm that uses the bold trick a single row of characters could remain
after an erased bold character. Now erase one extra char after the bold char,
like for the GUI.
":pop!" didn't work.
When the reading a buffer was interrupted, ":w" should not be able to
overwrite the file, ":w!" is required.
":cf%" caused a crash.
":gui longfilename", when forking is enabled, could leave part of the
longfilename at the shell prompt.
5.0 和 5.1 版本之间的改进。
ä¸»è¦æ˜¯ä¸€ä¸ªæ¼æ´žä¿®æ£çš„å‘布版,没有很多新特性。
改动 *changed-5.1*
expand() 函数现在用 <NL> 分隔文件åè€Œä¸æ˜¯ç©ºæ ¼ã€‚é¿å…å†…åµŒç©ºæ ¼æ–‡ä»¶å出现的问题。
è¦å¾—到旧的结果,用 substitute(expand(foo), "\n", " ", "g")。
æ’入扩展用的å—å…¸å¯ç”¨åæ–œæ 代表通é…符。如果 'isk' 包å«åæ–œæ çš„è¯ï¼Œå…许扩展
"ze\kra"。
Win32 GUI æ–°å›¾æ ‡ã€‚
":tag"ã€":tselect" ç‰åªå½“傿•°ä»¥ '/' 开始时把它当作æ£è§„表达å¼ã€‚é¿å… ":tag xx~"
给出错误信æ¯: "No previous sub. regexp"。:tag 傿•°åŒ…å«é€šé…å—符时亦然,过去和
Vi ä¸å…¼å®¹ã€‚
用 '/' 时,按本义接å—傿•°æœ‰æ›´é«˜çš„优先级,在通é…匹é…之å‰å…ˆä½¿ç”¨ã€‚
åªæœ‰ä½¿ç”¨ '/' æ—¶æ‰å¯»æ‰¾ä¸åŒå¤§å°å†™çš„匹é…,å³ä½¿æ²¡æœ‰ç½®ä½ 'ignorecase' 也是如æ¤ã€‚
"g^]" 被改为åªåœ¨åŒ¹é…çš„æ ‡ç¾å¤šäºŽä¸€ä¸ªæ—¶æ‰åš ":tselect"。
修改部分缺çœé¢œè‰²ï¼Œå› ä¸ºåœ¨æ·±è‰²èƒŒæ™¯ä¸‹å®ƒä»¬ä¸æ–¹ä¾¿é˜…读。
æœç´¢æ¨¡å¼çš„å—符åç§»å¯ä»¥ç§»åŠ¨å…‰æ ‡åˆ°ä¸‹è¡Œæˆ–ä¸Šè¡Œã€‚åŒæ—¶ä¿®æ£ "/pattern/e+2" 在行尾的
"pattern" åœæ»žçš„问题。
状æ€è¡Œä¸ŠåŒå‡»ä¸å†å¯åЍå¯è§†æ¨¡å¼ã€‚拖动状æ€è¡Œä¸å†åœæ¢å¯è§†æ¨¡å¼ã€‚
Perl 接å£: Buffers() å’Œ Windows() 现在使用更åˆä¹Žé€»è¾‘çš„å‚æ•°ï¼Œå°±åƒ Vim 其余部分
ä½¿ç”¨çš„é‚£æ · (Moore)。
'" ä½ç½®æ ‡è®°çš„åˆå§‹å€¼è®¾ä¸ºé¦–行的第一个å—符。自动命令使用 '" ä¸ä¼šå‡ºé”™ã€‚
新增 *added-5.1*
"shell_error" 内部å˜é‡: 最近外壳命令的输出。
":echohl" 命令: 设置 ":echo" 的高亮。
'highlight' çš„ 'S' æ ‡å¿—ä½å’Œ StatusLineNC 高亮组: éžå½“å‰çª—å£çš„状æ€è¡Œé«˜äº®ã€‚当å‰
窗å£çš„缺çœè®¾ç½®ä½¿ç”¨ç²—体。
åŠ å…¥ buffer_name() å’Œ buffer_number() 函数 (Aaron)。
åŠ å…¥ substitute() 函数的 "g" æ ‡å¿—ä½å‚æ•° (Aaron)。
åŠ å…¥ winheight() 函数。
Win32: 如果外部命令用 "start " 开始,ä¸ä¸ºå®ƒæ‰“å¼€æŽ§åˆ¶å° (Aaron)。
Win32 控制å°: 使用 termcap 代ç ï¼Œæ ¹æ®å½“å‰æŽ§åˆ¶å°å±žæ€§å¤„ç†ç²—体/å转属性。
configure 检查 "strip"。(Napier)
æ’入模å¼çš„ CTRL-R CTRL-R x: 按本义æ’入寄å˜å™¨å†…å®¹ï¼Œè€Œä¸æ˜¯åƒé”®ç›˜è¾“å…¥é‚£æ ·æ’入。
使一些 "No match" é”™è¯¯æ¶ˆæ¯æä¾›æ›´å¤šä¿¡æ¯: ä¸åŒ¹é…的模å¼ã€‚
"make install" 现在也å¤åˆ¶å®æ–‡ä»¶ã€‚
tools/tcltags,从 TCL æ–‡ä»¶ç”Ÿæˆæ ‡ç¾æ–‡ä»¶çš„外壳脚本。
configure çš„ "--with-tlib" 设置。使用 termlib 的简å•办法: "./configure
--with-tlib=termlib"。
'cino' çš„ 'u' æ ‡å¿—ä½å¯ä»¥è®¾ç½®è¢«åŒ…å«çš„ () 部分的缩进。
如果 Win32 OLE 版本ä¸èƒ½è½½å…¥æ³¨å†Œçš„类型库,询问用户是å¦çŽ°åœ¨è¦æ³¨å†Œ Vim。(Erhardt)
带 OLE 的 Win32: 自动注册时退出 Vim。
åŠ å…¥ VisVim 1.1bï¼Œè‹¥å¹²æ”¹è¿›å’Œæ–°å›¾æ ‡ (Heiko Erhardt)。
åŠ å…¥ Vince Negri 关于 Win32s 支æŒçš„è¡¥ä¸ã€‚需è¦ç”¨ VC 4.1 编译ï¼
Perl 接å£: åŠ å…¥ $curbuf。使 Buffers() å’Œ Windows() æ›´åˆç†ã€‚
(Moore) åŠ å…¥ Msg() çš„ "group" 傿•°ã€‚
DOS æºä»£ç å½’æ¡£åŠ å…¥ Perl 文件。修改 Makefile.bor å’Œ Makefile.w32 以支æŒç¼–译带
Perl 的 Win32 版本。
åŠ å…¥ Ken Scott æä¾›çš„æ–° Makefile.w32。现在å¯ä»¥ make 所有的 Win32 版本,包括
OLEã€Perl å’Œ Python。
åŠ å…¥ CTRL-W g ] å’Œ CTRL-W g ^]: 分割窗å£å¹¶æ‰§è¡Œ g] 或 g^]。
åŠ å…¥ "g]"ï¼Œæ€»æ˜¯ä¸ºå…‰æ ‡æ‰€åœ¨çš„æ ‡è¯†ç¬¦æ‰§è¡Œ ":tselect"。
åŠ å…¥ ":tjump" å’Œ ":stjump" 命令。
改进 ":tselect" çš„åˆ—è¡¨æ ‡ç¾å过长的问题。
åŠ å…¥ Macintosh 版本和 Python 接å£çš„一些补ä¸ã€‚(St-Amant)
如果以å‰ç”¨è¿‡æŸç¼“冲区,":buf foo" 现在也æ¢å¤å…‰æ ‡åˆ—。
为ä¸åŒçš„æœ€ç»ˆç›®æ ‡è°ƒæ•´äº†è¯æ³•文件和脚本的 Makefile (用于 Debian Linux)。
Amiga: $VIM å¯ä»¥åœ¨ä»»ä½•地方使用。如果没定义 $VIM,使用 "VIM:"。修æ£å¸®åŠ©å’Œè¯æ³•æ–‡
ä»¶éœ€è¦ "VIM:" 赋值的问题。现在两者都å¯ä»¥ç”¨äº†ã€‚
一些 xterms å‘é€å’Œ vt100 兼容的功能键 F1-F4ã€‚å› ä¸ºæ— æ³•æ£€æµ‹è¿™ä¸€ç‚¹ï¼ŒåŒæ—¶è¯†åˆ«ä¸¤ç§
ç±»åž‹çš„é”®å¹¶æŠŠå®ƒä»¬ç¿»è¯‘æˆ <F1> - <F4>。
åŠ å…¥ "VimEnter" 自动命令。在所有的å¯åŠ¨ä»»åŠ¡ä¹‹åŽæ‰§è¡Œã€‚
BeOS 版本现在å¯ä»¥åœ¨ Intel CPU 上è¿è¡Œã€‚(Seibert)。
ä¿®æ£ *fixed-5.1*
":ts" changed position in the tag stack when cancelled with <CR>.
":ts" changed the cursor position for CTRL-T when cancelled with <CR>.
":tn" would always jump to the second match. Was using the wrong entry in
the tag stack.
Doing "tag foo", then ":tselect", overwrote the original cursor position in
the tag stack.
"make install" changed the vim.1 manpage in a wrong way, causing "doc/doc"
to appear for the documentation files.
When compiled with MAX_FEAT, xterm mouse handling failed. Was caused by DEC
mouse handling interfering.
Was leaking memory when using selection in X11.
CTRL-D halfway a command-line left some characters behind the first line(s)
of the listing.
When expanding directories for ":set path=", put two extra backslashes
before a space in a directory name.
When 'lisp' set, first line of a function would be indented. Now its indent
is set to zero. And use the indent of the first previous line that is at
the same () level. Added test33.
"so<Esc>u" in an empty file didn't work.
DOS: "seek error in swap file write" errors, when using DOS 6.2 share.exe,
because the swap file was made hidden. It's no longer hidden.
":global" command would sometimes not execute on a matching line. Happened
when a data block is full in ml_replace().
For AIX use a tgetent buffer of 2048 bytes, instead of 1024.
Win32 gvim now only sets the console size for external commands to 25x80
on Windows 95, not on NT.
Win32 console: Dead key could cause a crash, because of a missing "WINAPI"
(Deshpande).
The right mouse button started Visual mode, even when 'mouse' is empty, and
in the command-line, a left click moved the cursor when 'mouse' is empty.
In Visual mode, 'n' in 'mouse' would be used instead of 'v'.
A blinking cursor or focus change cleared a non-Visual selection.
CTRL-Home and CTRL-End didn't work for MS-DOS versions.
Could include NUL in 'iskeyword', causing a crash when doing insert mode
completion.
Use _dos_commit() to flush the swap file to disk for MSDOS 16 bit version.
In mappings, CTRL-H was replaced by the backspace key code. This caused
problems when it was used as text, e.g. ":map _U :%s/.^H//g<CR>".
":set t_Co=0" was not handled like a normal term. Now it's translated into
":set t_Co=", which works.
For ":syntax keyword" the "transparent" option did work, although not
mentioned in the help. But synID() returned wrong name.
"gqG" in a file with one-word-per-line (e.g. a dictionary) was very slow and
not interruptible.
"gq" operator inserted screen lines in the wrong situation. Now screen
lines are inserted or deleted when this speeds up displaying.
cindent was wrong when an "if" contained "((".
'r' flag in 'viminfo' was not used for '%'. Could get files in the buffer
list from removable media.
Win32 GUI with OLE: if_ole_vc.mak could not be converted into a project.
Hand-edited to fix this...
With 'nosol' set, doing "$kdw" below an empty line positioned the cursor at
the end of the line.
Dos32 version changed "\dir\file" into "/dir/file", to work around a DJGPP
bug. That bug appears to have been fixed, therefore this translation has
been removed.
"/^*" didn't work (find '*' in first column).
"<afile>" was not always set for autocommands. E.g., for ":au BufEnter *
let &tags = expand("<afile>:p:h") . "/tags".
In an xterm, the window may be a child of the outer xterm window. Use the
parent window when getting the title and icon names. (Smith)
When starting with "gvim -bg black -fg white", the value of 'background' is
only set after reading the .gvimrc file. This causes a ":syntax on" to use
the wrong colors. Now allow using ":gui" to open the GUI window and set the
colors. Previously ":gui" in a gvimrc crashed Vim.
tempname() returned the same name all the time, unless the file was actually
created. Now there are at least 26 different names.
File name used for <afile> was sometimes full path, sometimes file name
relative to current directory.
When 'background' was set after the GUI window was opened, it could change
colors that were set by the user in the .gvimrc file. Now it only changes
colors that have not been set by the user.
Ignore special characters after a CSI in the GUI version. These could be
interpreted as special characters in a wrong way. (St-Amant)
Memory leak in farsi code, when using search or ":s" command.
Farsi string reversing for a mapping was only done for new mappings. Now it
also works for replacing a mapping.
Crash in Win32 when using a file name longer than _MAX_PATH. (Aaron)
When BufDelete autocommands were executed, some things for the buffer were
already deleted (esp. Perl stuff).
Perl interface: Buffer specific items were deleted too soon; fixes "screen
no longer exists" messages. (Moore)
The Perl functions didn't set the 'modified' flag.
link.sh did not return an error on exit, which may cause Vim to start
installing, even though there is no executable to install. (Riehm)
Vi incompatibility: In Vi "." redoes the "y" command. Added the 'y' flag to
'cpoptions'. Only for 'compatible' mode.
":echohl" defined a new group, when the argument was not an existing group.
"syn on" and ":syn off" could move the cursor, if there is a hidden buffer
that is shorter that the current cursor position.
The " mark was not set when doing ":b file".
When a "nextgroup" is used with "skipwhite" in syntax highlighting, space at
the end of the line made the nextgroup also be found in the next line.
":he g<CTRL-D>", then ":" and backspace to the start didn't redraw.
X11 GUI: "gvim -rv" reversed the colors twice on Sun. Now Vim checks if the
result is really reverse video (background darker than foreground).
"cat link.sh | vim -" didn't set syntax highlighting.
Win32: Expanding "file.sw?" matched ".file.swp". This is an error of
FindnextFile() that we need to work around. (Kilgore)
"gqgq" gave an "Invalid lnum" error on the last line.
Formatting with "gq" didn't format the first line after a change of comment
leader.
There was no check for out-of-memory in win_alloc().
"vim -h" didn't mention "-register" and "-unregister" for the OLE version.
Could not increase 'cmdheight' when the last window is only one line. Now
other windows are also made smaller, when necessary.
Added a few {} to avoid "suggest braces around" warnings from gcc 2.8.x.
Changed return type of main() from void to int. (Nam)
Using '~' twice in a substitute pattern caused a crash.
"syn on" and ":syn off" could scroll the window, if there is a hidden buffer
that is shorter that the current cursor position.
":if 0 | if 1 | endif | endif" didn't work. Same for ":while" and "elseif".
With two windows on modified files, with 'autowrite' set, cursor in second
window, ":qa" gave a warning for the file in the first window, but then
auto-wrote the file in the second window. (Webb)
Win32 GUI scrollbar could only handle 32767 lines. Also makes the
intellimouse wheel use the configurable number of scrolls. (Robinson)
When using 'patchmode', and the backup file is on another partition, the file
copying messed up the write-file message.
GUI X11: Alt-Backspace and Alt-Delete didn't work.
"`0" could put the cursor after the last character in the line, causing
trouble for other commands, like "i".
When completing tags in insert mode with ^X^], some matches were skipped,
because the compare with other tags was wrong. E.g., when "mnuFileSave" was
already there, "mnuFile" would be skipped. (Negri)
When scrolling up/down, a syntax item with "keepend" didn't work properly.
Now the flags are also stored for the syntax state a the start of each line.
When 'ic' was changed while 'hlsearch' is on, there was no redraw to show the
effect.
Win32 GUI: Don't display "No write since last chance" in a message box, but in
the Vim window.
5.1 和 5.2 版本之间的改进。
长行å¯ç¼–辑 *long-lines*
窗å£é‡Œæ”¾ä¸ä¸‹çš„长行ä¸å†æ˜¾ç¤º @@@ 了。é‡ç”»ä»Žè¡Œå†…çš„æŸä¸ªå—符开始继ç»ï¼Œä½¿å¾—å…‰æ ‡å‘¨å›´
的文本å¯è§ã€‚这使得打开回绕时,å¯ä»¥ç¼–辑长行。
åŠ å…¥æ–‡ä»¶æµè§ˆå™¨ *file-browser-5.2*
Win32ã€Ahena å’Œ Motif GUI 上,如果用户请求 ":browse" 并用于 ":e"ã€":w"ã€":r"ã€
":so"ã€":redirect" å’Œ ":mkexrc/vimrc/vsess" 命令时,弹出文件请求器。
":browsee /foo/bar" 在 /foo/bar ç›®å½•æ‰“å¼€è¯·æ±‚å™¨ï¼Œè¿™æ ·ï¼Œä½ å¯ä»¥å¾—åˆ°å¾ˆå¥½çš„å³æ‰‹è¾¹çš„
æ˜ å°„ï¼Œæ¯”å¦‚ ":browse so $vim/macros"ã€‚å¦‚è´æ²¡æœ‰ä¸º ":browse e" 指定åˆå§‹ç›®å½•,编译
æ—¶å¯ä»¥é€‰æ‹©ä»Žå½“å‰ç›®å½•还是当å‰ç¼“冲区的目录开始。(Negri å’Œ Kahn)
å¢žåŠ äº† 'browsedir' 选项,å¯å–值 "current"ã€"last" 或 "buffer"。它说明æµè§ˆå¯¹è¯
框从最åŽä½¿ç”¨çš„目录ã€å½“å‰ç¼“冲区的目录,还是当å‰ç›®å½•开始。":browse w" ä¸å—å½±å“。
修改了缺çœèœå•,现在使用 ":browse" 命令。
åŠ å…¥å¯¹è¯æ¡† *dialogs-added*
å¢žåŠ äº† ":confirm" 命令。å¯ç”¨äºŽ ":e"ã€":q"ã€":w"ã€":cl"。Win32ã€Athena å’Œ Motif
GUI 使用窗å£å¯¹è¯æ¡†ã€‚所有其它的平å°ä½¿ç”¨å‘½ä»¤è¡Œä¸Šçš„æç¤ºã€‚":confirm qa" æä¾›äº†ä¿å˜
所有修改过的文件的选择。
confirm() 函数: å…许用户访问 confirm 机制。
å¢žåŠ äº† 'guioptions' çš„ 'v' æ ‡å¿—ä½ã€‚如果包å«ï¼Œæ€»æ˜¯åœ¨ Win32 GUI å¯¹è¯æ¡†é‡Œä½¿ç”¨åž‚ç›´
的按钮布局。å¦åˆ™ï¼Œåå‘使用水平布局。
Win32 GUI: ":promptfind" å’Œ ":promptrepl" å¼¹å‡ºå¯¹è¯æ¡†è¿›è¡Œæœç´¢/替æ¢ã€‚
å¯ç”¨äºŽèœå•项目。(Negri)
åŠ å…¥å¼¹å‡ºå¼èœå• *popup-menu-added*
如果 'mousemodel' 选项设为 "popup"ï¼Œé¼ æ ‡å³é”®æ˜¾ç¤º "PopUp" 顶层èœå•,作为弹出的
å…³è”èœå•。"PopUp" èœå•ä¸å†æ™®é€šçš„èœå•æ 上æç¤ºã€‚ç›®å‰ï¼Œåªæ”¯æŒ Win32 å’Œ Athena
GUI。
åŠ å…¥é€‰æ‹©æ¨¡å¼ *new-Select-mode*
åŠ å…¥äº†æ–°æ¨¡å¼: "选择模å¼"。类似于å¯è§†æ¨¡å¼ï¼Œä½†è¾“入坿˜¾ç¤ºçš„å—符将替æ¢é€‰æ‹©åŒºã€‚
- CTRL-G å¯ä»¥ç”¨æ¥åˆ‡æ¢å¯è§†æ¨¡å¼å’Œé€‰æ‹©æ¨¡å¼ã€‚
- CTRL-O å¯ä»¥ç”¨æ¥ä¸ºå•个命令从选择模å¼åˆ‡æ¢åˆ°é€‰æ‹©æ¨¡å¼ã€‚
- åŠ å…¥ 'selectmode' 选项: 说明何时å¯åŠ¨é€‰æ‹©æ¨¡å¼ï¼Œè€Œä¸æ˜¯å¯è§†æ¨¡å¼ã€‚
- åŠ å…¥ 'mousemodel' 选项: 改å˜é¼ æ ‡é”®çš„åº”ç”¨ã€‚
- åŠ å…¥ 'keymodel' 选项: 指示使用 Shift + 特殊键å¯ä»¥å¯åЍå¯è§†æˆ–选择模å¼çš„选择。
- åŠ å…¥ ":behave"。å¯ä»¥ç”¨æ¥å¿«é€Ÿè®¾ç½® 'selectmode'ã€'mousemodel' å’Œ 'keymodel' çš„
MS-Windows 和 xterm 行为。
- xterm é£Žæ ¼çš„é€‰æ‹©çŽ°åœ¨æˆä¸ºæ— 模å¼çš„选择。
- 选择模å¼ä½¿ç”¨å¯è§†æ¨¡å¼çš„æ˜ å°„å’Œèœå•。它们自动先切æ¢åˆ°å¯è§†æ¨¡å¼ã€‚之åŽï¼Œé‡æ–°é€‰æ‹©åŒº
域,除éžè¯¥åŒºåŸŸå·²è¢«åˆ 除。"gV" 命令用æ¥åœ¨æ˜ å°„é‡Œè·³è¿‡é‡æ–°é€‰æ‹©è¿™ä¸€æ¥ã€‚
- å¢žåŠ "gh"ã€"gH" å’Œ "g^H" 命令: 开始选择 (高亮) 模å¼ã€‚
- 选择模å¼çš„é€€æ ¼é”®åˆ é™¤é€‰æ‹©åŒºã€‚
"mswin.vim" 脚本。设置éžå¸¸ç±»ä¼¼äºŽ MS-Windows 的行为。
åŠ å…¥ä¼šè¯æ–‡ä»¶ *new-session-files*
":mks[ession]" 类似于 "mkvimrc",但写入当å‰è½½å…¥ç¼“冲区的完整文件å和当å‰ç›®å½•,
使得执行该文件å¯ä»¥é‡æ–°è½½å…¥è¿™äº›æ–‡ä»¶å¹¶åˆ‡æ¢åˆ°è¯¥ç›®å½•。也ä¿å˜å’Œæ¢å¤çª—å£ã€‚使文件å相
å¯¹äºŽä¼šè¯æ–‡ä»¶ã€‚
'sessionoptions' 选项设置 ":mksession" 的行为。(Negri)
用户定义的函数和命令 *new-user-defined*
åŠ å…¥ç”¨æˆ·å®šä¹‰å‡½æ•°ã€‚ç”¨ ":function" 开始定义,到 ":endfunction" ä½ç½®ã€‚
调用方å¼ä¸º "Func()"。å…许使用å¯å˜æ•°é‡çš„傿•°ã€‚
包å«å±€éƒ¨å˜é‡ "l:name" 的支æŒã€‚用 ":return" 返回值。
è§ |:function|。
用 ":call" 调用函数。如果æä¾›äº†èŒƒå›´ï¼Œè¯¥èŒƒå›´çš„æ¯è¡Œæ‰§è¡Œä¸€æ¬¡è¯¥å‡½æ•°ã€‚|:call|
"macros/justify.vim" 是使用用户定义函数的例å。
ç”¨æˆ·å‡½æ•°ä¸æ”¹å˜æœ€è¿‘使用的æœç´¢æ¨¡å¼ï¼Œæˆ– "." é‡å¤çš„命令。
'maxfuncdepth' 函数。é™åˆ¶å‡½æ•°è°ƒç”¨çš„æ·±åº¦ã€‚é¿å…å‡½æ•°ä½¿ç”¨æ— é™é€’归的麻烦 (å› ä¸ºå†…å˜
溢出而崩溃)。
用户定义的 Ex 命令: ":command"ã€":delcommand" å’Œ ":comclear"。(Moore) è§
|user-commands|。
æ–°æŽ¥å£ *interfaces-5.2*
Tcl 接å£ã€‚(Wilken) è§ |tcl|。
使用 ":tcl"ã€":tcldo" å’Œ "tclfile" 命令。
Cscope 支æŒã€‚(Kahn) (Sekera) è§ |cscope|。
使用 ":cscope" å’Œ ":cstag" 命令。使用选项 'cscopeprg'ã€'cscopetag'ã€
'cscopetagorder' 和 'cscopeverbose'。
æ–°ç§»æ¤ç‰ˆæœ¬ *ports-5.2*
Amiga GUI ç§»æ¤ç‰ˆæœ¬ã€‚(Nielsen) 还没有充分测试ï¼
RISC OS 版本。(Thomas Leonard) è§ |riscos|。
该版本å¯ä»¥åœ¨ GUI 或文本模å¼ä¸‹è¿è¡Œï¼Œå–决于在哪里调用。
åˆ é™¤äº† "os_archie" æ–‡ä»¶ï¼Œåæ£å®ƒä»¬ä¹Ÿä¸å†å·¥ä½œäº†ã€‚
多å—èŠ‚æ”¯æŒ *new-multi-byte*
Win32 GUI 的多å—节支æŒã€‚(Baek)
'fileencoding' 选项决定文件里的文本是如何编ç 的。
多å—节å—符å¯ä»¥ç”¨ ":ascii"。多å—节å—符å¯ä»¥åœ¨ Windows 95 工作,å³ä½¿ä½¿ç”¨åŒ—美版本
也是如æ¤ã€‚(Aaron)
需è¦åœ¨ feature.h 里打开。
还没有充分测试ï¼
新函数 *new-functions-5.2*
|browse()| 如果å¯ç”¨ï¼Œç»™å‡ºæ–‡ä»¶è¯·æ±‚器。(Negri)
|escape()| å—ç¬¦ä¸²é‡Œç”¨åæ–œæ ç»™å—符转义。
|fnamemodify()| 修改文件å。
|input()| 请求用户输入一行。(Aaron) input() 函数输入的行有å•独的历å²ã€‚
|argc()|
|argv()| å¯ä»¥ç”¨æ¥è®¿é—®å‚数列表。
|winbufnr()| 窗å£çš„缓冲区å·ã€‚(Aaron)
|winnr()| 窗å£å·ã€‚(Aaron)
|matchstr()| 返回匹é…çš„å—符串。
|setline()| 设置一行为æŸå—符串值。
新选项 *new-options-5.2*
'allowrevins' å…许在æ’入和命令行模å¼é‡Œä½¿ç”¨ CTRL-_ 命令。
'browsedir' 指示æµè§ˆå¯¹è¯æ¡†ä»Žåœ¨å“ªä¸ªç›®å½•开始。
'confirm' 如果置ä½ï¼Œ:q :w å’Œ :e 命令总是和使用了 ":confirm" ä¸€æ ·ã€‚
(Negri)
'cscopeprg'
'cscopetag'
'cscopetagorder'
'cscopeverbose' 设置 |cscope| 行为。
'filetype' RISC-OS 专用的文件类型。
'grepformat'
'grepprg' 为 |:grep| 命令使用。
'keymodel' 指示使用 Shift + 特殊键å¯ä»¥å¯åЍå¯è§†æˆ–选择模å¼çš„选择。
'listchars' 设置 'list' 模å¼é‡Œè¡Œå°¾ã€åˆ¶è¡¨å’Œæ‹–å°¾ç©ºæ ¼æ‰€æ˜¾ç¤ºçš„å—符。(部分æ¥è‡ª
Smith) 也设置如果置ä½äº† 'nowrap' 时,如果一行放ä¸ä¸‹æ—¶è¦æ˜¾ç¤ºçš„
å—符。
'matchpairs' å…许 '<' å’Œ '>' 的匹é…,还有其它的å•å—符组对。
'mousefocus' 窗å£ç„¦ç‚¹è¿½éšé¼ æ ‡ (部分æ¥è‡ª Terhaar)。用键盘命令改å˜ç„¦ç‚¹ç§»åŠ¨æŒ‡
针到该窗å£ã€‚åŒæ—¶åœ¨æ”¹å˜çª—å£å¸ƒå±€æ—¶ (分割窗å£ã€æ”¹å˜çª—å£é«˜åº¦ç‰) ç§»
动指针。
'mousemodel' 改å˜é¼ æ ‡æŒ‰é’®çš„ä½¿ç”¨æ–¹å¼ã€‚
'selection' 如果设为 "inclusive" 或 "exclusive"ï¼Œå…‰æ ‡å¯ä»¥åœ¨å¯è§†æˆ–选择模å¼
里到行尾之åŽä¸€ä¸ªå—符的ä½ç½®ã€‚如果设为 "old",则使用旧行为。如果
是 "inclusive"ï¼Œå…‰æ ‡æ‰€åœ¨çš„å—符包å«åœ¨æ“作里。如果使用
"exclusive",使用 'guicursor' æ–°çš„ "ve" å…¥å£ã€‚缺çœä¸ºåž‚直线。
'selectmode' 说明何时开始选择模å¼ï¼Œè€Œä¸æ˜¯å¯è§†æ¨¡å¼ã€‚
'sessionoptions' 设置 ":mksession" 的行为。(Negri)
'showfulltag' 在æ’入模å¼è¡¥å…¨æ ‡ç¾æ—¶ï¼Œæ˜¾ç¤ºæ ‡ç¾æœç´¢æ¨¡å¼ (æ•´é½æ ¼å¼) 作为å¯èƒ½çš„一
个选择 (如果有的è¯)。
'swapfile' 缓冲区是å¦ä½¿ç”¨äº¤æ¢æ–‡ä»¶ã€‚
'syntax' 如果设置,载入该åå—çš„è¯æ³•。å…许从模å¼è¡Œé‡Œè®¾ç½®ç‰¹å®šçš„è¯æ³•。
'ttymouse' å…许åå—ä¸ä»¥ "xterm" 开始的终端使用 xterm çš„é¼ æ ‡ä»£ç 。
'wildignore' ä¸åº”该å‚ä¸Žè¡¥å…¨çš„æ–‡ä»¶åæ¨¡å¼çš„列表。
'wildmode' å¯ä»¥ç”¨äºŽè®¾ç½® 'wildchar' 的扩展类型。
替æ¢ç”¨äºŽå‘½ä»¤è¡Œè¡¥å…¨çš„ CTRL-T 命令。
åˆ—å‡ºæ‰€æœ‰åŒ¹é…æ—¶ï¼Œä¸å“铃。
'winaltkeys' Win32 å’Œ Motif GUI。如果为 "yes",ALT 键完全由窗å£ç³»ç»Ÿå¤„ç†ã€‚如
果为 "no",窗å£ç³»ç»Ÿå®Œå…¨ä¸ä½¿ç”¨ ALT 键。如果为 "menu",这å–决于
è¯¥é”®æ˜¯å¦æ˜¯èœå•å¿«æ·é”®ã€‚
'winminheight' æ¯ä¸ªçª—å£çš„æœ€å°é«˜åº¦ã€‚缺çœä¸º 1ã€‚å¦‚æžœä½ æƒ³è¦é›¶è¡Œçš„窗å£ï¼Œè®¾ä¸º 0。如
果窗å£é«˜åº¦ä¸ºé›¶ï¼Œä¸æ˜¾ç¤ºæ»šåЍæ¡ã€‚(Negri)
新 Ex 命令 *new-ex-commands-5.2*
|:badd| 把文件å夹é“缓冲区列表,没有副作用。(Negri)
|:behave| 快速设置 MS-Windows 或 xterm 行为。
|:browse| ä½¿ç”¨æ–‡ä»¶é€‰æ‹©å¯¹è¯æ¡†ã€‚
|:call| 调用函数,å¯é€‰ä½¿ç”¨è¡ŒèŒƒå›´ã€‚
|:cnewer|
|:colder| 访问 quickfix é”™è¯¯åˆ—è¡¨çš„å †æ ˆã€‚
|:comclear| 清除所有的用户定义命令。
|:command| 定义用户命令。
|:continue| 回到 ":while"。
|:confirm| å¦‚æžœæœ‰æ„æƒ³ä¸åˆ°çš„事å‘生,请求确认。
|:cscope| 执行 cscope 命令。
|:cstag| 用 cscope æ¥è·³è½¬åˆ°æ ‡ç¾ã€‚
|:delcommand| åˆ é™¤ç”¨æˆ·å®šä¹‰å‘½ä»¤ã€‚
|:delfunction| åˆ é™¤ç”¨æˆ·å®šä¹‰å‡½æ•°ã€‚
|:endfunction| 结æŸç”¨æˆ·å®šä¹‰å‡½æ•°ã€‚
|:function| 定义用户定义函数。
|:grep| 类似于 ":make"。(Negri)
|:mksession| å»ºç«‹ä¼šè¯æ–‡ä»¶ã€‚
|:nohlsearch| æš‚æ—¶åœæ¢ 'hlsearch' 高亮。
|:Print| å’Œ Vi 兼容。和 ":print" 相åŒã€‚
|:promptfind| æœç´¢å¯¹è¯æ¡† (Win32 GUI)。
|:promptrepl| æœç´¢/æ›¿ä»£å¯¹è¯æ¡† (Win32 GUI)。
|:return| 从用户定义函数里返回。
|:simalt| Win32 GUI: 模拟 alt 键的键击。(Negri)
|:smagic| 类似于 ":substitute",但总是使用 'magic'。
|:snomagic| 类似于 ":substitute",但总是使用 'nomagic'。
|:tcl| 执行 TCL 命令。
|:tcldo| 在行范围上执行 TCL 命令。
|:tclfile| 执行 TCL 脚本文件。
|:tearoff| 坿’•下的èœå• (Win32 GUI)。
|:tmenu|
|:tunmenu| Win32 GUI: èœå•工具æç¤ºã€‚(Negri)
|:star| :* 执行寄å˜å™¨ã€‚
改动 *changed-5.2*
æ¢å的函数:
buffer_exists() -> bufexists()
buffer_name() -> bufname()
buffer_number() -> bufnr()
file_readable() -> filereadable()
highlight_exists() -> hlexists()
highlightID() -> hlID()
last_buffer_nr() -> bufnr("$")
为了åŽå‘兼容,ä»ç„¶å¯ä»¥ä½¿ç”¨æ—§å。
åªæœ‰æ–°çš„ 'allowrevins' é€‰é¡¹ç½®ä½æ—¶æ‰å¯ä»¥ç”¨æ’入模å¼å’Œå‘½ä»¤è¡Œæ¨¡å¼çš„ CTRL-_ 命令。
这是为了é¿å…按 SHIFT-_ 的人ä¸å°å¿ƒè¿›å…¥å呿’入模å¼è€Œä¸çŸ¥æ‰€æŽªã€‚
如果 ":tselect" 列表的文件åè¿‡é•¿ï¼Œåˆ é™¤ä¸é—´éƒ¨åˆ†å¹¶æ”¾ä¸Š "..."。
Win32 GUI: 使å—体选择器出现在 Vim 窗å£ä¸é—´ï¼Œä¸æ˜¯éšä¾¿çš„æŸä¸ªä½ç½®ã€‚(Negri)
":bn" 跳过帮助缓冲区,除éžçŽ°åœ¨å°±åœ¨å¸®åŠ©ç¼“å†²åŒºã€‚(Negri)
如果有状æ€è¡Œå¹¶ä¸”åªæœ‰ä¸€ä¸ªçª—å£ï¼Œä¸æ˜¾ç¤ºå½“å‰çª—å£çš„状æ€è¡Œä¸çš„ '^'。
过去 ":*" 相当于 "'<,'>",å³å¯è§†åŒºåŸŸã€‚但在 Vi 里它用作 ":@"。如果 'cpoptions'
åŒ…å« '*',使用 Vi 兼容行为。
å¦‚æžœç½®ä½ 'insertmode',用 CTRL-O æ‰§è¡Œæ˜ å°„å¦‚åŒæ²¡æœ‰ç½®ä½ 'insertmode' ã€‚è¿™æ ·ï¼Œå³
ä½¿ç½®ä½ 'insertmode',也å¯ä»¥ä½¿ç”¨ "æ£å¸¸çš„" æ˜ å°„ã€‚
如果已ç»è®¾ç½® 'mouse' (比如通过 .vimrc 文件),GUI å¯åŠ¨æ—¶ä¸è‡ªåŠ¨è®¾ç½® 'mouse'。
从 'mouse' é€‰é¡¹åˆ é™¤ 'N'ã€'I' å’Œ 'A' æ ‡å¿—ä½ã€‚
"切æ¢é€‰é¡¹" æ›´å为 "布尔选项"。有人会认为 ":set xyz" æ¯æ¬¡éƒ½ä¼šåˆ‡æ¢ 'xyz' å¼€/关。
内部å˜é‡ "shell_error" 包å«å¤–壳的错误代ç ,而ä¸åªæ˜¯ 0 或 1。
æ’å…¥æˆ–æ›¿æ¢æ—¶ï¼Œè¾“å…¥ CTRL-V CTRL-<CR> 过去æ’å…¥ "<C-CR>"ã€‚è¿™ä¸æ˜¯å¾ˆæœ‰ç”¨ã€‚现在忽略
CTRL 键而æ’å…¥ <CR>,和其他带修饰符的 "普通" 键相åŒã€‚这些带修饰符的键组åˆä»ç„¶å¯
ä»¥æ˜ å°„ã€‚
æ’入模å¼ä¸‹ï¼Œå¯ä»¥ç”¨ CTRL-K åŠ <C-CR> 或 <S-Space> æ’入这些特殊å—符。
"quotes" 文件移到 doc/quotes.txt,而 "todo" 文件移到 doc/todo.txt。它们现在和
å…¶å®ƒæ–‡æ¡£æ–‡ä»¶ä¸€æ ·å®‰è£…ã€‚
winheight() 函数对ä¸å˜åœ¨çš„窗å£è¿”回 -1。过去返回 0ï¼Œä½†çŽ°åœ¨è¿™æ˜¯ä¸€ä¸ªåˆæ³•的高度。
'selection' 的缺çœå€¼çŽ°åœ¨æ˜¯ "inclusive"。使用 "$" 或在å¯è§†æ¨¡å¼ä¸‹ç”¨é¼ æ ‡ç§»åŠ¨å…‰æ ‡
时会看到区别。
å˜åœ¨ä¿®æ”¹è¿‡çš„éšè—缓冲区时 ":q!" ä¸é€€å‡ºã€‚":qa!" 则总能退出。
缺çœå…³é— Perl/Python/Tcl 接å£ã€‚ç”¨çš„äººä¸æ˜¯å¾ˆå¤šï¼Œä½†å®ƒä»¬çš„å˜åœ¨ä½¿å¾—坿‰§è¡Œæ–‡ä»¶å¤§å¾ˆ
多。现在对于多数任务而言,内部脚本è¯è¨€å·²ç»è¶³å¤Ÿå¼ºå¤§ã€‚
'titlestring' å’Œ 'iconstring' 选项的å—符串ä¸ç»ç¿»è¯‘è€Œç›´æŽ¥ç”¨äºŽçª—å£æ ‡é¢˜å’Œå›¾æ ‡ã€‚è¿™
æ ·å°±å¯ä»¥åœ¨é‡Œé¢åŒ…å« <CR>ã€‚ä»¥å‰ <CR> 会显示为 "^M" (两个å—符)。
从æ’入模å¼å¯åЍå¯è§†æˆ–选择模å¼ä¸‹çš„æ˜ å°„æ—¶ (æ¨¡å¼æ˜¾ç¤º "(insert) Visual")ï¼Œç›´åˆ°æ˜ å°„
完æˆä¸ºæ¢æ‰è¿”回æ’入模å¼ã€‚è¿™æ ·ï¼Œå¯è§†æ¨¡å¼çš„æ˜ 射也能用于从选择模å¼å¼€å§‹çš„å¯è§†æ¨¡å¼ã€‚
$VIMRUNTIME/menu.vim çš„èœå•ä¸å†å¦å†³å·²æœ‰çš„èœå•ã€‚è¿™æ ·å¯ä»¥åœ¨ .vimrc 文件或者执行
mswin.vim 时定义èœå•。
Unix: 如果å˜åœ¨ï¼Œä½¿ç”¨ /var/tmp æ¥ä¿å˜ .swp 文件。那里的文件在系统é‡å¯æ—¶ä»ç„¶å˜åœ¨
(至少 Linux 如æ¤)。
新增 *added-5.2*
configure 傿•° --with-motif-libï¼Œä½¿ç”¨é™æ€ Motif 库。
æ”¯æŒæ•°å—键盘 +ã€-ã€*ã€/ é”®çš„æ˜ å°„ã€‚(Negri)
å¦‚æžœä¸æ˜ 射,和普通å—符相åŒã€‚
Win32 GUI: 如果放置目录到 gvim 上,cd 到那里并编辑新缓冲区。(Negri)
Win32 GUI: CTRL-Break ç”¨äºŽä¸æ–ï¼Œè¿™æ · CTRL-C å°±å¯ç”¨ä½œæ˜ 射。
":map" 的输出高亮 "*"ï¼Œæ˜Žç™½è¯´æ˜Žå®ƒä¸æ˜¯ rhs 的一部分。(Roemer)
显示å¯è§†åŒºåŸŸæ—¶ï¼ŒçŽ°åœ¨ä¸å…³é—å…‰æ ‡ï¼Œæ–¹ä¾¿å®šä½ã€‚ GUI 现在使用ç°è‰²èƒŒæ™¯é«˜äº®å¯è§†åŒºåŸŸï¼Œ
è¿™æ ·å³ä½¿å…‰æ ‡å转也ä¾ç„¶ä¿æŒå¯è§ã€‚
Win32: å¯åŠ¨æ—¶å¦‚æžœä½¿ç”¨å•个完整路径å (例如åŒå‡»æ–‡ä»¶),cd 到文件的目录。(Negri)
Win32 GUI: 坿’•下èœå•,用 ":tearoff <menu-name>" 命令实现。(Negri)
'guioptions' çš„ 't' 选项: 为 Win32 GUI å’Œ Motif åŠ å…¥å¯æ’•下èœå•项目。缺çœåŒ…å«ã€‚
Win32 GUI: 用 ">>" 指示带åèœå•çš„å¯æ’•下èœå•。(Negri)
åŠ å…¥ ^Kaa å’Œ ^KAA 二åˆå—æ¯ã€‚
"euro" 符å·åŠ åˆ° digraph.c。(Corry)
æ”¯æŒ Motif èœå•å¿«æ·é”®ã€‚'&' 的使用方å¼ç±»ä¼¼äºŽ MS-Windows (Ollis)。
其它的 GUI 忽略èœå•å里é¢çš„ '&'。
DJGPP: å±å¹•æ›´æ–°æ›´å¿« (John Lange)。
å¯¹è¯æ³•ç»„è¿›è¡Œç°‡åˆ ":syntax cluster" (Bigham)。
è¯æ³•文件的包å«: ":syntax include" (Bigham)。
如果 'nosol' ç½®ä½çš„è¯ï¼Œåˆ‡æ¢ç¼“å†²åŒºæ—¶ä¿æŒåˆ—ä¸å˜ Radics)。
Perl 接å£çš„ Number 函数。
Athena GUI çš„ Intellimouse (æ™ºèƒ½é¼ æ ‡) 支æŒã€‚(Jensen)
":sleep" ä¹ŸæŽ¥å— "m" è¡¨ç¤ºçš„æ¯«ç§’å‚æ•°ã€‚
'guioptions' åŠ å…¥ 'p' æ ‡å¿—ä½: 安装进入/退出窗å£äº‹ä»¶çš„回调。Terhaar çš„å…‰æ ‡é—ªçƒ
现在能用了,但我的ä¸è¡Œäº†ã€‚
"--help" å’Œ "--version" å‘½ä»¤è¡Œå‚æ•°ã€‚
":list" è¾“å‡ºçš„éžæ–‡æœ¬ä½¿ç”¨ NonText 高亮。
åŠ å…¥æ–‡æœ¬å¯¹è±¡: "i(" å’Œ "i)" åŒä¹‰äºŽ "ib","i{" å’Œ "i}" åŒä¹‰äºŽ "iB"。新出现: "i<"
å’Œ "i>",选择 <thing> (<> å—)。å¦å¤–ï¼Œè¿™äº›éƒ½æ”¯æŒ "a" 对象。
'shortmess' çš„ 'O' æ ‡å¿—ä½: 读入文件的消æ¯è¦†ç›–以å‰çš„æ¶ˆæ¯ã€‚(Negri)
Win32 GUI: 'guioptions' çš„ 'T' æ ‡å¿—ä½: 切æ¢å·¥å…·æ 的开/关。包å«è‡ªå·±åˆ¶ä½œçš„工具æ
ä½å›¾çš„列表。(Negri)
åŠ å…¥åèœå•çš„èœå•优先级。Win32 å’Œ Motif GUI 有实现。
":menu" 命令显示èœå•优先级。
Default å’Œ Syntax èœå•现在包å«é¡¹ç›®çš„优先级。å¯ä»¥åœ¨ç¼ºçœé¡¹ç›®ä¹‹é—´æ’å…¥èœå•项目。
打开 'number' 选项时,用 LineNr 组高亮行å·ã€‚
"Ignore" 高亮组: 用它高亮的文本被置为空白。用于éšè—帮助文本的特殊å—符。
åŠ å…¥ Exuberant Ctags 2.3 ç‰ˆæœ¬ã€‚å®ƒåŒ…å« C++ 支æŒã€Java 支æŒå’Œé€’归访问目录。
(Hiebert)
å¦‚æžœæ ‡ç¾æ–‡ä»¶æ²¡æœ‰æŽ’åºå¹¶ä¸”æ£€æµ‹åˆ°å¦‚æ¤ (用一个简å•的方法),报错。
":unlet" æŽ¥å— "!",忽略ä¸å˜åœ¨çš„å˜é‡å¹¶æŽ¥å—å¤šäºŽä¸€ä¸ªå‚æ•°ã€‚(Roemer)
补全 ":unlet" çš„å˜é‡å。(Roemer)
如果被其它函数调用的函数里有错误,错误信æ¯é‡Œæ˜¾ç¤ºè°ƒç”¨æ ˆã€‚
新文件å修饰符:
":.": 简约相对于当å‰ç›®å½•的文件å。
":~": 简约相对于主目录的文件å。
":s?pat?sub?": "pat" 替代为 "sub" 一次。
":gs?pat?sub?": 所有的 "pat" 替代为 "sub"。
æ–° configure 傿•°: --enable-min-features å’Œ --enable-max-features。切æ¢åˆ°æœ€å°
å’Œæœ€å¤§ç‰¹æ€§åŒ…çš„ç®€å•æ–¹æ³•。
新的编译时特性: modify_fname。用于文件å修饰符,例如 "%:p:h"。å¯å…³é—以å‡å°‘一些
代ç (16 ä½ DOS)。
æ’入模å¼ä¸‹ä½¿ç”¨æ•´è¡Œè¡¥å…¨æ—¶å¦‚æžœç½®ä½ 'cindent',åˆé€‚地缩进该行。
MSDOS å’Œ Win32 控制å°: 'guicursor' è®¾ç½®å…‰æ ‡çš„åŽšåº¦ã€‚(Negri)
åŒ…å«æ–°çš„ Farsi å—体集åˆã€‚(Shiran)
åŠ é€Ÿé”®æ–‡æœ¬çŽ°åœ¨ä¹Ÿèƒ½ç”¨äºŽ Motif。所有èœå•å¯ä»¥ç”¨ & 定义助记,TAB å®šä¹‰åŠ é€Ÿé”®æ–‡æœ¬ã€‚
䏿”¯æŒçš„系统忽略之。
åˆ é™¤æˆ–æ›¿æ¢èœå•时,èœå•å的比较到助记符之å‰çš„ <Tab> 为æ¢ã€‚
":substitute" 之åŽçš„ 'i' å’Œ 'I' æ ‡å¿—ä½: 忽略大å°å†™ä¸Žå¦ã€‚
如果丢失è¿è¡Œæ—¶æ–‡ä»¶ï¼Œ"make install" 会抱怨。
Unix: 找到已有但ä¸èƒ½æ‰“å¼€çš„äº¤æ¢æ–‡ä»¶æ—¶ï¼Œåœ¨ ATTENTION 消æ¯é‡ŒæåŠæ–‡ä»¶çš„æ‹¥æœ‰è€…。
'complete' çš„ 'i'ã€'t' å’Œ 'k' 选项现在显示æ£åœ¨å¯»æ‰¾çš„åŒ¹é…æ‰€åœ¨çš„ä½ç½®ã€‚(Acevedo)
"gJ" 命令: è¿žæŽ¥è¡Œä¸”ä¸æ’å…¥ç©ºæ ¼ã€‚
设置 'keywordprg' 为 "man -s" 会进行特殊处ç†ã€‚å¦‚æžœæ²¡æœ‰è®¡æ•°ï¼Œåˆ é™¤ "-s",å¦åˆ™åŠ
入计数。configure 会检查 "man -s 2 read" 是å¦èƒ½ç”¨ï¼Œå¹¶æ®æ¤è®¾ç½® 'keywordprg' çš„
缺çœå€¼ã€‚
如果执行 ":bd" æ—¶åªæ‰“开一个窗å£ï¼ŒVIm 试图移动到相åŒç±»åž‹çš„缓冲区 (也就是说,éž
帮助到éžå¸®åŠ©ï¼Œå¸®åŠ©åˆ°å¸®åŠ©)ï¼Œè¿™æ ·å’Œ :bnext/:bprev 的行为一致。(Negri)
å…è®¸æ˜ å°„çš„å³æ‰‹è¾¹ä½¿ç”¨ "<Nop>"。":map xx <Nop>",定义 "xx" 为空。
":menu" 命令å¯ç”¨ "<Tab>" 代替èœå•路径里真æ£çš„åˆ¶è¡¨ã€‚è¿™ä½¿è¾“å…¥æ›´å®¹æ˜“ï¼Œå› ä¸ºä¸éœ€è¦
åæ–œæ 。
POSIX 兼容的æ£è§„表达å¼å—符类: [:alnum:]ã€[:alpha:]ã€[:blank:]ã€[:cntrl:]ã€
[:digit:]ã€[:graph:]ã€[:lower:]ã€[:print:]ã€[:punct:], [:space:]ã€[:upper:]
和 [:xdigit:]。(Briscoe)
æ£è§„表达å¼å—符类 (ä¸ºäº†å¿«é€Ÿè¯æ³•高亮匹é…):
æ•°å—: \d [0-9] \D éžæ•°å— (Roemer)
åå…进制: \x [0-9a-fA-F] \X éžåå…进制
八进制: \o [0-7] \O éžå…«è¿›åˆ¶
å•è¯: \w [a-zA-Z0-9_] \W éžå•è¯
å•è¯é¦–å—符: \h [a-zA-Z_] \H éžå•è¯é¦–å—符
å—æ¯: \a [a-zA-Z] \A éžå—æ¯
å°å†™: \l [a-z] \L éžå°å†™
大写: \u [A-Z] \U éžå¤§å†™
":set" çŽ°åœ¨æŽ¥å— "+="ã€"^=" å’Œ "-=": 从å—ç¬¦ä¸²é€‰é¡¹åŠ å…¥æˆ–åˆ é™¤éƒ¨åˆ†å†…å®¹ï¼Œä»Žæ•°å€¼é€‰é¡¹
åŠ å…¥æˆ–å‡åŽ»æ•°å€¼ã€‚é€—å·åˆ†éš”的列表选项自动 (神奇) 地æ’å…¥æˆ–åˆ é™¤é€—å·ã€‚
æ–‡ä»¶ç±»åž‹ç‰¹æ€§ï¼Œç”¨äºŽè‡ªåŠ¨å‘½ä»¤ã€‚ä½¿ç”¨æ–‡ä»¶ç±»åž‹ä»£æ›¿æ¨¡å¼æ¥åŒ¹é…文件。目å‰åªç”¨äºŽ RISC
OS。(Leonard)
自动命令的模å¼é‡Œå¯ç”¨çŽ¯å¢ƒå˜é‡ã€‚它们在定义自动命令时扩展。
"BufFilePre" å’Œ "BufFilePost" 自动命令事件: ":file" 命令改å˜ç¼“冲区åçš„å‰ä¸ŽåŽã€‚
"VimLeavePre" 自动命令事件: 写入 .viminfo 文件å‰ã€‚
è‡ªåŠ¨å‘½ä»¤å‚æ•°: <abuf> 代表缓冲区å·ï¼Œå’Œ <afile> 类似。
ä¿æŒæ›´å¤šçš„åŒæ¥ä¸Šä¸‹æ–‡ï¼Œå¾€å›žæ»šåŠ¨æ—¶è¯æ³•高亮的速度ç¨å¿«ã€‚
Win32 GUI: åˆ é™¤æˆ–æ’å…¥å±å¹•行时é¿å…é‡ç”»ä»¥åŠ å¿«æ»šåŠ¨ã€‚
GUI: 拇指移动å°äºŽä¸€ä¸ªåƒç´ æ—¶ä¸é‡ç”»æ»šåЍæ¡ä»¥åŠ å¿«æ»šåŠ¨ã€‚
bugreport.vim é‡ŒåŠ å…¥ ":highlight"。
建立 install.exe 程åºï¼Œç®€åŒ– DOS å’Œ MS-Windows 的安装。
新寄å˜å™¨: '_',黑洞。写入时什么都ä¸åšã€‚读å–则总是为空。å¯ç”¨äºŽé¿å…åˆ é™¤æˆ–ä¿®æ”¹å‘½
令对寄å˜å™¨çš„æ”¹å˜ï¼Œæˆ–用于å‡å°‘大改å˜çš„