*version6.txt* For Vim version 7.4. 最近更新: 2013年8月VIM 参考手册 by Bram Moolenaar
译者
: Willis http://vimcdoc.sf.net 欢迎来到 Vim 6.0 版本！新版本增加了很多新特性。本文档列出所有加入的新项目、已 有特性的改动以及 Vim 5.x 的漏洞修正。 |vi_diff.txt| 提供 Vi 和 Vim 6.0 的区别的一个概述。 |version4.txt| 说明 Vim 3.0 和 Vim 4.0 的区别。 |version5.txt| 说明 Vim 4.0 和 Vim 5.0 的区别。 如果你从 Vim 5.x 升级到 6.0 时遇到问题，检查此 列表。 可视模式的光标位置 *curpos-visual*
在可视模式里，如果从同一缓冲区的一个窗口跳到另一个窗口，另一个窗口的光标位置被 调整，以维持相同的可视区域。这可以用来在一个窗口设置可视区域的开始，而在另一个 窗口里设置可视区域的结束。vim 5.x 里会使用另一个窗口的光标位置，它可以在任何地 方，从而不是十分有用。 替代命令与 Vi 兼容 *substitute-CR*
替代字符串 (substitute 命令的 "to" 部分) 现在和 Vi 兼容。以前，CTRL-V
有特殊含 义，可以用来防止<CR>
插入换行符。这使得在换行符之前无法插入CTRL-V
。现在使用 反斜杠来防止<CR>
产生换行符。因为通过反斜杠数量减半，仍然可能在行尾插入换行符 (译者注
: 似应为反斜杠)。这和 Vi 类似，但和 6.0 之前的 Vim 版本不兼容。 如果 ":s" 命令不进行任何替代，它不再设置 '[ 和 '] 位置标记。这和 Vi 无关，因为 它没有这些位置标记。 引入全局选项值 *new-global-values*
现在，局部于缓冲区或者窗口的选项有了全局值。以前，局部选项从一个缓冲区复制到另 一个。如果编辑另一个文件，可能导致模式行的选项值用在错误的文件上。现在进入以前 没有使用过的缓冲区会使用全局值。另外，如果在一个窗口里编辑另一个缓冲区，窗口的 局部变量被复位到它们的全局值上。":set" 命令同时设置局部和全局值，这仍然是兼容 的行为。但模式行只会设置局部值，这与后向不兼容。 现在，":let &opt = val" 设置局部和全局值，类似于 ":set"。加入新的命令，以分别 设置全局或局部值: :let &opt = val 类似于 ":set" :let &g:opt = val 类似于 ":setglobal" :let &l:opt = val 类似于 ":setlocal" 改变 'fileencoding' *fileencoding-changed*
在 Vim 5.x 里，'fileencoding' 用来设置 Vim 里所有的编码。这有点奇怪，因为它是 局部于缓冲区的，但它影响所有的缓冲区。不同缓冲区不可能有不一样，因为它改变了所 有缓冲区的文本的解释方式。 现在，它被用作缓冲区相关文件的编码。如果你仍然设置 'fileencoding'，它可能被 'fileencodings' 检测到的编码替代，因而是 "基本上无害的"。 旧的 FileEncoding 自动命令现在和新的 EncodingChanged 事件相同。 改变二合字母 *digraphs-changed*
缺省的二合字母现在和 RFC1345 对应。这和 Vim 5.x 使用的非常不同。|digraphs| 改变文件类型检测 *filetypedetect-changed*
过去，文件类型检测使用 "filetype" 自动命令组。这和 FileType 事件名混淆 (大小写 是忽略的)。现在，该组叫做 "filetypedetect"。旧的名字仍然可以用，但如果使用了 "filetype" 组，":filetype off" 不会删除里面的自动命令。 'runtimepath' 的支持使得 "myfiletypefile" 和 "mysyntaxfile" 机制被废弃。为 了后向兼容，它们仍然保留。 FileType 事件和 'syntax' 选项的设置之间的联系，以前在 "syntax" 自动命令组里设 置。这和 Syntax 事件名有混淆。该组现在叫 "syntaxset"。 发布的语法文件不再包含 "syntax clear"。这使得在一个文件包含另一个文件不再需要 什么技巧。现在，语法的清理在设置 'syntax' 选项时进行 (通过 synload.vim 里加入 的自动命令)。这使得 'syntax' 的值不对应语法文件时进行语法清理。以前则保留已有 的高亮。 引入列表外缓冲区 *new-unlisted-buffers*
现在缓冲区有不出现在缓冲区列表和实际不在缓冲区列表的区别。":ls"、 ":bnext"、
":blast" 和 Buffers 菜单的命令会跳过不出现在缓冲区列表的缓冲区。
|unlisted-buffer|
'buflisted' 选项可以用来决定缓冲区是否出现在缓冲区列表里。
以前把缓冲区加到缓冲区列表的一些命令现在会建立列表外缓冲区。这意味着 ":bnext"
和 ":ball" 不会找到这些文件，除非实际开始编辑。比如，":write file" 和 ":read
file" 的轮换文件使用的缓冲区。
别的命令以前完全删除缓冲区，而现在只从缓冲区列表里删除缓冲区。依赖于缓冲区
不存在的命令可能会失败。例如，自动命令里用了 ":bdelete" 命令，该自动命令可能会
依赖于其后发生的事情会失败 (过去用于自动测试里)。
|:bwipeout| 可以用来实现 ":bdelete" 的旧含义。
BufDelete 自动命令事件现在当从缓冲区列表里删除缓冲区时激活。BufCreate 事件则在
缓冲区列表里加入了新建立或者已有的缓冲区时激活。BufAdd 是 BufCreate 的新名字。
新的 BufNew 事件用于任何缓冲区的建立，而 BufWipeout 用于真正地删除缓冲区。
如果进行插入模式的补全，只有缓冲区列表里的缓冲区被扫描。在 'complete' 里加入
'U' 标志位可以从列表外缓冲区中寻找补全。
列表外缓冲区不会在 viminfo 文件里保存。
改变命令行模式的 CTRL-U
*CTRL-U-changed*
编辑命令行时，CTRL-U
过去清除整行。多数外壳里，它只清除光标之前的字符。现在使 其行为类似于此。(Steve Wall) 你可以用CTRL-E
CTRL-U
得到旧的行为::cnoremap <C-U> <C-E><C-U>
去掉 Ctags *ctags-gone*
Ctags 不再是 Vim 发布的一部分。现在它自己独立门户，值得自己单独进行发布。 Ctags 可以在这里找到: http://ctags.sf.net/。 重新调整文档 *documentation-6*
文档现在被重新调整，不一定能在 Vim 5.x 相同的位置里找到每个项目。 - 加入了用户手册，有些项目被移到了参考手册。 - 快速参考指南现在放到了单独文件里 (以便打印)。 文档里的示例以前用第一列的 ">" 标出。它增加了复制/粘贴这些示例的困难。现在示 例以单个 ">" 开始，而以第一列出现的 "<" 或非空白结束。这使得没有高亮的时候看 起来好一些。 不再用 'helpfile' 找到帮助标签文件。这使得用户可以加入自己的帮助文件 (比如，插 件的文档)。 无模式选择和剪贴板 *modeless-and-clipboard*
无模式的选择用来在无法使用可视模式时，例如在编辑命令行时或者在 more 提示时。选 择文本。 Vim 5.x 里，总是使用无模式的选择。MS-Windows 上，这导致剪贴板被覆盖，而且没有 办法避免。现在，无模式的选择由 'guioptions' 里的 'a' 和 'A' 标志位以及 'clipboard' 里的 "autoselect" 和 "autoselectml" 控制。缺省，在 MS-Windows 上没 有自动复制。用 |c_CTRL-Y| 命令手动复制选择区。 要得到旧的行为，可以这么做:
:set clipboard^=autoselectml guioptions+=A
细小的不兼容之处 *incomp-small-6*
为了更好的安全性，模式行上不再能设置 'backupdir'、'cdpath'、'directory'、 'equalprg'、'errorfile'、'formatprg'、 'grepprg'、'helpfile'、'makeef'、 'makeprg'、'keywordprg'、'cscopeprg'、 'viminfo' 和 'runtimepath'。 'breakat' 的缺省删除了 '_': 关键字里经常用到。 'mousehide' 的缺省是打开的，因为这适用于多数人。 Amiga 二进制程序现在总是用 "big" 特性编译。"big" 二进制归档不再存在。 'statusline' 里的 "[RO]"、"[+]"、"[help]"、"[Preview]" 和 "[filetype]" 项目不 再有引导空格。 非 Unix 系统: Vim 参数里扩展通配符时，不使用 'suffixes'。现在它的工作方式就像 外壳扩展了这些参数一样。 'paste' 置位时，'lisp'、'smartindent' 和 'cindent' 选项不关闭。'paste' 置位 时，自动缩进被关闭，但用 "=" 的手动缩进仍然可以工作。 用 "=" 排版时，使用 'cindent' 或 'indentexpr' 缩进，如果没有缩进的变动，不作为 改变处理 (不置位 'modified'，而且没有什么可撤销的)。 如果设置了 'fileencoding' 或 'fileformat'，报告 'modified' 为已修改。这样它忠 实地反映了放弃缓冲区是否会丢失改变的可能性。 "Save As" 菜单项目现在编辑要保存的文件。多数人期望它就是如此。 目录的缓冲区不再加到 Buffers 菜单里。<Return>
被换名为<Enter>
，因为这是多数键盘的称呼方式。这样，现在我们说 hit-enter 提示，而不是 hit-return 提示。 可以就像<CR>
或<Return>
那样映射<Enter>
。 如果没有置位 'compatible'，'viminfo' 选项的缺省现在是 '20,"50,h。多数用户希望 使用该功能，包括初学者，但这需要设置该选项，这并不容易。 用了 ":colder" 以后，新的错误列表被覆盖。可用于使用 ":grep" 进行树状方式浏览。 必须使用 ":cnewer 99" 才能得到原来的行为。 'errorformat' 的模式有时会忽略大小写 (MS-Windows)，有时又不会 (Unix)。现在，总 是忽略大小写。在模式里加上 "\C" 以匹配大小写。 现在，16 位 MS-DOS 版本编译时不加入 +listcmds 特性 (操作缓冲区列表的命令)。并 不经常需要它们，而这使需要的可执行文件小一些。 现在，'sessionoptions' 缺省包括 "curdir"。这意味着恢复会话会使得当前目录也被恢 复，而不是转到会话文件所在的目录上。 过去，会话删除所有的缓冲区，删除所有的位置标记。现在保持了缓冲区列表，不应该影 响已有的缓冲区的继续存在。 如果参数列表为空，":argdel *" 过去产生错误信息。 不再把标签跳转的搜索模式放到历史里。 不可显示字符的高亮使用 "SpecialKey" 高亮，而不再是 "NonText"。这里的思路是，不 可显示字符或者任何和文件里的字符的显示不同的文本使用 "SpecialKey"，而 "NonText" 用于文件里实际不存在的文本。 Motif 的菜单和滚动条现在使用系统的缺省颜色。过去是灰色的。你仍然可以用 ":highlight" 命令和资源设置颜色。 "gq" 的文本排版在非空的空白行上断开段落。过去该行被删除，看来那种方法不怎么有 用。 如果参数在命令未完成时结束，":normal" 不再挂起。 过去 Vim 会等到输入更多的字符，但不刷新屏幕。现在，它假设输入了一个<Esc>
。 工具栏的位图不再从 "$VIM/bitmaps" 里寻找，而是从 'runtimepath' 的 "bitmaps" 目 录下寻找。 现在，hit-enter 提示使用命令行模式的菜单，而不是普通模式的菜单。通常，这样效果 更好，而且允许使用 "Copy" 菜单，以产生CTRL-Y
莱复制无模式选择区。 字体选择从 Windows 移到了 Edit 菜单，包括其它的设置。 缺省的 'isfname' 包含了更多字符，使得 "gf" 效果更好。 文档的许可证改为 Open Publication License。看起来很公平，因为它包含了 "the Vim book" 的部分内容，而后者也在 OPL 下发行。不利之处是，我们不能再强制销售手册的 人为乌干达作贡献了。 "ayy 之后，不要让 ""yy 或 :let @" = val 覆盖 "a 寄存器。使用无名寄存器代替。 MSDOS: 模式 "*.*" 过去也匹配没有句号的文件名。这和其它版本不一致。 插入模式里，CTRL-O
CTRL-\
CTRL-N
{cmd}
留在普通模式。过去它会回到插入模式。这 使得CTRL-\
CTRL-N
的含义不清，因为它应该把我们带到普通模式 (尤其是在 ":amenu" 里)。 允许操作符后面使用 ":" 命令。可以用来实现新的移动命令。它不再中止等待的操作 符。 Amiga 上可以使用 "-d{device}
" 参数。如果编译时加入 diff 特性，就不行了。可用 "-dev{device}
" 代替。|-dev| 插入模式下的<S-Insert>
缺省映射按本义插入文本，这样避免了 BS 这样的特殊字符产 生副作用。 ":confirm" 过去适用于一行的其余部分。现在只适用于其后的命令。因而， ":confirm if x | edit | endif" 就不行了。 要用 ":if x | confirm edit | endif"。这才是原来的想法，过去的工作方式不同是个 漏洞。
新 特 性 *new-6*
折叠 *new-folding*
Vim 现在可以显示文本折叠的缓冲区。能用于快速浏览文件结构。也可以抽出、删除和放 置折叠的文本，比如把函数移动到另一个位置。 有一系列相关的新的命令和选项。见 |folding|。 垂直分割窗口 *new-vertsplit*
窗口也可以垂直分割。这使得窗口可以肩并肩的显示。它很好的一个使用方式是比较两个 相似的文件 (见 |new-diff-mode|)。'scrollbind' 选项可以用来同步滚动。 垂直分割可以用下面的命令建立: :vsplit 或CTRL-W
v 或CTRL-W
CTRL-V
|:vsplit| :vnew |:vnew| :vertical{cmd}
|:vertical| 最后一个是修饰符，它对任何分割窗口的命令有意义。比如::vertical stag main
会垂直分割窗口，然后在新窗口里跳转到标签 "main"。 窗口到窗口的水平切换可以用 |CTRL-W_h| 和 |CTRL-W_l| 命令完成。|CTRL-W_k| 和 |CTRL-W_j| 命令被改为跳转到光标位置之上和之下的窗口。 垂直和水平分割可以用你愿意的任何方式组合。如果使用鼠标，改变窗口大小很容易，只 要把指针定位在状态行上或者垂直分割线上然后拖动就可以了。GUI 上，特殊的鼠标指针 形状指示你在哪里可以拖动状态行或分割线。 要改变垂直分割的窗口的大小，用 |CTRL-W_<| 和 |CTRL-W_>| 命令。 要使得窗口使用最大宽度，用CTRL-W
| 命令 |CTRL-W_bar|。 要强制新窗口使用 Vim 窗口的全部宽度或高度，可以使用这两个修饰符: :topleft{cmd}
新窗口出现在顶部并使用全部宽度，或在左侧并使用 全部高度。 :botright{cmd}
新窗口出现在底部并使用全部宽度，或在右侧并使用 全部高度。 这可以和 ":vertical" 一起使用，来强制垂直分割::vert bot dsplit DEBUG
会在最右侧打开窗口，占据 Vim 窗口的全部高度，光标在第一个 "DEBUG" 的定义上。 如果当前窗口的宽度不到 80 个字符，帮助窗口在上方打开，就像使用了 ":topleft" 一 样。 若干选项可以用来设置垂直分割窗口的属性。这和已经有的水平的等价命令相类似:水平 垂直
'splitbelow' 'splitright' 'winheight' 'winwidth' 'winminheight' 'winminwidth' 可以设置 'winminwidth' 为零，使得不用的窗口暂时几乎不占据任何空间，而不用关闭 它们。 新的 'eadirection' 选项指示哪里可以应用 'equalalways': :set eadirection=both 两个方向 :set eadirection=ver 使窗口高度相同 :set eadirection=hor 使窗口宽度相同 可以用来避免在你需要保持窗口大小的时候改变之。 因为垂直分割可以使窗口变得很窄，文本行经常可能放不下。加入了 'sidescrolloff' 选项，使得光标左右可以保留一些上下文。'listchars' 选项被扩展，加入了 "precedes" 项目，它在文本左侧离开屏幕时显示记号，比如说，"<"。(Utz-Uwe Haus) "-O" 命令行参数: 类似于 "-o"，但垂直分割窗口。(Scott Urban) 加入命令，使得当前窗口移到最顶部 (CTRL-W
K)，底部 (CTRL-W
J)，左侧 (CTRL-W
H) 和右侧 (CTRL-W
L)。在新的位置上，窗口使用屏幕的完整的宽度/高度。 如果状态行上没有足够的空间同时显示文件名和标尺，标尺使用一半的宽度。用于狭窄的 窗口。 diff 模式 *new-diff-mode*
在 diff 模式里，Vim 显示两个、三个或四个文件的差异。折叠用来隐藏文件的相同部 分。高亮用来显示删除和改变的行。见 |diff-mode|。 启动 diff 模式的简单方法是用 "vimdiff file1 file2" 启动 Vim。 加入了 vimdiff 手册页面。 在运行中的 Vim 里，|:diffsplit| 命令用当前文件和另一个文件开始 diff 模式。 |:diffpatch| 命令使用当前文件和补丁文件开始 diff 模式。|:diffthis| 命令开始当 前窗口的 diff 模式。 可以用 |:diffget| 和 |:diffput| 命令消除不同之处。 - 'diff' 选项打开窗口的 diff 模式。 - |:diffupdate| 命令刷新比较结果。 - 'diffopt' 选项改变差异文的显示方法。 - 'diffexpr' 选项可以设置如何得到比较结果。 - 'patchexpr' 选项可以设置如何把补丁应用到文件上。 - 加入 "diff" 折叠方法。如果打开窗口进入 diff 模式，设置 'foldlevel' 为零并打 开 'foldenable' 可以关闭折叠。 - 加入 DiffAdd、DiffChange、DiffDelete 和 DiffText 高亮组以指定差异文的高亮方 式。缺省设置挺难看的... - Unix: "make install" 里使 vimdiff 成为一个符号链接。 - 从发布里删除现在废弃的 "vimdiff.vim" 脚本。 - 加入 "[c" 和 "]c" 命令，在 diff 模式里移动到下一个/前一个改变。 简易 Vim: 点击-输入 *new-evim*
eVim 代表 "Easy Vim" (简易 Vim)。这是一个单独的程序，但也可用 "vim -y" 启动。 Vim 这样启动时，置位 'insertmode'，以打开点击-输入的编辑方式。使用 $VIMRUNTIME/evim.vim 脚本加入一些映射和设置一些选项，使得多数行为类似于 Notepad。这是为那些不能忍受两种模式的人专门设计的。 eView 和它一样，但使用只读模式。 GUI 上，CTRL-C
现在只在忙于做事情的时候中断，等待输入的时候不算。可以使用CTRL-C
来复制文本到剪贴板。 用户手册 *new-user-manual*
加入了用户手册。它的组织围绕着编辑任务进行。从头到底读起来，就像一本书。它方便 初学者开始学习 Vim，也帮助所有人学习使用最有用的 Vim 特性。它比阅读参考手册容 易得多，但没有提供其中一些细节。见 |user-manual|。 用户手册包含了 Steve Oualline 的 "the Vim book" 的部分内容 |frombook|。 它在 OPL 下发行 |manual-copyright|。 如果没有打开语法高亮，帮助文件里标注示例 ('>' 和 '<') 和头部行 ('~') 的字符被 空格代替。 关闭帮助窗口时，如果窗口布局从那时起没有改变的话，窗口布局恢复为打开帮助之前的 状况。 打开帮助窗口时，如果当前窗口的宽度小于 80 个字符并且不是屏幕的全部宽度，把它放 在 Vim 窗口的顶部。 灵活的缩进方式 *new-indent-flex*
自动缩进现在可以用于任何语言。它用 Vim 脚本实现，使得缩进的计算非常灵活。 ":filetype indent on" 命令允许使用提供的缩进脚本。用户手册有解释: |30.3|。 计算 'indentexpr' 选项可以得到行的缩进。'indentkeys' 选项指示什么时候重新启动 缩进。通常，这些选项在缩进脚本里设置。就像语法文件一样，缩进脚本也会由很多人提 供和维护。 扩展的搜索模式 *new-searchpat*
增加了模式匹配多行的可能性。 (部分由 Loic Grenie 提供) 搜索模式里增加的用于多行匹配的新项目: \n 匹配行尾，在 [] 里也是 \_[] 匹配范围里的字符还有行尾 \_x 匹配字符类还有行尾 \_. 匹配任何字符还有行尾 \_^ 匹配行首，可以用在正规表达式的任何位置 \_$ 匹配行尾，可以用在正规表达式的任何位置 若干其它搜索模式的新项目: \c 忽略整个模式的大小写 \C 匹配整个模式的大小写 \m 为后面打开 magic \M 为后面关闭 magic \v 使得后面的字符 "非常 magic" \V 使得后面的字符 "非常不 magic" \@! 不匹配前导的匹配原。 例如: "foo\(bar\)\@!" 匹配 "foo " 但不是 "foobar"。 \@= 匹配匹配原，产生零宽度的匹配 例如: "foo\(bar\)\@=" 匹配 "foobar" 里的 "foo"。 \@<! 光标之前不匹配前导的匹配原 \@<= 光标之前匹配前导的匹配原 \@> 作为子表达式匹配前导的匹配原 (不能回溯) \& 只有在前面和后面的分支都匹配的时候才匹配 \%[] 可选的匹配匹配原的列表；"end\%[if]" 匹配 "end"、"endi" 和 "endif" \%(\) 类似于 \(\)，但不建立反向引用；可以由任何数量，突破了 \( \) 组对只能有九个的限制 \%^ 匹配文件首 (Chase Tingley) \%$ 匹配文件尾 (Chase Tingley) \%# 匹配光标位置。(Chase Tingley) \? 类似于 "\="，但不能用于 "?" 命令。  设置外部引用匹配 (在区域项目的开始模式里) \z1 - \z9 使用外部引用匹配 (在区域项目的跳过或结束模式里) (Scott Bigham) \zs 使用该位置作为匹配的开始 \ze 使用该位置作为匹配的结束 取消了匹配只能有不超过 32767 次的 *，\+ 等等的限制。 增加了匹配多字节字符的支持。(部分有 Muraoka Taro 提供) 使得 "\<" 和 "\>" 支持 UTF-8。(Muraoka Taro) UTF-8 支持 *new-utf-8*
Vim 现在可以编辑 UTF-8 编码的文件。可以使用至多 31 位的字符，但只能显示 16 位 字符。支持不超过两个的组合用字符，它们叠加在前导字符之上。还支持双宽字符。见 |UTF-8|。 也支持 UCS-2、UCS-4 和 UTF-16 编码，它们在内部转换为 UTF-8。还提供在 Latin1 环境下编辑 Unicode 文件的支持。其它的编码使用 iconv() 转换，或者使用 'charconvert' 指定的外部转换器。 有许多多字节支持的新项目: - 加入 'encoding' 选项: 指定 Vim 内使用的字符编码。可以是任何 8 位编码，一些双 字节编码或者是 Unicode。它从环境中初始化，如果找到能支持的值的话。 - 加入 'fileencoding' 和 'fileencodings': 指定文件的字符编码，类似于 'fileformat' 和 'fileformats'。 如果 'encoding' 为 "utf-8" 而 'fileencodings' 为 "utf-8,latin1"，那么如果文 件不是合法的 UTF-8，它被自动切换为 latin1。 - 加入 'bomb' 选项以检测文件开头的 BOM。可以在 'fileencodings' 里指定 "ucs-bom" 以自动判断文件是否以 BOM 开头，从而检测出 Unicode 文件。在 MS-Windows (NT 和 2000) 里尤其有用，因为它使用带 BOM 的 ucs-2le 文件 (比如，注册表的导出文件)。 - 加入 'termencoding' 选项: 指定终端使用的编码。可用于在非 Unicode 的 locale 里把 Vim 置于 utf-8 模式::let &termencoding = &encoding
:set encoding=utf-8
- 如果 'viminfo' 包含 'c' 标志位，viminfo 文件从写入时的 'encoding' 转换为当前 的 'encoding'。 - 加入 ":scriptencoding" 命令: 转换要执行的脚本的文本行到 'encoding' 编码。可 用于菜单文件。 - 加入 'guifontwide' 已指定双宽字符的字体。 - 加入韩语的字符类检测支持。同时修正了 search.c 的 cls()。(Chong-Dae Park) - Win32: 无需 IME 输入多字节字符。(Alexander Smishlajev) - Win32 使用 Mingw: 编译时加入 iconv 库。(Ron Aaron) - Win32 使用 MSVC: 动态载入 iconv.dll 库。(Muraoka Taro) - 可以用 Borland 5.5 编译多字节版本和 iconv 支持。(Yasuhiro Matsumoto) - 加入 'delcombine' 选项: 单独删除组合用字符。(Ron Aaron) - "xim" 不需要 "xfontset" 特性。现在，它们是两个独立的特性。 - XIM: 输入语言字符时打开 XIM (插入模式、搜索模式、"f" 或 "r" 命令)。输入普通 模式命令时关闭 XIM。 - XIM 激活时，'showmode' 消息显示 "XIM"。(Nam SungHyun) - 支持 XIM 的 "CursorIM"。(Nam SungHyun) - 'formatoptions' 加入 'm' 标志位: 回绕单词时，允许在每个多字节上分割，而不单 是空格上。 - 使 ":syntax keyword" 能用于多字节字符。 - 加入 Unicode 大写/小写反转和比较的支持。(基于 Raphael Finkel 的补丁) 有第三种写法 ("title case"，词首字母大写) 的多字节字符上用 "~" 可以在三种写 法间切换。 (Raphael Finkel) 允许为多字节字符定义二合字母。 加入 Unicode 的 RFC1345 二合字母。 多数接受字符参数的普通模式命令，比如 "r"、"t" 和 "f" 现在可以接受二合字母。 'cpoptions' 的 'D' 标志位关闭这一功能，以和 Vi 兼容。 加入语言映射和 'keymap' 以便输入多字节字符: - 加入 ":lmap" 命令和相关设置: 定义输入该文本语言的字符使用的映射，也适用于 "r"、"t" 等。插入和命令行模式下，CTRL-^
切换映射的开关。 如果没有语言映射的话。CTRL-^
也切换输入方法 (Input Method) 的使用。可以在输 入一半的时候切换出 IM。 - ":map" 的 "<char-123>
" 参数可以指定字符的十进制、八进制和十六进制的值。 - 实现了 'keymap' 选项: 载入键盘映射表文件。用 ":lnoremap" 来定义该键盘映射表 的映射。新的 ":loadkeymap" 命令可以在键盘映射表文件里使用。 - 加入 'statusline' 的 'k' 标志位: 使用键盘映射表时，"b:keymap_name" 或者说 'keymap' 的值。如果没有载入键盘映射表而激活了 ":lmap" 的话，"<lang>
"。在缺省 的状态行里也显示此文本。 - 加入 'iminsert' 和 'imsearch' 选项: 用选项指定使用的是 langmap 映射和输入方 法。(Muraoka Taro) 加入 'imcmdline' 选项: 如果置位，开始编辑命令行时总是打开输入方法。可用于使 用死键 (dead key) 输入带重音的字符的 XIM。 加入 'imactivatekey' 选项以更好的控制 XIM。(Muraoka Taro) - 输入还没有结束的映射时，在插入模式和命令行模式里，显示光标下的最后一个字符。 对死键字符看起来不错。 - 使得 'langmap' 选项能识别多字节字符。不过映射只能用于 8-位字符。有助于使用 UTF-8。 - ":lmap" 映射激活时，使用不同的光标。可以在 'guicursor' 的每个项目里指定两种 高亮组 (用和不用语言映射)。缺省 "lCursor" 和 "Cursor" 是一样的，用户必须自己 设定他喜欢的颜色。 韩语输入页使用光标颜色。(Sung-Hyun Nam) - 如果语言映射打开，'showmode' 里显示 "(lang)"。 - UTF-8: "r" 可用包含合成用字符的 ":lmap"。也适用于 "f，现在可以寻找包含合成用 字符的字符。 其它多字节字符的新增特点: - euc-jp 支持双字节单宽度字符: 0x8E 开始的字符。增加 ScreenLines2[] 来保存第二 个字节。 多语言支持 *new-multi-lang*
Vim 使用的消息可以翻译。已经有几个翻译版本。这里，使用了 gettext 机制。它可以 加入翻译版本而无需重新编译 Vim。|multi-lang| (部分由 Marcin Dalecki 提供) 翻译文件在 src/po 目录里。src/po/README.txt 文件解释进行翻译的一些事项。 也可以用翻译的菜单。用新的 |:menutranslate| 命令。翻译可以在运行时目录 "lang" 里找到。用户因而可以增加翻译。 加入 |:language| 命令来设置消息、时间和字符类型的语言 (locale)。可以用来在 Vim 里切换语言，而无需离开 Vim 去更改 locale。 可以使用不同语言的 vimtutor。(Eduardo Fernandez) 现在包含了西班牙语 (Eduardo Fernandez)、意大利语 (Antonio Colombo)、日语 (Yasuhiro Matsumoto) 和法语 (Adrien Beau) 的翻译。 加入 "vimtutor.bat": MS-Windows 上，在教学文件上启动 Vim 的脚本。(Dan Sharp) - 加入 v:lang 变量已得到当前的语言设置。(Marcin Dalecki) 还有 v:lc_time 和 v:ctype。 - 可以翻译菜单使用的对话框。使用全局的 "menutrans_" 变量。":menutrans clear" 删除它们。 - 删除了 "有问题的 locale" (Marcin Dalecki)。 - 图标里不使用色彩名，使用 RGB 值。名字可能被翻译。 - Win32: 加入 global IME 支持 (Muraoka) - Win32: 加入动态载入 IME 的支持。 - ":messages" 显示关于谁维护消息或翻译的信息。可用于找到哪里可以给出错误翻译的 意见的相关信息。 - configure 的 --disable-nls 参数: 关闭 gettext() 的使用。(Sung-Hyun Nam) - 加入使用 MingW 编译器的 Win32 版本的 NLS 支持。(Eduardo Fernandez) - 如果可用，调用 bind_textdomain_codeset() 来使得 gettext() 把消息翻译成 'encoding'。这需要 GNU gettext 0.10.36 或其后的版本。 - 加入 Win32 的 gettext 支持。这意味着消息会在设置了 locale 和找到 libintl.dll 的前提下被翻译。(Muraoka Taro) 也可以用于 MingW 编译器的版本。(Eduardo Fernandez) 检测语言并设置 $LANG 已得到合适的翻译过的消息 (如果支持的话)。也用 $LANG 来 选择语言，:lang 是不同类型的名字。 - 使得 gvimext.dll 使用翻译过的消息，如果可能的话。(Yasuhiro Matsumoto) 插件支持 *new-plugins*
要在启动 Vim 时非常方便地载入 Vim 脚本，可以用 "plugin" 运行时目录。所以这里面
的 "*.vim" 文件被自动载入。Unix 上，缺省使用 "~/.vim/plugin"。 'runtimepath'
选项可以设置在别的目录下查找插件。|load-plugins| |add-plugin|
加入 |:runtime| 命令以载入一个或多个 'runtimepath' 的文件。
标准插件:
netrw.vim - 在网络上编辑文件 |new-network-files|
gzip.vim - 编辑压缩文件
explorer.vim - 浏览目录 |new-file-browser|
加入本地帮助文件的支持。|add-local-help|。
搜索帮助标签时，使用 'runtimepath' 的 "doc/tags" 的所有文件。
加入 ":helptags" 命令: 为一个帮助目录生成标签文件。
每个帮助文件的第一行被自动 (神奇地) 加到 doc/help.txt 的 "本地附加文档" 一节。
":map" 加入 <unique>
参数: 只有在没有定义过的时候才加入映射。
设置 'verbose' 以后显示选项值会给出关于该选项最后在哪里设置的消息。对发现什么
脚本设置了选项非常有用。
新的 |:scriptnames| 命令显示所有执行过的脚本的列表。
GUI: Athena、Motif 和 GTK 版本在 'runtimepath' 的 "bitmaps" 目录里寻找工具栏位
图。可以加入你自己的位图。
文件类型插件 *new-filetype-plugins*
加入一组新的文件，提供特定文件类型的设置。它们是专用于 'filetype' 某个值的选项 和映射。 这些文件在 "$VIMRUNTIME/ftplugin" 里。'runtimepath' 选项可以使你使用几组不同的 插件: 你自己的、系统范围的、Vim 发布里包含的，等等。 要使之工作，加入了若干特性: - 加入 "s:" 变量，局部于脚本。避免和全局变量的命令冲突。可用于脚本和脚本里定义 的函数、自动命令和用户命令。在同一脚本的多次调用间保持它们的值。|s:var| - 加入局部选项的全局值。该值在打开新缓冲区或者编辑另一个文件的时候使用。模式行 或文件类型设置不会带到另一个缓冲区里去。 ":set" 同时设置局部和全局值。 ":setlocal" 只设置局部选项值。 ":setglobal" 设置和显示局部选项的全局值。 ":setlocal name<" 设置局部选项为其全局值。 - 加入一些全局选项的局部于缓冲区的值: 'equalprg'、'makeprg'、'errorformat'、 'grepprg'、'path'、'dictionary'、'thesaurus'、'tags'、'include' 和 'define'。可以设置这些全局选项的局部值，而不会使它不兼容。 - 加入局部于缓冲区的映射和缩写: ":map<buffer>
"。 - 映射里可以用 "<Leader>
" 得到 "mapleader" 变量的值。这简化了使用 "mapleader" 的映射。"<Leader>
" 缺省为 "\"。"<LocalLeader>
" 和 "maplocalleader" 相同。它 用在局部于缓冲区的映射里。 - 加入脚本 ID<SID>
，定义局部于脚本的函数和映射。 - ":noremap" 和 ":noremenu" 加入<script>
参数: 只重映射局部于脚本的映射。避免 其它脚本的映射的妨碍，但允许使用脚本里定义的映射。 - 用户命令可以局部于缓冲区: ":command -buffer"。 文件类型检测的自动命令使用新的 ":setfiletype" 命令，以避免设置 'filetype' 两 次。 文件浏览器 *new-file-browser*
编辑目录时，explorer 插件会列出该目录的文件。在文件名上按<Enter>
编辑该文件。 在目录上按<Enter>
切换浏览器到该目录里。 有若干其它的可能，比如在预览窗口里打开文件，给文件换名或者删除文件。 在网络上编辑文件 *new-network-files*
scp://、rcp://、ftp:// 和 http:// 开始的文件被识别为远程文件。使用指定的方法， 作出相应的尝试以取得该文件。http:// 只能读取，其他的方法也支持写入。这里，使用 了标准 "插件" netrw.vim 脚本。|netrw| 使得 "gf" 可用于 URL 上。它不再假设该文件是在本地计算机上的 (多数也不会工作， 因为需要完整路径)。为此，调整了 test2。 允许在 'path' 里使用 URL。使得 ":find index.html" 可以工作。 GTK: 允许在 Vim 上放置 (drop) http:// 和 ftp:// URL。netrw 插件会处理文件的下 载。 (MiKael Berthe) 命令行编辑的窗口 *new-cmdwin*
命令行窗口可以使用普通模式和插入模式的命令来编辑命令行。打开的时候，它包含历史 记录。从而可以从以前的命令行上复制部分内容。|cmdwin| 命令行窗口可以从命令行上用 'cedit' 选项指定的键打开 (类似于 Nvi)。也可以直接在 普通模式里用 "q:"、"q/" 和 "q?" 打开。 'cmdwinheight' 指定该窗口的初始高度。 插入模式里，CTRL-X
CTRL-V
补全 Ex 命令行，就像命令行所做的那样。可以用来编写 Vim 脚本！ 另外，还有 "增强的 Ex 模式"。Vim 以 "exim" 或 "vim -E" 启动，或者使用 "gQ" 命 令都可以进入该模式。就像重复使用 ":" 命令一样，提供完整的命令行编辑和补全功 能。(Ulf Carlsson) 调试模式 *new-debug-mode*
在调试模式里，脚本和用户函数的执行可以逐行进行。提供跳过 (step over) 或跳入
(step into) 命令的命令。|debug-mode|
可以设置断点，使得继续运行，直到在脚本或用户函数的特定行上停止。|:breakadd|
调试可以用 ":debug {cmd}
" 开始，它调试执行该命令时发生了什么事。启动时，可以用
|-D| 参数来调试。
虚拟位置的光标 *new-virtedit*
加入 'virtualedit' 选项: 插入模式、可视模式或任何情况下，可以定位光标到没有实 际字符存在的位置。(Matthias Kramm) 对可视列块模式特别有用。它能定位到区域的没有文本字符的一角。(许多改进由 Chase Tingley 提供) 调试器接口 *new-debug-itf*
原先，这是为 Sun Visual Workshop 提供的。(Gordon Prieur) 见 |debugger.txt|、|sign.txt| 和 |workshop.txt|。 加入 ":sign" 命令，定义和放置标号。它们可以显示为两个 ASCII 字符或一个图标。标 号之后的行被高亮显示。可以用来显示断点和当前的 PC 位置。 加入 |:wsverb| 命令来执行调试器命令。 加入气泡的设置: 'balloondelay' 和 'ballooneval' 选项。 加入 ":menu" 的 "icon=" 参数。可以为某个 ToolBar 项目定义特定的图标。 Vim 间的通信 *new-vim-server*
加入两个 Vim 之间的通信机制。可以从一个 Vim 发送命令到另一个 Vim。支持 X-Windows 和 MS-Windows |clientserver|。 用 "--remote" 来用已经运行的 Vim 里编辑文件。 用 "--remote-wait" 来做相同的事，并等待编辑结束。 用 "--remote-send" 从一个 Vim 发送命令给另一个。 用 "--remote-expr" 来在另一个 Vim 里计算表达式。 用 "--serverlist" 列出当前可用的 Vim 服务器。(只限于 X) 还有服务器和客户之间通信的函数。|remote_send()| |remote_expr()| (X-windows 版本由 Flemming Madsen 实现，MS-Windows 版本由 Paul Moore 提供) 在窗口标题里加入命令服务器的名字，使得你可以看到哪个服务器名属于哪个 Vim。 从发布里删除了 OleVim 目录、SendToVim.exe 和 EditWithVim.exe。现在可以用可以 移植的 "gvim --remote" 和 "gvim --remote-send"。 GTK+: 支持在别的窗口里运行 Vim。用 --socketid 参数 (Neil Bird) 缓冲区类型选项 *new-buftype*
加入了 'buftype' 和 'bufhidden' 选项。它们可以设置不同类型的缓冲区。例如: - 'buftype' = "quickfix": 错误列表缓冲区 - 'buftype' = "nofile" 而 'bufhidden' = "delete": 草稿缓冲区，一旦没有窗口显 示，会尽快删除。 'bufhidden' 可以用来否决一个缓冲区的 'hidden' 选项。 这些选项与 'buflisted' 和 'swapfile' 的组合提供了使用不同类型的特殊缓冲区的可 能性。见 |special-buffers|。 打印 *new-printing*
包含了第一个 ":hardcopy" 命令的实现，用以打印到纸张上。MS-Windows 上，可以使用 任何安装的打印机。其他系统上，生成 PostScript 文件，可以用 'printexpr' 选项进 行打印。 (MS-Windows 部分由 Vince Negri、Vipin Aravind 提供，PostScript 由 Vince Negri 和 Mike Williams 提供) 使得 ":hardcopy" 可用于多字节字符。(Muraoka Taro，Yasuhiro Matsumoto) 加入选项，微调打印的工作方式: (Vince Negri) - 'printoptions' 定义一些设置。 - 'printheader' 指定页眉格式。'statusline' 加入了 "N" 域，显示页号。 - 'printfont' 指定字体名和属性。 - 'printdevice' 定义 ":hardcopy!" 的缺省打印机。 移植版本 *ports-6*
OS/390 Unix 的移植版本 (Ralf Schandl) - 很多改动，为了处理 EBCDIC 编码。 - 改变 Ctrl('x') 为 Ctrl_x 定义。 包含 jsbmouse 支持。(Darren Garth) Unix 上支持 dec 鼠标。(Steve Wall) 移植到 16 位 MS Windows (Windows 3.1x) (Vince Negri) 移植到 QNX。支持 Photon GUI、鼠标等。(Julian Kinraid) 用 Make_ming.mak 可以进行 Win32 版本的跨平台编译。(Ron Aaron) Mingw 的编译加入 Python 支持。(Ron Aaron) 32 位 Dos: 加入 Windows 剪贴板的支持。(David Kotchan) Win32: 动态载入 Perl 和 Python。可以编译 Vim 来使用这些接口，并在运行时寻找这 些 DLL。(Muraoka Taro) 用 Cygwin 编译 Win32 GUI。同时编译 vimrun、dosinst 和 uninstall。(Gerfried) Mac: 使得 Vim 能用 Apple 提供的免费的 MPW 编译器编译。CodeWarrior 的更新。 (Axel Kielhorn) 加入一些类型转换和 ifdef，作为 Vim 在 Win64 上工作的开始 (George Reilly) 扩展的 Quickfix *quickfix-6*
加入 "错误窗口"。它包含了所有的当前错误列表的错误。在一行上按 <Enter>
使得 Vim
跳转到该行上 (在别的窗口里)。这使得错误列表的导航容易得多。|quickfix-window|。
- |:copen| 打开 quickfix 窗口。
- |:cclose| 关闭 quickfix 窗口。
- |:cwindow| 只在有识别出来的错误时，才打开 quickfix 窗口。(Dan Sharp)
- 除了 "warning" 和 "error" 类型以外，Quickfix 也知道 "info"。"%I" 可用来定义
多行信息消息的开始。(Tony Leneis)
- 'errorformat' 里的 "%p" 参数可用来得到指针行的列号，其中 "^" 指向该列。
(Stefan Roemer)
- DOS/Windows 系统上，'errorformat' 的 "%f" 会在文件名里加入 "c:"，即使使用的
是 "%f:"。
操作符修饰符 *new-operator-mod*
操作符和动作命令之间插入 "v"、"V" 或 CTRL-V
强制该操作符以面向字符、面向行和面
向列块的方式工作。|o_v|
搜索路径 *new-search-path*
Vim 可以在目录树里搜索，不只是往下，也可以往上。
可用于 'path'、'cdpath' 和 'tags' 选项。(Ralf Schandl)
也用于 'tags' 选项的 "**"。(Ralf Schandl)
加入 'includeexpr'，用来修改 'include' 选项找到的文件名。
'includeexpr' 也在 "gf" 和 "<cfile>
" 里使用，如果找不到未经修改的文件的话。用
于在 include 或 import 语句之后的名字上执行 "gf"。
加入 'cdpath' 选项: 找到 ":cd" 参数的位置。(Raf)
加入 'suffixesadd' 选项: 用 "gf"、"[I" 等命令搜索文件时给文件名附加的后缀。
改进文件写入 *new-file-writing*
加入 'backupcopy' 选项: 选择文件要通过复制还是换名来建立备份文件。用于在 Unix 上加快写入普通文件的速度。其它系统上，也有助于保留文件属性和编辑 Unix 文件系统 的文件。 加入 'autowriteall' 选项。和 'autowrite' 类似，但用于更多命令。 加入 'backupskip' 选项: 文件名模式的列表，如果匹配，不建立备份。Unix 的缺省值 包含 "/tmp/*"，这使得 "crontab -e" 可以工作。 加入 FreeBSD 和 Win32 上的访问控制表 (ACL) 的支持。ACL 从原来的文件复制到新文 件里 (或者备份文件，如果选择它是复制建立的话)。 AIX、Solaris 和通用的 POSIX 也支持 ACL。(Tomas Ogren) SGI 亦然。 参数列表 *new-argument-list*
参数列表的支持也有了扩展。现在，可以操作参数列表以包含你要包含的文件。 参数列表现在可以局部于窗口。用 |:arglocal| 命令建立这样的参数列表。 |:argglobal| 命令可以用来回到全局的参数列表。 |:argdo| 命令在参数列表的所有文件上执行命令。 用 |:argadd| 可以把文件名加进参数列表。|:argdelete| 可以删除文件名。 "##" 类似于 "#"，它被参数列表所有名字的连接替换。用于 ":grep foo ##" 这样的场 合。 |:argedit| 把文件名加入参数列表，并编辑之。类似于 ":argadd" 然后 ":edit"。 恢复视图 *new-View*
":mkview" 命令写入 Vim 脚本，包含单个窗口的设置和映射。执行建立的文件可以恢复 该窗口的视图。类似于单个窗口的 ":mksession"。 视图也包含局部参数列表和手动建立的打开或关闭的折叠。 加入 ":loadview" 命令和 'viewdir' 选项: 可以用简单的命令保存和恢复文件的视图。 ":mkview 1" 保存当前文件的视图 1，而 ":loadview 1" 又可以载入。另外，可以在同 一文件的两个视图间快速切换。还可以保存和恢复手动折叠以及折叠的状态。 加入 'viewoptions' 以指定 ":mkview" 的工作方式。 现在，":mksession" 也支持垂直分割。它被进一步改进，以恢复每个窗口的视图。它对 预览和 quickfix 窗口同样能正确工作。 'sessionoptions' 也用于 ":mkview"。 'sessionoptions' 加入 "curdir" 和 "sesdir"。它们可以选择如何恢复当前目录。 会话文件现在也包含了参数列表。 色彩方案 *new-color-schemes*
支持载入色彩方案。加入了 ":colorscheme" 命令。 自动为可用的方案加入菜单项。 现在，应该会在 'background' 或 't_Co' 改变时，正确地自动复位色彩。 ":highlight clear" 可以再次设置缺省的颜色。 ":syntax reset" 设置语法高亮颜色为其缺省值。 ":set bg&" 猜测其值。这使得色彩方案可以切换回缺省的颜色。 如果打开了语法高亮时已经定义了色彩方案，该色彩方案被重新载入以 (再次) 定义颜 色。 若干新项目 *new-items-6*
普通模式命令:
"gi" 跳转到 ^ 位置标记并开始插入模式。即使位置标记在行尾之后也可 以。|gi| "g'm" 和 "g`m" 跳转到位置标记，而不修改跳转表。现在，你可以用 g`" 来跳回最近 所知的文件位置，而不会有副作用。对映射也有用。 ['、[`、]' 和 ]` 移动光标到下一个/前一个小写的位置标记。 g_ 转到行内的最后的一个非空白。(Steve Wall)选项:
'autoread' 如果检测到文件在 Vim 之外改变而缓冲区没有改动的话，自动再次读 入缓冲区。它有全局和局部值。用 ":setlocal autoread<" 来回到直 接使用 'autoread' 的全局值的设定。 'debug' 如果设为 "msg"，会显示平时忽略的错误消息。用于调试 'indentexpr' 和 'foldexpr'。 'lispwords' Lisp 缩进用的单词列表。以前是直接在源代码里编码的。缺省加入了 一些 Lisp 名字。 'fold...' 折叠的许多新选项。 'modifiable' 如果关闭，不能修改缓冲区。'statusline' 的 %m 和 %M 项目显示 '-'。 'previewwindow' 在预览窗口里置位。在会话文件里使用，以标记一窗口为预览窗口。 'printfont' 'printexpr' 'printheader' 'printdevice' 'printoptions' 用于 ":hardcopy"。 'buflisted' 使得缓冲区出现或不出现在缓冲区列表里。 模式行里使用 "vim{version}
:" 可以使它只在版本 >={version}
时才执行。还有 "vim>{version}
"、"vim<{version}
" 和 "vim={version}
"。Ex 命令:
:sav[eas][!]{file}
类似于 ":w file" 和 ":e #"，但不会再次载入，也避免了其它的副作 用。|:saveas| :silent[!]{cmd}
安静的执行命令。也不使用消息之后可能的延迟，也不使用 'showmatch'。 RISCOS: 删除了 "!~cmd" 不产生输出也不等待之后的<Enter>
的效 果。现在可以用 ":silent !cmd"。 :menu<silent>
加入不回显 Ex 命令的菜单。 :map<silent>
加入不回显 Ex 命令的映射。 :checktime 检查缓冲区的改变。 :verbose{cmd}
为单个命令设置 'verbose'。 :echomsg{expr}
:echoerr{expr}
类似于 ":echo"，但在历史里保存消息。(Mark Waggoner) :grepadd 类似于 ":grep"，但加到当前的错误列表，而不是定义新的列表。 |:grepadd| :finish 结束文件的执行。可以用来跳过 Vim 脚本的其余部分。|:finish| :leftabove :aboveleft 在当前窗口的左侧/上方分割窗口。 :rightbelow :belowright 在当前窗口的右侧/下方分割窗口。 :first、:bfirst、:ptfirst 等 ":rewind" 的别名。和 ":last" 相较，更加合乎逻辑。 :enew 编辑新的无名缓冲区。这有必要，因为 ":edit" 重新编辑同一文件。 (Wall) :quitall 等同于 ":qall"。 :match 定义局部于窗口的匹配高亮。可以为当前窗口高亮项目，而不会影响语 法高亮。 :menu enable :menu disable 打开/关闭菜单项的命令，而不用删除它们。(Monish Shah) :windo 在所有窗口里执行命令。 :bufdo 在所有缓冲区里执行命令。 :wincmd 窗口 (CTRL-W
) 命令。可用于不能使用普通模式命令的场合 (比如， CursorHold 自动命令里)。|CursorHold-example| 给出一个很好的应 用实例。 :lcd 和 :lchdir 设置窗口的本地目录。(Benjie Chen) :hide{command}
以置位的 'hidden' 执行{command}
。 :emenu 在可视模式里，执行 ":vmenu" 项目。 :popup 弹出弹出式菜单。 :redraw 即使忙于执行脚本或函数时，也刷新屏幕。 :hardcopy 打印到纸张。 :compiler 载入 Vim 脚本，以处理特定编译器的设定。 :z# 列出编号的行。(Bohdan Vlasyuk)新的位置标记:
'( 和 ') 当前句子的开始或结束。用于 Ex 命令。 '{ 和 '} 当前段落的开始或结束。用于 Ex 命令。 '. 当前缓冲区的最近改变位置。 '^ 插入模式停止的位置。 viminfo 文件保存 ^ 和 . 位置标记。可以用来跳转到最近的插入位置或改变文本上。新函数:
argidx() 参数列表的当前索引。 buflisted() 检查缓冲区是否存在并置位了 'buflisted'。 cindent() 得到 'cindent' 的缩进。 eventhandler() 如果在事件处理程序而不能使用交互命令的时候返回 1。 executable() 检查是否程序或批处理脚本可执行。 filewritable() 检查文件是否可写。(Ron Aaron) foldclosed() 检查是否有关闭折叠。(Johannes Zellner)。 foldcloseend() 发现关闭折叠的结尾。 foldlevel() 发现折叠级别。(Johannes Zellner) foreground() 把 GUI 窗口移到前台。 getchar() 让用户输入一个字符。可以用来定义接受一个参数的映射。 getcharmod() 得到最近使用的键修饰符。 getbufvar() 得到缓冲区里选项或局部变量的值 (Ron Aaron) getfsize() 返回文件大小。 getwinvar() 得到窗口里选项或局部变量的值 (Ron Aaron) globpath() 发现目录列表里匹配的文件 hasmapto() 检测是否到字符串的映射已经存在。 iconv() 把字符串从一个编码转换为另一个编码。 indent() 得到行的缩进 (Ron Aaron) inputdialog() 类似于 input()，但在可能的情况下，使用 GUI 对话框。目前支持 Win32、Motif、Athena 和 GTK。 Edit/Settings/Text Width 菜单使用 inputdialog()。 Help/Find.. 和 Toolbar FindHelp 项目也是。 (Win32 支持由 Thore B. Karlsen 提供) (Win16 支持由 Vince Negri 提供) inputsecret() 要求用户输入字符串，但不回显输入的键。(Charles Campbell) libcall() 用于 Unix (Neil Bird，Johannes Zellner，Stephen Wall) libcallnr() 用于 Win32 和 Unix lispindent() 得到 'lisp' 的缩进。 mode() 返回指示当前模式的字符串。 nextnonblank() 跳过正向的空行。 prevnonblank() 跳过反向的空行。可用于缩进脚本。 resolve() MS-Windows: 解析快捷方式为它指向的文件。 Unix: 解析符号链接。 search() 搜索模式。 searchpair() 搜索匹配的组对。可用于缩进文件，以找到匹配 endif 的 "if"。 setbufvar() 设置缓冲区的选项或局部变量。(Ron Aaron) setwinvar() 设置窗口的选项或局部变量。(Ron Aaron) stridx() 搜索一个字符串在另一个字符串里的第一次出现。 strridx() 搜索一个字符串在另一个字符串里的最后一次出现。 tolower() 把字符串转换为全部小写。 toupper() 把字符串转换为全部大写。 type() 检查表达式的类型。 wincol() 光标的窗口列 winwidth() 窗口宽度。(Johannes Zellner) winline() 光标的窗口行 加入了变量和函数命令的花括号扩展。可以用于包含选项值的变量名。也可以用来提供原 始的数组。(Vince Negri)新的自动命令事件:
BufWinEnter 缓冲区在窗口显示时激活。在使用模式行之后。可用于载入视图。 BufWinLeave 缓冲区不再出现于窗口时激活。也在退出 Vim 时激活。可用于保存视 图。 FileChangedRO 在第一次修改只读文件之前激活。可用于文件的刷新。(Scott Graham) TermResponse 在终端应答版本请求时激活。v:termresponse 内部变量保存该值。可 用于对终端版本进行处理。(Ronald Schild) FileReadCmd 在读入文件前激活。 BufReadCmd 在读入文件到缓冲区前激活。 FileWriteCmd 在写回文件前激活。 BufWriteCmd 在写回缓冲区到文件前激活。 FileAppendCmd 在附加到文件前激活。 FuncUndefined 在用户函数没有定义时激活。(Ron Aaron) *Cmd 事件的自动命令进行文件读写，以取代普通的文件读写。netrw.vim 利用这一点来 编辑远程系统上的文件。(Charles Campbell)新的语法文件:
bdf BDF 字体定义 (Nikolai Weibull) catalog SGML 目录 (Johannes Zellner) debchangelog Debian Changelog (Wichert Akkerman) debcontrol Debian 控制 (Wichert Akkerman) dot dot (Markus Mottl) dsl DSSSL 语法 (Johannes Zellner) eterm Eterm 配置 (Nikolai Weibull) indent 缩进概要文件 (profile) (Nikolai Weibull) lftp LFTP (Nikolai Weibull) lynx Lynx 配置 (Doug Kearns) mush mush 源代码 (Bek Oberin) natural Natural (Marko Leipert) pilrc Pal 资源编译器 (Brian Schau) plm PL/M (Philippe Coulonges) povini Povray 配置 (David Necas) ratpoison Ratpoison 配置/命令 (Doug Kearns) readline readline 配置 (Nikolai Weibull) screen Screen RC (Nikolai Weibull) specman Specman (Or Freund) sqlforms SQL*Forms (Austin Ziegler) terminfo terminfo (Nikolai Weibull) tidy Tidy 配置 (Doug Kearns) wget Wget 配置 (Doug Kearns) 更新了许多语法文件，使得在 Vim 5.7 和 6.0 里都能工作。 Ruby 接口。(Shugo Maeda) 支持 MS-Windows 上的 Ruby 接口的动态载入。(Muraoka Taro) Mingw 也支持。(Benoit Cerrina) Win32: 加入动态载入 TCL 的可能性。(Muraoka Taro) 也适用于 Borland 5.5。(Dan Sharp) Win32: 编辑快捷方式的文件 (*.lnk 文件) 时，编辑它指向的文件。除非置位了 'binary'，此时编辑快捷方式文件自身。(Yasuhiro Matsumoto) ":command" 命令现在接受 "-bar" 参数。使得用户命令可以被 "| command" 跟随。 现在，预览窗口也被以下命令使用: - |:pedit| 在预览窗口编辑指定文件 - |:psearch| 类似于 |:ijump|，在头文件里搜索单词，并在预览窗口显示找到的文本。 加入CTRL-W
P 命令: 转到预览窗口。 MS-DOS 和 MS-Windows 也读入系统范围的 vimrc 文件 $VIM/vimrc。多用于多用户的 NT 系统。 鼠标在字符上双击时，如果该字符有 "%" 匹配，选择从该字符到对应匹配的文本。类似 于 "v%"。 "-S session.vim" 参数: 启动时执行脚本。便于 Vim 启动时载入会话文件。 加入 "--cmd{command}
" Vim 参数，在 vimrc 文件载入之前执行命令。(Vince Negri) 加入 "-M" Vim 参数: 复位 'modifiable' 和 'write'，从而禁止对文件修改和写回。 加入 runtime/delmenu.vim。执行之可以删除所有菜单并为载入新菜单做好准备。可用于 修改 'langmenu'。 Perl 脚本，用来过滤 Perl 错误信息并转化为 quickfix 可用的格式。(Joerg Ziefle) 加入 runtime/macros/less.vim: 模拟 less 的 Vim 脚本，但提供语法高亮。 MS-Windows 安装程序: (Jon Merz) - Win32 程序现在可以在桌面上建立快捷方式，并在开始菜单安装 Vim。 - 可以删除旧的 "Edit with Vim" 项目。 - Vim 可执行文件无须移动或者改变 $PATH。在 $PATH 里建立了一个小的批处理文件。 减少了要作出的选择。 - 检测已经安装的 Vim 的版本，并提供先卸载它们的选择。 改进的 MS-Windows 卸载程序。现在，它同时删除开始菜单的项目，桌面的图标和建立的 批处理文件。(Jon Merz) 也可以只删除其中的一部分。同时撤销 gvim 的 OLE 注册。 生成 MS-Windows 上自安装的 Vim 包。用的是 NSIS。(Jon Merz 等人) 加入 ":filetype detect"。尝试再次检测文件类型。有助于 (比如说) 加入 "#!/bin/csh" 以后，编写的新外壳脚本。 加入 ":augroup! name" 命令，删除自动命令组。客户-服务器 "--remote-wait" 需要。 viminfo 文件里加入 Vim 的版本号，有助于调试。
改 进 *improvements-6*
'cpoptions' 加入 'n' 标志位: 如果省略，回绕行的文本不放在 'number' 选项显示的 行号中间。这样阅读回绕行容易多了。 如果标签文件有格式错误，报告其字节位置以定位错误。 "gf" 可用于可视模式: 使用选择文本作为文件名。(Chase Tingley) 允许有二义性的映射。这样可以同时映射 "aa" 和 "aaa"，使用最长的匹配。这对 ":lmap" 和 'keymap' 特别有用。 加密: 第一次加密时要求加密键输入两次。否则一旦输错，文本就永久丢失了。(Chase Tingley) 现在窗口标题在最后加上了 "VIM"。文件名在前面，这样任务栏上能够看清楚。如果文件 修改过，加 "+"，如果文件只读，加 "="。如果文件 'modifiable' 关闭，加 "-"。 可视模式里，在 'showcmd' 的位置提及选择区域的大小。 加入 "b:changedtick" 变量。每次改变都递增，包括撤消。用于在缓冲区有改变时采取 行动。 ":s" 命令的替代字符串中，用 "\=" 可以替代为表达式的运算结果。该表达式内部可用 submatch() 函数访问子匹配。 如果执行 ":qall" 且其它窗口里正在编辑的缓冲区有修改，跳转到那个窗口，而不是编 辑当前窗口的缓冲区。 文件读/写命令加入 "++enc=" 和 "++ff=" 参数，强制使用给定的 'encoding' 或 'fileformat'。同时加入 "v:cmdarg" 变量，用于 FileReadCmd 这些自己读写文件的自 动命令。 读入标准输入时，先用二进制模式读入文本，然后再用基于 'fileformat' 和 'fileencoding' 的自动选择重新读入。这样避免了重新开始文件 (例如，如果在靠近文 件末的行以 LF 而不是 CR-LF 结束的话)。 如果从标准输入读取文本而缓冲区为空，不标记它为已改变。退出时省得麻烦。 给许多错误信息加入 ID，方便寻找消息的帮助。 插入模式: - 用 "CTRL-G
j" 和 "CTRL-G
k" 可以在另一行的相同列插入。可用于编辑表格。 - 加入同义词补全，CTRL-X
CTRL-T
。(Vince Negri) - 加入 'thesaurus' 选项，在同义词补全里代替 'dictionary'。'complete' 加入 's' 标志位。 - 插入模式的CTRL-X
CTRL-L
使用 'complete' 选项。也在其它载入的缓冲区里扫描匹 配行。 - 插入模式用CTRL-X
或CTRL-N
补全时也可用CTRL-R
。(Neil Bird) - 插入模式补全时，如果补全结束，检查来自 'cinkeys' 或 'indentkeys' 的单词匹 配。 性能: - 使得显示更新更有效率。所有改变都可能会使用插入/删除行，包括撤消/重做。 - 如果插入模式下有预输入，不刷新显示。大大加快了CTRL-R
。 - 为 32 位 DOS 版本改进了屏幕的输出速度。(Vince Negri) - 鼠标拖动时，往前看鼠标代码，如果下面还有一个，跳过之前的鼠标键。这使得鼠标拖 动快很多。 - 另一个内存用量的改进: 如果调用 u_save 时只有一行且该行最近已经为相同的撤消保 存过，不再保存。 - 使用一次附加一个字符的脚本时，过去分配的内存慢慢增加。'undolevels' 为 -1 也 是如此。因为 "U" 保存的行从来不释放。现在撤销块为空时就释放内存。 - GUI 和 Dos32: 使用垂直滚动区域，使得垂直分割的窗口滚动更快。不需要重画整个窗 口。 - 如果终端代码不支持滚动 (例如，用于垂直分割的窗口)，从 ScreenLines[] 重画。应 该比通过 win_line() 的行更快，使用语法高亮时尤其如此。 - 用单独的脚本预先生成 Syntax 菜单。使得菜单的载入加快了 70%，也使 gvim 的启动 时间减半。 - 执行 ":help tag" 时，不先打开 help.txt，直接跳转到要帮助的标签上。更快也避免 额外的信息。 - Win32: 如果文件名不以 ".lnk" 结尾，不试图解析快捷方式。那需要不少时间。 - 如果有预输入的字符，不更新鼠标指针形状。 - META[] 从字符串改为数组，避免使用 strchr()。 - 加入字符时不清除命令行，避免调用 screen_fill 而不做任何事。 健壮性: - Unix: 执行正规表达式时检查堆栈是否溢出。避免很麻烦的溢出。只用于支持能在另一 个堆栈上运行 signal 函数的系统。 - 不允许 ":source<dirname>
"。Unix 上可以读取目录，但用它作为 Vim 命令没有任何 意义。 安全: - 从临时文件读或写时，检查它不是符号链接。提供一些针对符号链接攻击的保护。 - 建立备份文件或交换文件时，检查是否已经存在以避免符号链接攻击。(Colin Phipps) - 在沙盘 |sandbox| 里计算表达式选项。如果用模式行设置选项，它不能造成破坏。 - 使用安全的方式生成临时文件名: 建立一个私人目录用于临时文件。可用于 Unix、 MS-DOS 和 OS/2。 - 'makeef' 可为空，意味着使用内部生成的文件名。旧的缺省值是 "/tmp/file"，造成 了安全风险。 在当前目录写入 'makeef' 会在只读目录失败，因而导致在所有文件上 ":grep" 会有 问题。所有系统上的缺省都为空，以便使用临时文件。 - 标签文件的命令在沙盘里执行，以提供更好的安全性。 - 不能在沙盘里使用 Ruby、Tcl 和 Python 接口。它们可能执行危险的任务。Perl 可 以，但只限于安全环境。(Donnie Smith) 语法高亮: - 通过缓存整个文件的状态栈而不只是显示的部分优化速度。折叠需要如此。 - 加入 ":syntax sync fromstart": 总是从文件开始处进行分析。 - 为语法项目加入 "display" 参数: 只在显示结果时使用该项目。使得不用显示的文本 的分析加快。 - 用CTRL-L
时，删除缓存的状态以强制再次分析文本。 - 关键字表的存储使用 elfhash 算法。应该会产生更好的分布并加快关键字的查找。 (Campbell) - "lc" 引导上下文也可用于跳过和结束模式。(Scott Bigham) - 语法项目可用 "extend" 参数来撤销它所在的项目的 "keepend" 参数的效果。它可以 用来使一些包含的项目扩展一个区域，而另一些不能。 - ":syntax clear" 现在删除 b:current_syntax 变量。这合乎逻辑，因为此命令之后就 没有定义任何语法了。 - 加入 ":syntax enable": 打开语法高亮而不改变颜色。可以在 .vimrc 文件里指定颜 色，而不需要 mysyntaxfile。 - 加入 ":syntax reset": 复位色彩为其缺省值。 - 加入 "contains=TOP" 和 "contains=CONTAINED" 参数，可以定义不包含自身的透明项 目。 - 给语法项目加入 "containedin" 参数。允许加入 contained 项目到已有的项目里 (例 如，要高亮注释里的一个名字)。 无模式选择: - 在命令行窗口里，为其它窗口使用无模式选择。这样可以复制可视文本到命令行窗口。 - 支持终端的命令行的无模式选择，以前只能用于 GUI。 - 无模式选择里双击右键选择整个单词。单击右键不使用双击左键开始的单词选择。使之 和可视模式。 - 无模式选择不再隐含自动复制到剪贴板。现在它取决于 'guioptions' 的 'a' 和 'A' 标志位或者 'clipboard' 的 "autoselect" 和 "autoselectml"。 - 命令行模式加入CTRL-Y
命令，复制无模式选择内容到剪贴板。也可用于 hit-enter 提示和 more 提示。 删除 runtime/mswin.vim 中命令行模式里CTRL-Y
和CTRL-Z
的映射，以便使用新的CTRL-Y
方式。 减少了 regmatch() 使用的堆栈空间的用量，可以在更长的文本上处理复杂的模式。 'isfname' 现在包含 '%' 和 '#'。使得 "vim dir\#file" 可用于 MS-DOS。 加入数字键盘的特殊键<kEnter>
、<k0>
-<k9>
，如果没有映射，和 ASCII 等价字符完 全相同。(Ivan Wellesz 和 Vince Negri) 识别更多的一些 xterm 键:<C-Right>
、<C-Left>
、<C-End>
、<C-Home>
Vim 将要退出时同时激活 BufUnload 事件。可能脚本需要进行一些处理。 扩展反引号里的表达式: `={expr}
`。任何进行反引号扩展的地方都可用。(Vince Negri) GUI: - 'guioptions' 加入 'L' 和 'R' 标志位: 只有在垂直分割窗口存在时才加入左或右滚 动条。 - X11: 如果一个颜色不能分配，使用最接近的 colormap 的匹配。否则太多东西会使用 黑色。(Monish Shah) 也用于菜单和滚动条，否则它们都变成黑色了。 - Win32 和 X11: 加入 'mouseshape' 选项: 根据当前模式调整鼠标指针形状。 (Vince Negri) - 加入 'linespace' 选项: 行间插入像素行。(Nam) - 允许按住 CTRL 和 SHIFT 来进入无模式选择 (不用移动光标)。(Ivan Wellesz) - Motif: 加入工具栏。(Gordon Prieur) 也加入工具提示。 - Athena: 加入工具栏和工具提示。(David Harrison -- 基于 Gordon Prieur 的工 作) - 'toolbar' 选项可用于 Athena 和 Motif。现在可以在线切换文本和图标。 (David Harrison) - 支持 Athena 的菜单分隔行。(David Harrison) - Athena: 调整下拉菜单里的箭头位图，使之和字体的大小相同。(David Harrison) - Win32: 'guifont' 加入 "c" 标志位以指定字符集。(Artem Khodush) - 如果没有给出 --enable-xim 参数，使用 X GUI 时自动打开它。需要它来提供死键支 持 (和多字节支持)。 - 文件选择对话框之后，检查编辑文件没有被改变或删除。Win32 对话框允许删除和换名 文件。 - Motif 和 Athena: 加入 "editres" 的支持。(Marcin Dalecki) - Motif 和 Athena: 加入 "menuFont"，指定菜单的字体或字体集。也可以用 "Menu" 高 亮组设置。用于 locale 和 'encoding' 不同的场合。(David Harrison) 如果定义了 FONTSET_ALWAYS，菜单总是使用字体集。避免从字体切换到字体集时出现 的问题。(David Harrison) - 工具提示的高亮和字体可以用 "Tooltip" 高亮组指定。(David Harrison) - more 提示里可用命令行模式菜单。这基本上都能工作，因为它们以CTRL-C
启动。 "Copy" 菜单可用于复制无模式的选择。允许不用自动选择而复制 ":set all" 或 ":intro" 的输出。 - 启动 GUI 时如果标准输出和标准错误没有连接到终端，在对话框里显示错误信息。过 去彻底不显示。 - 允许设置 'browsedir' 为目录名，用于文件对话框。(Dan Sharp) - 可以设置 b:browsefilter 和 g:browsefilter 为文件对话框使用的过滤。Win32 和 Motif GUI 支持。(Dan Sharp) X11: - 支持剪贴板的选择区作为寄存器 "+。退出或者暂停时，复制选择区到剪切缓冲区 0。 这样可以用 X11 的标准方式复制/粘贴到许多应用程序。(Neil Bird) - 在任何终端上使用 X 剪贴板，不只是 xterm。 'clipboard' 加入 "exclude:": 指定模式，匹配的终端名不建立到 X 服务器的连接。 缺省值目前可用于 FreeBSD 和 Linux 控制台。 - 如果 'verbose' 非零，加入一些消息显示连接到 X 服务器时发生了什么。如果要研究 为什么启动很慢，应该有帮助。 GTK GUI: (部分由 Marcin Dalecki 提供) - 一些字体的字符可能比 ascent + descent 还要高，例如 "-misc-fixed-*-*-*-*-18-*-*-*-*-*-iso10646-1"。给字符单元高度加一。 - 实现 'winaltkeys' 的 "no" 值: 如果建立菜单后改变了 'wak'，不使用 Alt 键作为 菜单快捷键。 - GUI 启动后可以设置 'wak'。 - 回收文本 GC 以减少通信。 - 调整窗口管理器的图标大小。 - 字体处理进行了清理。 - XQueryColor 被 GDK 调用替换。 - Gnome 支持。configure 里会检测 Gnome 并为此使用不同的窗口组件 (widget)。否则 和 GTK 基本类似。(Andy Kahn) 缺省关闭，因为会造成一些问题。 - 删除先分叉 (fork) 然后启动 GUI 用的特殊代码。现在用 _exit() 代替 exit()，这 不需要任何特殊技巧。 - 对话框有时出现的位置远了些。现在把对话框定位在 gvim 窗口内部。 (Brent Verner) - 放置文件到 Vim 时，删除路径开始处额外的斜杠。如果可能，也缩短文件名。 Motif: (Marcin Dalecki) - 使对话框的布局更好一点。 - 加入搜索和搜索/替代对话框。 - 菜单里把 "iso-8859" 换成 "iso_8859"。Linux 看来需要如此。 - 对话框里加入图标，就像 GTK 那样。 - 如有可能，图标使用 XPM 位图。如果存在，使用 Solaris 的 XpmP.h 头文件。 - 改变工具栏项目的阴影，使得按下时它的可视反馈不那么 Lesstif。 - 为了提高速度，一些项目使用 gadget 而不是 window。 命令行补全: - 补全环境变量名。(Mike Steed) - ":command" 加入一些补全方法: "mapping"、"function"、"expression" 和 "environment"。 - 如果函数不接受参数，补全加上 () 而不是 (。 MS-DOS、MS-Windows 和 OS/2 上: 扩展 %VAR% 环境变量，就像 $VAR 一样。 (Walter Briscoe) 重定向消息到剪贴板 ":redir @*" 和到无名寄存器 ":redir @""。(Wall) ":let @/ = ''" 清除搜索模式，而不是把它设为空字符串。 表达式计算: - 可用 "? :"，就像 C 那样。 - col("$") 返回光标行的长度加一。(Stephen P. Wall) - match()、matchend() 和 matchstr() 可选的附加参数: 开始寻找匹配的位移。 - 使 strpart() 第三个参数可选。(Paul Moore，Zdenek Sekera) - exists() 也可用于检查 Ex 命令和自动命令的定义与否。 - input() 加入额外参数: 缺省文本。 - ":silinet! cmd" 同时设置 "v:errmsg"。 - 加入 v:prevcount 变量: 前一个命令的 v:count。 - 加入 "v:progname"，Vim 启动时所用的名字。(Vince Negri) - 关于函数返回的 verbose 消息也显示返回值。 Cscope: - 加入 cscope_connection() 函数。(Andy Kahn) - 加入 'cscopepathcomp' 选项。(Scott Hauck) - 加入 ":scscope" 命令，分割窗口并执行 Cscope 命令。(Jason Duell) VMS: - 命令行参数总是大写的。"-X" 参数被理解为 "-x" 而 "-/X" 则成为 "-X"。 - 使得 'makeprg' 和 'grepprg' 的缺省值有意义。(Zoltan Arpadffy) - 使用 X 剪贴板特性和 X 命令服务器。(Zoltan Arpadffy) Macintosh: (Dany St-Amant) - 允许标签文件使用 CR、CR-LF 或 LF 作为换行符。(Axel Kielhorn) - 代码改用 Carbon 环境 (同时保留非 Carbon 的代码) (一些工作是从 Ammon Skidmore 那里 "偷来的") - 改进了菜单项目索引的处理 (应该更快了) - 运行时命令现在能处理文件名里的 / (MacOS 9 版本) - 加入 ":winpos" 支持。 - 支持在文件里用 "~" 代表主目录。 选项: - 用 set += 或 ^= 时，检查使用两次的项目。删除重复项目。(Vince Negri) - 设置标志位列表的选项时，删除重复的标志位。 - 如果可能，使用 getrlimit() 来设置 'maxmemtot' 和 'maxmem'。(Pina) - 'nrformats' 加入 "alpha": 用CTRL-A
和CTRL-X
可以递增或递减字母表字符。 - ":set opt&vi" 设置选项为 Vi 缺省值。":set opt&vim" 则设为 Vim 缺省值。可用于 只想设置 'cpo' 为 Vim 缺省值而不想知道其中包含什么标志位的场合。 - 'scrolloff' 现在也适用于长的窗口放不下的回绕行。 - 缺省菜单加入更多选项设置。 - 更新选项窗口以包含新的选项。使它更易阅读。 内部改变: - 把行指针分成文本部分和属性部分。这样将来可以方便修改，属性可以多于一个字节。 - 如果系统没有的话，提供 qsort() 函数。 - 把一个用于普通模式的大的 switch 换成一个表。这使代码清晰很多，也避免了一些编 译器的优化出现的麻烦。 - 赋给特殊键一个负值，避免它们和 Unicode 字符混淆起来。 - 全局变量 expand_context 和 expand_pattern 本来不打算是全局的。把它们传给 ExpandOne() 和所有它调用的函数。 - 不再使用全局的 reg_ic 标志位。它造成了麻烦，而且一些地方它也没有设置。 - 删除用于 "*"、"K"、CTRL-]
等的 stuff 缓冲区的使用。避免自动命令的问题。 - 一些代码从 ex_docmd.c 移到了 ex_cmds2.c。该文件太大了。一些代码也从 screen.c 移到了 move.c。 - 不直接包含加密用的 CRC 表而是生成它。这样减少了不少源代码的空间。 (Matthias Kramm) - multibyte.c 换名为 mbyte.c，避免 8.3 文件系统的问题。 - 删除 ":findhelp" 的 GTK 实现，现在使用 ToolBar.FindHelp 菜单项。 - 换名 mch_windexit() 为 mch_exit()，mch_init() 为 mch_early_init()，还有 mch_shellinit() 为 mch_init()。 高亮: - ":highlight" 列表中，用高亮自己的颜色显示 "xxx"。 - 加入 xterm 88 色或 256 色的支持。正确的高亮数目被用作 ":highlight" 命令的名 字。 (Steve Wall) - ":highlight" 加入 "default" 参数。如果包含且该高亮组已经定义，忽略此命令。 所有的语法文件现在使用 ":hi default ..."，这样用户可以在自己的 vimrc 文件里 指定颜色。另外，不再需要 "if did_xxx_syntax_inits"。这大大简化了为特定语言使 用非缺省颜色的工作。 - 调整了 colortest.vim: 包含正常背景的颜色，还有用 while 循环减少了代码。 (Rafael Garcia-Suarez) - 加入 "DarkYellow" 颜色名，使标准颜色的清单更一致。虽然它本身并不那么好看。 如果 xterm 处于 8 位模式，用 |t_RV| 返回的编码来检测这种情况。所有的键码都被自 动转换为它们的 8 位版本。 用 xterm patch level 141 和之后版本的 OPT_TCAP_QUERY 获得实际使用的键码和 t_Co 中颜色的编码。只有同时使用 |t_RV| 时才会如此。 ":browse set" 现在也可用于控制台模式。":browse edit" 则会给出错误信息。 ":bdelete" 和 ":bunload" 只报告多于 'report' 的删除/卸载缓冲区数目。如果在脚本 里删除缓冲区，这个消息的出现会相当讨厌。 跳转表: - 跳转表保存的位置标记的数目从 50 个增加到 100 个。 - viminfo 文件现在保存跳转表。CTRL-O
可以用来跳转到前一个编辑会话的位置。 - 执行 ":split" 时把跳转表复制到新窗口里。 "~" 和 "r" 命令同时设置 '[ 和 '] 位置标记。现在用普通模式命令进行改变时，总是 设置这些位置标记。 Python 接口: 允许设置垂直分割窗口的宽度。(John Cook) 'cinkeys' 加入 "=word" 和 "=~word" (也用于 'indentkeys')。 'cinoptions' 加入 "j1" 参数: 缩进 Java () 里的{}
。(Johannes Zellner) 'cinoptions' 加入 "l" 标志位。(Anduin Withers) 'cinoptions' 加入 'C'、'U'、'w' 和 'm' 标志位。(Servatius Brandt) 执行 ":wall" 或 ":wqall" 而修改过的缓冲区没有名字时，在错误信息里提到缓冲区的 编号。 ":function Name" 列出函数和行号。容易发现错误在何处。 非面向列块的可视模式里，"r" 替换所有选择的字符为输入的单个字符，和面向列块的可 视模式相同。 用任何方式编辑参数列表中的最后一个文件就允许退出。以前用 ":next" 或 ":last" 访 问该文件才可以。 'formatoptions' 加入 '1' 标志位。(Vit Stradal) 'formatoptions' 加入 'n' 标志位: 排版编号列表。 交换文件: - 如果交换文件已经存在并且用户在 ATTENTION 提示时选择了 "Delete"，使用相同的 ".swp" 交换文件以避免建立 ".swo" 文件，后者不一定总能找到。 - 如果给出 ATTENTION 消息并且文件的日期比交换文件的日期更新，给出警告。 - 简化关于已有的交换文件的消息，使之能在 24 行的屏幕上显示。 - 原来可以建立和交换文件同名且到不存在的文件的符号链接。Vim 这时会安静的使用另 一个文件 (如果用 O_EXCL 打开文件时拒绝符号链接的话) 现在检查符号链接是否指向 存在的文件。也在建立之前检查交换文件是否已经存在以发现符号链接攻击。 gCTRL-G
命令也可用于可视模式并计算单词的个数。 (Chase Tingley) 如果使用 'shell' 但为空，报错。 加入 'shellpipe' 包含 "%s" 的可能性。 'display' 加入 "uhex" 值: 用<xx>
形式显示不可显示字符。不可显示字符使用 NonText 高亮，命令行上也是如此。 要求显示隐藏选项的值时，说明不支持这么做。 Win32: - 把快捷方式放置在 gvim (.lnk file) 之上会编辑目标文件，而不是快捷方式本身。 (Yasuhiro Matsumoto) - 加入 C 版本的 OpenWithVim 和 SendToVim 程序。(Walter Briscoe) - 如果 'shell' 是 "cmd" 或 "cmd.exe"，设置 'shellredir' 使之同时重定向标准错误 (stderr)。也检查 Unix 的外壳名。 - 如果定义 $HOMEDRIVE 和 $HOMEPATH，用它们来定义 $HOME。(Craig Barkhouse) Win32 控制台版本: - ":version" 消息，如有可能，包含用户名和系统名。为此，生成 pathdef.c 文件。 (Jon Miner) - 设置窗口图标为 Vim 的图标 (只用于 Windows 2000)。执行外壳命令时，修改窗口标 题以显示这一点。退出时也恢复光标位置。(Craig Barkhouse) - Win32 控制台版本可以在编译时加入 OLE 支持，但只会作为客户端而非 OLE 服务器。 错误格式: - 'errorformat' 的 "%p" (一列字符指示的错误列) 也能接受一行句号。 - 'errorformat' 加入 "%v" 项目: 虚拟列号。(Dan Sharp) - 'errorformat' 加入 VMS 的缺省值。(Jim Bush) "p" 命令现在可用于可视模式。它用寄存器的内容覆盖选择文本。 介绍消息里高亮<>
项目，明确它们是特殊的。 使用 ":substitute" 的 "c" 标志位时，允许输入 "l" 来替换项目并停止: l 代表 "last (最后)"。 执行其它文件时显示 verbose 消息时，显示行号。 改变 Vim 窗口大小时，不使用 'equalalways'。避免 Vim 窗口变小时分割窗口变大。文 档是这么说的。 插入模式输入CTRL-D
时，如果刚在自动缩进之后，输入 CR 过去保持余下的空白。现在 和 BS 类似: 删除自动缩进，避免产生空白 (但非空) 的行。 OLE 接口加入 GetHwnd() 调用。(Vince Negri) 使得 ":normal" 可用于事件处理程序。用于把文件放置到 Vim 中和 CursorHold 自动命 令。 MS-Windows 版本上，如果使用斜杠而不是反斜杠，不改变到文件的目录。探索器总是用 反斜杠，而用户可以在输入命令时使用斜杠。 修改时间 (时间戳): - 如果缓冲区在 Vim 的外部被改变并重新获得焦点，给出对话框，用于用户重新载入文 件。现在也适用于 MS-Windows 之外的其它 GUI，还有编译时加入对话框支持的控制 台。 - 检查文件内容以发现它是否真的改变了，忽略只有时间戳本身被修改的情况 (例如，从 CVS check out 文件)。 - 检查时间戳时，先检查文件大小是否改变，如果是就不用进行文件比较了。不断附加的 大 (日志) 文件会快很多。 - 如果设置 'buftype'，不给出改变或删除文件的警告。 - 不再警告目录的改变，否则文件探索器会产生警告。 - 只对不隐藏的缓冲区检查时间戳。否则，等它们不隐藏时才检查。 - 检查文件是否在 Vim 之外改变时，同时检查文件权限是否改变。如果文件内容不改变 但权限改变了，给出警告。 - 避免过于频繁的检查，不然对于不断增长的文件，对话框会不断弹出来。 如果 'encoding' 为 "latin1" 映射<M-A>
然后把 'encoding' 改为 "utf-8" 会使得多 字节的第一个字节被映射。这个问题很难发现。现在禁止映射多字节字符的一部分。 ":python" 和 ":tcl" 接受内含脚本。(Johannes Zellner) 也适用于 ":ruby" 和 ":perl"。(Benoit Cerrina) 如果文件名不是完整路径，":syn include" 使用 'runtimepath'。 如果 'switchbuf' 包含 "split" 而当前窗口为空，不分割窗口。 Unix: 捕获 SIGPWR，电源将要关闭时保存文件。 Sniff 接口: (Anton Leherbauer) - 修正窗口代码，尤其是事件处理部分 - 更新到 sniff 4.x ($SNIFF_DIR4) - 支持运行时加入 sniff 请求 支持<A-x>
记法，作为<M-x>
的别名。这合乎逻辑，因为使用了 Alt 键。 ":find" 接受计数，意味着使用 'path' 的第 count 个匹配。 ":ls" 和 ":buffers" 输出显示 modified/readonly/modifiable 标志位。如果缓冲区激 活，显示 "a" 而不是什么都不显示。如果缓冲区未载入，什么都不显示而不是 "-"。 Unix 安装: - 安装 tools 时，使用 tools 脚本 efm_perl.pl 和 mve.awk 的绝对路径。这样用户就 不用编辑这些文件。 - KDE 在目录存在但图标还不存在时安装图标。 加入 has("win95")，在 Vim 脚本里用于区别 MS-Windows 95/98/ME 和 NT/2000/XP。 输入 ":cd" 命令时，回显新的当前目录。(Dan Sharp) 如果在 GUI 窗口打开前使用 ":winpos"，先记住其值，打开后才使用。 ":version" 的输出里，加入 "/dyn" 代表特性能动态载入。这也同时意味着该特性不一 定总能用。 Windows NT 上目录可以只读但允许删除文件。用换名文件建立备份而 'backupdir' 不用 当前目录时，原先的文件被被删除，但新文件却不能建立。现在给出额外的错误信息，警 告用户这一情况。 命令行上的CTRL-R
CTRL-O
和CTRL-R
CTRL-R
类似，和插入模式的行为一致。
编 译 时 的 改 变 *compile-changes-6*
所有生成的文件现在从 "src" 目录移出。这使得观察哪些文件是或不是手动编辑更为容 易。configure 生成的文件现在放在 "src/auto" 目录。Unix 上，经过编译的目标文件 放在 objects 目录里。 源代码的归档已经超过了 1.4M 软盘的大小。现在把归档分割为两个运行时归档和两个源 代码归档。另外提供 bzip2 压缩归档，它包含所有的源程序和运行时文件。 make 增加了 "reconfig" 目标。在修改某些需要刷新缓存的参数时有用。比如从 GTK 到 Motif 的切换。调整 GUI_INC_LOC 和 GUI_LIB_LOC 的含义，使得不同 GUI 之间能够 一致。 加入 src/README.txt，提供源代码主要部分的总览。 Unix 的 Makefile 现在完全支持使用 $(DESTDIR) 来安装到特定的位置。替换手动的 *ENDLOC 变量设置。 configure 加入 --with-compiledby 参数，提供二进制版本的维护者加入 e-mail 地址 的可能性。 包含的特性现在使用如下的特性包 "tiny"、"small"、"normal"、"big" 和 "huge"。这 替代了以前的 "min-features" 和 "max-features"。要得到一个真的很小的 Vim，可以 使用 "tiny"，它关闭了多重窗口。 使用 tiny 版本或者如果没有定义 FEAT_WINDOWS: Firstwin 和 lastwin 等于 curwin， 而且不使用 w_next 和 w_prev。 加入 +listcmds 特性。可以用来使得编译时没有操作缓冲区列表和参数列表的 Vim 命令 (缓冲区列表自己还是在的，不能没有它)。 加入 +vreplace 特性。在 "small" 版本里，它被关闭，以免 16 位的 DOS 版本内存占 用过多。 删除了 1.6.16 版本之前的 GTK+ 支持。 configure 对是否可以使用 PTY 的检查有了改进。代码来自 screen 的新近版本。 configure 加入安装 Vim、Ex 和 View 为其它名字的选项 (比如，vim6、ex6 和 view6)。 configure 加入 "--with-global-runtime" 参数。可以指定 'runtimepath' 使用的缺省 全局目录。 可以用 configure 参数打开 SNiFF+ 接口。 configure 现在总是在 /usr/local/lib 里检查库，还有在 /usr/local/include 里检查 头文件。这有助于找到 iconv() 和 gettext()。 把命令行历史的代码移到 +cmdline_hist 特性里，以从 tiny 版本里去掉命令行历史。 MS-Windows: Win16 和 Win32 公用的函数移到了 os_mswin.c。避免为同一问题修改两个 文件。(Vince Negri) 把 gui_w16.c 和 gui_w32.c 的公共代码移到 gui_w48.c (Vince Negri) 现在，跳转表是一个单独的特性。"small" 版本关闭此特性 (16 位 MS-DOS)。 所有 _t 结尾的类型换名为 _T 结尾。避免潜在的和系统类型冲突的问题。 configure 加入隐含定义返回类型为 int 的 X11 头文件的检查。(Steve Wall) 顶层目录的 "make doslang" 建立 Windows 的菜单和 .mo 文件的归档。它使用 Unix 上 产生的文件，这些文件应该在 MS-Windows 上也能用。 os_vms.c 和 os_unix.c 有很大一部分进行了合并。过去，重复的代码使得维护需要更多 工作。(Zoltan Arpadffy) Borland C 版本 5 Makefile 的改进: (Dan Sharp) - 修正 Perl 支持 - 加入 python 和 tcl 支持 - 加入动态的 perl 和动态的 python 支持 - 加入 uninstal.exe 支持 - 选项使用 "yes" 和 "no"，类似于 Make_mvc.mak。 Win32: 合并 Make_gvc.mak 和 Make_ovc.mak 为一个文件: Make_ivc.mak。它更小，许 多不必要的文本被删除了。(Walter Briscoe) 增加 Make_dvc.mak，允许调试 MS-Devstudio 的 Make_mvc.mak 生成的 exe。 (Walter Briscoe) MS-Windows: big 版本的 gvim.exe，包括 OLE，现在也包含了动态载入的 Tcl、Perl 和 Python。它使用 ActivePerl 5.6.1、ActivePython 2.1.1 和 ActiveTCL 8.3.3 configure.in 里加入 AC_EXEEXT，在 Cygwin 或 MingW 下检查可执行文件是否需要 ".exe"，以便在 Makefile 里把 SUFFIX 换名为 EXEEXT。 Win32: 延迟载入 comdlg32.dll 以加快启动。只用于 VC 6。(Vipin Aravind) Win32: 如果用 Borland 编译，允许使用 IME。(Yasuhiro Matsumoto) Win32: 加入 Borland 5 编译 gvimext.dll 的 Makefile。(Yasuhiro Matsumoto)
漏 洞 修 正 *bug-fixes-6*
When checking the command name for "gvim", "ex", etc. ignore case. Required for systems where case is ignored in command names. Search pattern "[a-c-e]" also matched a 'd' and didn't match a '-'. When double-clicking in another window, wasn't recognized as double click, because topline is different. Added set_mouse_topline(). The BROKEN_LOCALE check was broken. (Marcin Dalecki) When "t_Co" is set, the default colors remain the same, thus wrong. Reset the colors after changing "t_Co". (Steve Wall) When exiting with ":wqall" the messages about writing files could overwrite each other and be lost forever. When starting Vim with an extremely long file name (around 1024 characters) it would crash. Added a few checks to avoid buffer overflows.CTRL-E
could get stuck in a file with very long lines. ":au syntax<Tab>
" expanded event names while it should expand groups starting with "syntax". When expanding a file name caused an error (e.g., for<amatch>
) it was produced even when inside an "if 0". 'cindent' formatted C comments differently from what the 'comments' option specified. (Steve Wall) Default for 'grepprg' didn't include the file name when only grepping in one file. Now /dev/null has been added for Unix. Opening the option window twice caused trouble. Now the cursor goes to the existing option window. ":sview" and ":view" didn't set 'readonly' for an existing buffer. Now do set 'readonly', unless the buffer is also edited in another window. GTK GUI: When 'guioptions' excluded 'g', the more prompt caused the toolbar and menubar to disappear and resize the window (which clears the text). Now always grey-out the toplevel menus to avoid that the menubar changes size or disappears. When re-using the current buffer for a new buffer, buffer-local variables were not deleted. GUI: when 'scrolloff' is 0 dragging the mouse above the window didn't cause a down scroll. Now pass on a mouse event with mouse_row set to -1. Win32: Console version didn't work on telnet, because of switching between two console screens. Now use one console screen and save/restore the contents when needed. (Craig Barkhouse) When reading a file the magic number for encryption was included in the file length. (Antonio Colombo) The quickfix window contained leading whitespace and NULs for multi-line messages. (David Harrison) When using cscope, redundant tags were removed. This caused a numbering problem, because they were all listed. Don't remove redundant cscope tags. (David Bustos). Cscope: Test for which matches are in the current buffer sometimes failed, causing a jump to another match than selected. (David Bustos) Win32: Buffer overflow when adding a charset name in a font. 'titlestring' and 'iconstring' were evaluating an expression in the current context, which could be a user function, which is a problem for local variables vs global variables. Win32 GUI: Mapping<M-F>
didn't work. Now handle SHIFT and CTRL in _OnSysChar(). Win32 GUI: (on no file), :vs<CR>
:q<CR>
left a trail of pixels down the middle. Could also happen for the ruler. screen_puts() didn't clear the right char in ScreenLines[] for the bold trick. Win32: ":%!sort|uniq" didn't work, because the input file name touches the "|". Insert a space before the "|". OS/2: Expanding wildcards included non-existing files. Caused ":runtime" to fail, which caused syntax highlighting to fail. Pasting a register containingCTRL-R
on the command line could cause an endless loop that can't be interrupted. Now it can be stopped withCTRL-C
. When 'verbose' is set, a message for file read/write could overwrite the previous message. When 'verbose' is set, the header from ":select" was put after the last message. Now start a new line. The hit-enter prompt reacted to the response of the t_RV string, causing messages at startup to disappear. When t_Co was set to 1, colors were still used. Now only use color when t_Co > 1. Listing functions with ":function" didn't quit when 'q' or ':' was typed at the more prompt. Use mkstemp() instead of mktemp() when it's available, avoids a warning for linking on FreeBSD. When doing Insert mode completion it's possible that b_sfname is NULL. Don't give it to printf() for the "Scanning" message. ":set runtimepath-=$VIMRUNTIME" didn't work, because expansion of wildcards was done after trying to remove the string. Now for ":set opt+=val" and ":set opt-=val" the expansion of wildcards is done before adding or removing "val". UsingCTRL-V
with the "r" command with a blockwise Visual selection inserted aCTRL-V
instead of getting a special character. Unix: Changed the order of libraries: Put -lXdmcp after -lX11 and -lSM -lICE after -lXdmcp. Should fix link problem on HP-UX 10.20. Don't remove the last "-lm" from the link line. Vim may link but fail later when the GUI starts. When the shell returns with an error when trying to expand wildcards, do include the pattern when the "EW_NOTFOUND" flag was set. When expanding wildcards with the shell fails, give a clear error message instead of just "1 returned". Selecting a Visual block, with the start partly on a Tab, deleting it leaves the cursor too far to the left. Causes "s" to work in the wrong position. Pound sign in normal.c caused trouble on some compilers. Use 0xA3 instead. Warning for changing a read-only file wasn't given when 'insertmode' was set. Win32: When 'shellxquote' is set to a double quote (e.g., using csh), ":!start notepad file" doesn't work. Remove the double quotes added by 'shellxquote' when using ":!start". (Pavol Juhas) The "<f-args>
" argument of ":command" didn't accept Tabs for white space. Also, don't add an empty argument when there are trailing blanks. ":e test\\je" edited "test\je", but ":next test\\je" edited "testje". Backslashes were removed one time too many for ":next". VMS: "gf" didn't work properly. Use vms_fixfilename() to translate the file name. (Zoltan Arpadffy) After ":hi Normal ctermbg=black ctermfg=white" and suspending Vim not all characters are redrawn with the right background. When doing "make test" without +eval or +windows feature, many tests failed. Now have test1 generate a script to copy the correct output, so that a test that doesn't work is skipped. On FreeBSD the Perl interface added "-lc" to the link command and Python added "-pthread". These two don't work together, because the libc_r library should be used. Removed "-lc" from Perl, it should not be needed. Also: Add "-pthread" to $LIBS, so that the checks for functions is done with libc_r. Sigaltstack() appears to be missing from libc_r. The Syntax sub-menus were getting too long, reorganized them and added another level for some languages. Visual block "r"eplace didn't work well when a Tab is partly included. (Matthias Kramm) When yanking a Visual block, where some lines end halfway the block, putting the text somewhere else doesn't insert a block. Padd with spaces for missing characters. Added "y_width" to struct yankreg. (Matthias Kramm) If a substitute string has a multibyte character after a backslash only the first byte of it was skipped. (Muraoka Taro) Win32: Numeric keypad keys were missing from the builtin termcap entry. When a file was read-only ":wa!" didn't force it to be written. (Vince Negri) Amiga: A file name starting with a colon was considered absolute but it isn't. Amiga: ":pwd" added a slash when in the root of a drive. Don't let 'ttymouse' default to "dec" when compiled with dec mouse support. It breaks the gpm mouse (Linux console). The prototypes for the Perl interface didn't work for threaded Perl. Added a sed command to remove the prototypes from proto/if_perl.pro and added them manually to if_perl.xs. When ":w!" resets the 'readonly' option the title and status lines were not updated. ":args" showed the current file when the argument list was empty. Made this work like Vi: display nothing. "99:<C-U>
echo v:count" echoed "99" in Normal mode, but 0 in Visual mode. Don't set v:count when executing a stuffed command. Amiga: Got a requester for "home:" because it's in the default runtime path. Don't bring up a requester when searching for a file in 'path', sourcing the .vimrc file or using ":runtime". Win16 and Win32: Considered a file "\path\file" absolute. Can cause the same file to appear as two different buffers. Win32: Renaming a file to an empty string crashed Vim. Happened when using explorer.vim and hitting ESC at the rename prompt. Win32: strftime() crashed when called with a "-1" value for the time. Win32 with Borland compiler: mch_FullName() didn't work, caused tag file not to be found. Cscope sometimes jumped to the wrong tag. (David Bustos) OS/2: Could not find the tags file. mch_expand_wildcards() added another slash to a directory name. When using ">>" the `] mark was not in the last column. When Vim was compiled without menu support, filetype.vim was still trying to source the menu.vim script. (Rafael Garcia-Suarez) ":ptag" added an item to the tag stack. Win32 IME: "gr" didn't use IME mode. In the "vim --help" message the term "options" was used for arguments. That's confusing, call them "arguments". When there are two windows, and a BufUnload autocommand for closing window #1 closed window #2, Vim would crash. When there is a preview window and only one other window, ":q" wouldn't exit. In Insert mode, when cancelling a digraph with ESC, the '?' wasn't removed. On Unix glob(".*") returned "." and "..", on Windows it didn't. On Windows glob("*") also returned files starting with a dot. Made this work like Unix on all systems. Win32: Removed old code to open a console. Vimrun is now used and works fine. Compute the room needed by the intro message accurately, so that it also fits on a 25 line console. (Craig Barkhouse) ":ptnext" was broken. Now remember the last tag used in the preview window separately from the tagstack. Didn't check for "-display" being the last argument. (Wichert Akkerman) GTK GUI: When starting "gvim" under some conditions there would be an X error. Don't replace the error handler when creating the xterm clipboard. (Wichert Akkerman) Adding a space after a help tag caused the tag not to be found. E.g., ":he autoindent ". Was trying to expand a URL into a full path name. On Windows this resulted in the current directory to be prepended to the URL. Added vim_isAbsName() and vim_FullName() to avoid that various machine specific functions do it differently. ":n *.c" ":cd .." ":n" didn't use the original directory of the file. Vi only does it for the current file (looks like a bug). Now remember the buffer used for the entry in the argument list and use its name (adjusted when doing ":cd"), unless it's deleted. When inserting a special key as its name ("<F8>
" as four characters) after moving around in Insert mode, undo didn't work properly. Motif GUI: When using the right mouse button, for some people gvim froze for a couple of seconds (Motif 1.2?). This doesn't happen when there is no Popup menu. Solved by only creating a popup menu when 'mousemodel' is "popup" or "popup_setpos". (David Harrison) Motif: When adding many menu items, the "Help" menu disappeared but the menubar didn't wrap. Now manually set the menubar height. When using<BS>
in Insert mode to remove a line break, or using "J" to join lines, the cursor could end up halfway a multi-byte character. (Muraoka Taro) Removed defining SVR4 in configure. It causes problems for some X header files and doesn't appear to be used anywhere. When 'wildignore' is used, 'ignorecase' for a tag match was not working. When 'wildignore' contains "*~" it was impossible to edit a file ending in a "~". Now don't recognize a file ending in "~" as containing wildcards. Disabled the mouse code for OS/2. It was not really used. ":mksession" always used the full path name for a buffer, also when the short name could be used. ":mkvimrc" and ":mksession" didn't save 'wildchar' and 'pastetoggle' in such a way that they would be restored. Now use the key name if possible, this is portable. After recovering a file and abandoning it, an ":edit" command didn't give the ATTENTION prompt again. Would be useful to be able to delete the file in an easy way. Reset the BF_RECOVERED flag when unloading the buffer. histdel() could match or ignore case, depending on what happened before it. Now always match case. When a window size was specified when splitting a window, it would still get the size from 'winheight' or 'winwidth' if it's larger. When using "append" or "insert" inside a function definition, a line starting with "function" or "endfunction" caused confusion. Now recognize the commands and skip lines until a ".". At the end of any function or sourced file need_wait_return could be reset, causing messages to disappear when redrawing. When in a while loop the line number for error messages stayed fixed. Now the line number is remembered in the while loop. "cd c:/" didn't work on MS-DOS. mch_isdir() removed a trailing slash. MS-Windows: getftime() didn't work when a directory had a trailing slash or backslash. Didn't show the time in the explorer because of this. When doing wildcard completion, a directory "a/" sorted after "a-b". Now recognize path separators when sorting files. Non-Unix systems: When editing "c:/dir/../file" and "c:/file" they were created as different buffers, although it's the same file. Expand to a full file name also when an absolute name contains "..". "g&" didn't repeat the last substitute properly. When 'clipboard' was set to "unnamed", a "Y" command would not write to "0. Now make a copy of register 0 to the clipboard register. When the search pattern matches in many ways, it could not always be interrupted with aCTRL-C
. AndCTRL-C
would have to be hit once for every line when 'hlsearch' is on. When 'incsearch' is on and interrupting the search for a match, don't abandon the command line. When turning a directory name into a full path, e.g., with fnamemodify(), sometimes a slash was added. Make this consistent: Don't add a slash. When a file name contains a "!", using it in a shell command will cause trouble: ":!cat %". Escape the "!" to avoid that. Escape it another time when 'shell' contains "sh". Completing a file name that has a tail that starts with a "~" didn't work: ":e view/~<Tab>
". Using a ":command" argument that contains < and > but not for a special argument was not skipped properly. The DOS install program: On Win2000 the check for a vim.exe or gvim.exe in $PATH didn't work, it always found it in the current directory. Rename the vim.exe in the current dir to avoid this. (Walter Briscoe) In the MS-DOS/Windows install program, use %VIM% instead of an absolute path, so that moving Vim requires only one change in the batch file. Mac: mch_FullName() changed the "fname" argument and didn't always initialize the buffer. MS-DOS: mch_FullName() didn't fix forward/backward slashes in an absolute file name. "echo expand("%:p:h")" with an empty file name removed one directory name on MS-DOS. For Unix, when the file name is a directory, the directory name was removed. Now make it consistent: "%:p" adds a path separator for all systems, but no path separator is added in other situations. Unix: When checking for aCTRL-C
(could happen any time) and there is an X event (e.g., clipboard updated) and there is typeahead, Vim would hang until a character was typed. MS-DOS, MS-Windows and Amiga: expanding "$ENV/foo" when $ENV ends in a colon, had the slash removed. ":he \^=" gave an error for using \_. ":he ^=" didn't find tag :set^=. Even "he :set^=" didn't find it. A tags file name "D:/tags" was used as file "tags" in "D:". That doesn't work when the current path for D: isn't the root of the drive. Removed calls to XtInitializeWidgetClass(), they shouldn't be necessary. When using a dtterm or various other color terminals, and the Normal group has been set to use a different background color, the background wouldn't always be displayed with that color. Added check for "ut" termcap entry: If it's missing, clearing the screen won't give us the current background color. Need to draw each character instead. Vim now also works when the "cl" (clear screen) termcap entry is missing. When repeating a "/" search command with a line offset, the "n" did use the offset but didn't make the motion linewise. Made "d/pat/+2" and "dn" do the same. Win32: Trying to use ":tearoff" for a menu that doesn't exist caused a crash. OpenPTY() didn't work on Sequent. Add a configure check for getpseudotty(). C-indenting: Indented a line starting with ")" with the matching "(", but not a line starting with "x)" looks strange. Also compute the indent for aligning with items inside the () and use the lowest indent. MS-DOS and Windows: ":n *.vim" also matched files ending in "~". Moved mch_expandpath() from os_win16.c and os_msdos.c to misc1.c, they are equal. Macintosh: (Dany St-Amant) - In Vi-compatible mode didn't read files with CR line separators. - Fixed a bug in the handling of Activate/Deactivate Event - Fixed a bug in gui_mch_dialog (using wrong pointer) Multibyte GDK XIM: While composing a multibyte-word, if user presses a mouse button, then the word is removed. It should remain and composing end. (Sung-Hyun Nam) MS-DOS, MS-Windows and OS/2: When reading from stdin, automatic CR-LF conversion by the C library got in the way of detecting a "dos" 'fileformat'. When 'smartcase' is set, patterns with "\S" would also make 'ignorecase' reset. When clicking the mouse in a column larger than 222, it moved to the first column. Can't encode a larger number in a character. Now limit the number to 222, don't jump back to the first column. GUI: In some versions CSI would cause trouble, either when typed directly or when part of a multi-byte sequence. When using multibyte characters in a ":normal" command, a trailing byte that is CSI or K_SPECIAL caused problems. Wildmenu didn't handle multi-byte characters. ":sleep 10" could not be interrupted on Windows, while "gs" could. Made them both work the same. Unix: When waiting for a character is interrupted by an X-windows event (e.g., to obtain the contents of the selection), the wait time would not be honored. A message could be overwritten quickly. Now compute the remaining waiting time. Windows: Completing "\\share\c$\S" inserted a backslash before the $ and then the name is invalid. Don't insert the backslash. When doing an auto-write before ":make", IObuff was overwritten and the wrong text displayed later. On the Mac the directories "c:/tmp" and "c:/temp" were used in the defaults for 'backupdir' and 'directory', they don't exist. The check for a new file not to be on an MS-DOS filesystem created the file temporarily, which can be slow. Don't do this if there is another check for the swap file being on an MS-DOS filesystem. Don't give the "Changing a readonly file" warning when reading from stdin. When using the "Save As" menu entry and not entering a file name, would get an error message for the trailing ":edit #". Now only do that when the alternate file name was changed. When Vim owns the X11 selection and is being suspended, an application that tries to use the selection hangs. When Vim continues it could no longer obtain the selection. Now give up the selection when suspending. option.h and globals.h were included in some files, while they were already included in vim.h. Moved the definition of EXTERN to vim.h to avoid doing it twice. When repeating an operator that used a search pattern and the search pattern contained characters that have a special meaning on the cmdline (e.g.,CTRL-U
) it didn't work. Fixed various problems with using K_SPECIAL (0x80) and CSI (0x9b) as a byte in a (multibyte) character. For example, the "r" command could not be repeated. The DOS/Windows install program didn't always work from a directory with a long filename, because $VIM and the executable name would not have the same path. Multi-byte: - Using an any-but character range [^x] in a regexp didn't work for UTF-8. (Muraoka Taro) - When backspacing over inserted characters in Replace mode multi-byte characters were not handled correctly. (Muraoka Taro) - Search commands "#" and "*" didn't work with multibyte characters. (Muraoka Taro) - Word completion in Insert mode didn't work with multibyte characters. (Muraoka Taro) - Athena/Motif GUI: when 'linespace' is non-zero the cursor would be drawn too wide (number of bytes instead of cell width). - When changing 'encoding' to "euc-jp" and inserting a character Vim would crash. - For euc-jp characters positioning the cursor would sometimes be wrong. Also, with two characters with 0x8e leading byte only the first one would be displayed. - When using DYNAMIC_ICONV on Win32 conversion might fail because of using the wrong error number. (Muraoka Taro) - Using Alt-x in the GUI while 'encoding' was set to "utf-8" didn't produce the right character. - When using Visual block selection and only the left halve of a double-wide character is selected, the highlighting continued to the end of the line. - Visual-block delete didn't work properly when deleting the right halve of a double-wide character. - Overstrike mode for the cmdline replaced only the first byte of a multibyte character. - The cursor in Replace mode (also in the cmdline) was to small on a double-wide character. - When a multibyte character contained a 0x80 byte, it didn't work (was using a CSI byte instead). (Muraoka Taro) - Wordwise selection with the mouse didn't work. - Yanking a modeless selection of multi-byte characters didn't work. - When 'selection' is "exclusive", selecting a word that ends in a multi-byte character used wrong highlighting for the following character. Win32 with Make_mvc.mak: Didn't compile for debugging. (Craig Barkhouse) Win32 GUI: When "vimrun.exe" is used to execute an external command, don't give a message box with the return value, it was already printed by vimrun. Also avoid printing the return value of the shell when ":silent!" is used. Win32: selecting a lot of text and using the "find/replace" dialog caused a crash. X11 GUI: When typing a character with the 8th bit set and the Meta/Alt modifier, the modifier was removed without changing the character. Truncating a message to make it fit on the command line, using "..." for the middle, didn't always compute the space correctly. Could not imap <C-@>. Now it works like<Nul>
. VMS: - Fixed a few things for VAXC. os_vms_fix.com had some strangeCTRL-M
characters. (Zoltan Arpadffy and John W. Hamill) - Added VMS-specific defaults for the 'isfname' and 'isprint' options. (Zoltan Arpadffy) - Removed os_vms_osdef.h, it's no longer used. The gzip plugin used a ":normal" command, this doesn't work when dropping a compressed file on Vim. In very rare situations a binary search for a tag would fail, because an uninitialized value happens to be half the size of the tag file. (Narendran) When using BufEnter and BufLeave autocommands to enable/disable a menu, it wasn't updated right away. When doing a replace with the "c"onfirm flag, the cursor was positioned after the ruler, instead of after the question. With a long replacement string the screen could scroll up and cause a "more" prompt. Now the message is truncated to make it fit. Motif: The autoconf check for the Xp library didn't work. When 'verbose' is set to list lines of a sourced file, defining a function would reset the counter used for the "more" prompt. In the Win32 find/replace dialog, a '/' character caused problems. Escape it with a backslash. Starting a shell with ":sh" was different from starting a shell forCTRL-Z
when suspending doesn't work. They now work the same way. Jumping to a file mark while in a changed buffer gave a "mark not set" error. ":execute histget("cmd")" causes an endless loop and crashed Vim. Now catch all commands that cause too much recursiveness. Removed "Failed to open input method" error message, too many people got this when they didn't want to use a XIM. GUI: When compiled without the +windows feature, the scrollbar would start below line one. Removed the trick with redefining character class functions from regexp.c. Win32 GUI: Find dialog gives focus back to main window, when typing a character mouse pointer is blanked, it didn't reappear when moving it in the dialog window. (Vince Negri) When recording and typing aCTRL-C
, no character was recorded. When in Insert mode or cancelling half a command, playing back the recorded sequence wouldn't work. Now record theCTRL-C
. When the GUI was started, mouse codes for DEC and netterm were still checked for. GUI: When scrolling and 'writedelay' is non-zero, the character under the cursor was displayed in the wrong position (one line above/below withCTRL-E
/CTRL-Y
). A ":normal" command would reset the 'scrollbind' info. Causes problems when using a ":normal" command in an autocommand for opening a file. Windows GUI: a point size with a dot, like "7.5", wasn't recognized. (Muraoka Taro) When 'scrollbind' wasn't set would still remember the current position, wasting time. GTK: Crash when 'shell' doesn't exist and doing":!ls". Use _exit() instead of exit() when the child couldn't execute the shell. Multi-byte: - GUI with double-byte encoding: a mouse click in left halve of double-wide character put the cursor in previous char. - Using double-byte encoding and 'selection' is "exclusive": "vey" and "^Vey" included the character after the word. - When using a double-byte encoding and there is a lead byte at the end of the line, the preceding line would be displayed. "ga" also showed wrong info. - "gf" didn't include multi-byte characters before the cursor properly. (Muraoka Taro) GUI: The cursor was sometimes not removed when scrolling. Changed the policy from redrawing the cursor after each call to gui_write() to only update it at the end of update_screen() or when setting the cursor position. Also only update the scrollbars at the end of update_screen(), that's the only place where the window text may have been scrolled. Formatting "/*<Tab>
long text", produced "*<Tab>
" in the next line. Now remove the space before the Tab. Formatting "/*<Tab>
long text", produced "*<Tab>
long text" in the next line. Now keep the space after the Tab. In some places non-ASCII alphabetical characters were accepted, which could cause problems. For example, ":X" (X being such a character). When a pattern matches the end of the line, the last character in the line was highlighted for 'hlsearch'. That looks wrong for "/\%3c". Now highlight the character just after the line. Motif: If a dialog was closed by clicking on the "X" of the window frame Vim would no longer respond. When usingCTRL-X
orCTRL-A
on a number with many leading zeros, Vim would crash. (Matsumoto) When 'insertmode' is set, the mapping in mswin.vim forCTRL-V
didn't work in Select mode. Insert mode wasn't restarted after overwriting the text. Now allow nesting Insert mode with insert and change commands.CTRL-O
cwfoo<Esc>
now also works. Clicking with the right mouse button in another window started Visual mode, but used the start position of the current window. Caused ml_get errors when the line number was invalid. Now stay in the same window. When 'selection' is "exclusive", "gv" sometimes selected one character fewer. When 'comments' contains more than one start/middle/end triplet, the optional flags could be mixed up. Also didn't align the end with the middle part. Double-right-click in Visual mode didn't update the shown mode. When the Normal group has a font name, it was never used when starting up. Now use it when 'guifont' and 'guifontset' are empty. Setting a font name to a highlight group before the GUI was started didn't work. "make test" didn't use the name of the generated Vim executable. 'cindent' problems: - Aligned with an "else" inside a do-while loop for a line below that loop. (Meikel Brandmeyer) - A line before a function would be indented even when terminated with a semicolon. (Meikel Brandmeyer) - 'cindent' gave too much indent to a line after a "};" that ends an array init. - Support declaration lines ending in "," and "\". (Meikel Brandmeyer) - A case statement inside a do-while loop was used for indenting a line after the do-while loop. (Meikel Brandmeyer) - When skipping a string in a line with one double quote it could continue in the previous line. (Meikel Brandmeyer) When 'list' is set, 'hlsearch' didn't highlight a match at the end of the line. Now highlight the '$'. The Paste menu item in the menu bar, the popup menu and the toolbar were all different. Now made them all equal to how it was done in mswin.vim. st_dev can be smaller than "unsigned". The compiler may give an overflow warning. Added a configure check for dev_t. Athena: closing a confirm() dialog killed Vim. Various typos in the documentation. (Matt Dunford) Python interface: The definition of _DEBUG could cause trouble, undefine it. The error message for not being able to load the shared library wasn't translated. (Muraoka Taro) Mac: (Dany St-Amant and Axel Kielhorn) - Several fixes. - Vim was eating 80% of the CPU time. - The project os_mac.pbxproj didn't work, Moved it to a subdirectory. - Made the menu priority work for the menubar. - Fixed a problem with dragging the scrollbar. - Cleaned up the various #ifdefs. Unix: When catching a deadly signal and we keep getting one use _exit() to exit in a quick and dirty way. Athena menu ordering didn't work correctly. (David Harrison) A ":make" or ":grep" command with a long argument could cause a crash. Doing ":new file" and using "Quit" for the ATTENTION dialog still opened a new window. GTK: When starting the GUI and there is an error in the .vimrc file, don't present the wait-return prompt, since the message was given in the terminal. When there was an error in a .vimrc file the terminal where gvim was started could be cleared. Set msg_row in main.c before writing any messages. GTK and X11 GUI: When trying to read characters from the user (e.g. with input()) before the Vim window was opened caused Vim to hang when it was started from the desktop. OS/390 uses 31 bit pointers. That broke some computations with MAX_COL. Reduce MAX_COL by one bit for OS/390. (Ralf Schandl) When defining a function and it already exists, Vim didn't say it existed until after typing it. Now do this right away when typing it. The message remembered for displaying later (keep_msg) was sometimes pointing into a generic buffer, which might be changed by the time the message is displayed. Now make a copy of the message. When using multi-byte characters in a menu and a trailing byte is a backslash, the menu would not be created correctly. (Muraoka Taro) Using a multibyte character in the substitute string where a trail byte is a backslash didn't work. (Muraoka Taro) When setting "t_Co" in a vimrc file, then setting it automatically from an xterm termresponse and then setting it again manually caused a crash. When getting the value of a string option that is not supported, the number zero was returned. This breaks a check like "&enc == "asdf". Now an empty string is returned for string options. Crashed when starting the GTK GUI while using 'notitle' in the vimrc, setting 'title' in the gvimrc and starting the GUI with ":gui". Closed the connection to the X server accidentally. Had to hit return after selecting an entry for ":ts". The message from ":cn" message was sometimes cleared. Now display it after redrawing if it doesn't cause a scroll (truncated when necessary). hangulin.c didn't compile when the GUI was disabled. Disable it when it won't work. When setting a termcap option like "t_CO", the value could be displayed as being for a normal key with a modifier, like "<M-=>". When expanding the argument list, entries which are a directory name did not get included. This stopped "vim c:/" from opening the file explorer. ":syn match sd "^" nextgroup=asdf" skipped the first column and matched the nextgroup in the second column. GUI: When 'lazyredraw' is set, 'showmatch' didn't work. Required flushing the output. Don't define the<NetMouse>
termcode in an xterm, reduces the problem when someone types<Esc>
} in Insert mode. Made slash_adjust() work correctly for multi-byte characters. (Yasuhiro Matsumoto) Using a filename in Big5 encoding for autocommands didn't work (backslash in trailbyte). (Yasuhiro Matsumoto) DOS and Windows: Expanding *.vim also matched file.vimfoo. Expand path like Unix to avoid problems with Windows dir functions. Merged the DOS and Win32 functions. Win32: Gvimext could not edit more than a few files at once, the length of the argument was fixed. "ls -1 * | xargs vim" worked, but the input was in cooked mode. Now switch to raw mode when needed. Use dup() to copy the stderr file descriptor to stdin to make shell commands work. No longer requires an external program to do this. When using ":filetype off", ftplugin and indent usage would be switched off at the same time. Don't do this, setting 'filetype' manually can still use them. GUI: When writing a double-byte character, it could be split up in two calls to gui_write(), which doesn't work. Now flush before the output buffer becomes full. When 'laststatus' is set and 'cmdheight' is two or bigger, the intro message would be written over the status line. The ":intro" command didn't work when there wasn't enough room. Configuring for Ruby failed with a recent version of Ruby. (Akinori Musha) Athena: When deleting the directory in which Vim was started, using the file browser made Vim exit. Removed the use of XtAppError(). When using autoconf 2.50, UNIX was not defined. Moved the comment for "#undef UNIX" to a separate line. Win32: Disabled _OnWindowPosChanging() to make maximize work better. Win32: Compiling with VC 4.0 didn't work. (Walter Briscoe) Athena: - Finally fixed the problems with deleting a menu. (David Harrison) - Athena: When closing the confirm() dialog, worked like OK was pressed, instead of Cancel. The file explorer didn't work in compatible mode, because of line continuation. Didn't give an error message for ":digraph a". When using Ex mode in the GUI and typing a special key,<BS>
didn't delete it correctly. Now display '?' for a special key. When an operator is pending, clicking in another window made it apply to that window, even though the line numbers could be beyond the end of the buffer. When a function call doesn't have a terminating ")" Vim could crash. Perl interface: could crash on exit with perl 5.6.1. (Anduin Withers) Using %P in 'errorformat' wasn't handled correctly. (Tomas Zellerin) Using a syntax cluster that includes itself made Vim crash. GUI: With 'ls' set to 2, dragging the status line all the way up, then making the Vim window smaller: Could not the drag status line anymore. "vim -c startinsert! file" placed cursor on last char of a line, instead of after it. A ":set" command in the buffer menu set w_set_curswant. Now don't do this when w_curswant is MAXCOL. Win32: When the gvim window was maximized and selecting another font, the window would no longer fill the screen. The line with 'pastetoggle' in ":options" didn't show the right value when it is a special key. Hitting<CR>
didn't work either. Formatting text, resulting in a % landing in the first line, repeated the % in the following lines, like it's the start of a comment. GTK: When adding a toolbar item while gvim is already running, it wasn't possible to use the tooltip. Now it works by adding the tooltip first. The output of "gCTRL-G
" mentioned "Char" but it's actually bytes. Searching for the end of a oneline region didn't work correctly when there is an offset for the highlighting. Syntax highlighting: When synchronizing on C-comments, //*/ was seen as the start of a comment. Win32: Without scrollbars present, the MS mouse scroll wheel didn't work. Also handle the scrollbars when they are not visible. Motif: When there is no right scrollbar, the bottom scrollbar would still leave room for it. (Marcin Dalecki) When changing 'guicursor' and the value is invalid, some of the effects would still take place. Now first check for errors and only make the new value effective when it's OK. Using "A" In Visual block mode, appending to lines that don't extend into the block, padding was wrong. When pasting a block of text, a character that occupies more than one screen column could be deleted and spaces inserted instead. Now only do that with a tab. Fixed conversion of documentation to HTML using Perl. (Dan Sharp) Give an error message when a menu name starts with a dot. Avoid a hang when executing a shell from the GUI on HP-UX by pushing "ptem" even when sys/ptem.h isn't present. When creating the temp directory, make sure umask is 077, otherwise the directory is not accessible when it was set to 0177. Unix: When resizing the window and a redraw is a bit slow, could get a window resize event while redrawing, resulting in a messed up window. Any input (e.g., a mouse click) would redraw. The "%B" item in the status line became zero in Insert mode (that's normal) for another than the current window. The menu entries to convert to xxd and back didn't work in Insert mode. When ":vglobal" didn't find a line where the pattern doesn't match, the error message would be the wrong way around. When ignoring a multi-line error message with "%-A", the continuation lines would be used anyway. (Servatius Brandt) "grx" on a double-wide character inserted "x", instead of replacing the character with "x ". "gR" on<xx>
('display' set the "uhex") didn't replace at all. When doing "gRxx" on a control character the first "x" would be inserted, breaking the alignment. Added "0)" to 'cinkeys', so that when typing a ) it is put in the same place as where "==" would put it. Win32: When maximized, adding/removing toolbar didn't resize the text area. When using<C-RightMouse>
a count was discarded. When typingCTRL-V
and<RightMouse>
in the command line, would insert<LeftMouse>
. Using "vis" or "vas" when 'selection' is exclusive didn't include the last character. When adding to an option like 'grepprg', leading space would be lost. Don't expand environment variables when there is no comma separating the items. GUI: When using a bold-italic font, would still use the bold trick and underlining. Motif: The default button didn't work in dialogs, the first one was always used. Had to give input focus to the default button. When usingCTRL-T
to jump within the same file, the '' mark wasn't set. Undo wasn't Vi compatible when using the 'c' flag for ":s". Now it undoes the whole ":s" command instead of each confirmed replacement. The Buffers menu, when torn-off, disappeared when being refreshed. Add a dummy item to avoid this. Removed calling msg_start() in main(), it should not be needed. vim_strpbrk() did not support multibyte characters. (Muraoka Taro) The Amiga version didn't compile, the code was too big for relative jumps. Moved a few files from ex_docmd.c to ex_cmds2.c When evaluating the "= register resulted in the "= register being changed, Vim would crash. When doing ":view file" and it fails, the current buffer was made read-only. Motif: For some people the separators in the toolbar disappeared when resizing the Vim window. (Marcin Dalecki) Win32 GUI: when setting 'lines' to a huge number, would not compute the available space correctly. Was counting the menu height twice. Conversion of the docs to HTML didn't handle the line with the +quickfix tag correctly. (Antonio Colombo) Win32: fname_case() didn't handle multi-byte characters correctly. (Yasuhiro Matsumoto) The Cygwin version had trouble with fchdir(). Don't use that function for Cygwin. The generic check in scripts.vim for "conf" syntax was done before some checks in filetype.vim, resulting in "conf" syntax too often. Dos32: Typing lagged behind. Would wait for one biostick when checking if a character is available. GTK: When setting 'columns' while starting up "gvim", would set the width of the terminal it was started in. When using ESC in Insert mode, an autoindent that wraps to the next line caused the cursor to move to the end of the line temporarily. When the character before the cursor was a double-wide multi-byte character the cursor would be on the right halve, which causes problems with some terminals. Didn't handle multi-byte characters correctly when expanding a file name. (Yasuhiro Matsumoto) Win32 GUI: Errors generated before the GUI is decided to start were not reported. globpath() didn't reserve enough room for concatenated results. (Anduin Withers) When expanding an option that is very long already, don't do the expansion, it would be truncated to MAXPATHL. (Anduin Withers) When 'selection' is "exclusive", using "Fx" in Visual mode only moved until just after the character. When using IME on the console to enter a file name, the screen may scroll up. Redraw the screen then. (Yasuhiro Matsumoto) Motif: In the find/replace dialog the "Replace" button didn't work first time, second time it replaced all matches. Removed the use of ":s///c". GTK: Similar problems with the find/replace dialog, moved the code to a common function. X11: Use shared GC's for text. (Marcin Dalecki) "]i" found the match under the cursor, instead of the first one below it. Same for "]I", "]CTRL-I
", "]d", "]D" and "]CTRL-D
". Win16: When maximized and the font is changed, don't change the window size. (Vince Negri) When 'lbr' is set, deleting a block of text could leave the cursor in the wrong position. Win32: When opening a file with the "Edit with Vim" popup menu entry, wildcards would cause trouble. Added the "--literal" argument to avoid expanding file names. When using "gv", it didn't restore that "$" was used in Visual block mode. Win32 GUI: While waiting for a shell command to finish, the window wasn't redrawn at all. (Yasuhiro Matsumoto) Syntax highlighting: A match that continues on a next line because of a contained region didn't end when that region ended. The ":s" command didn't allow flags like 'e' and 'i' right after it. When using ":s" to split a line, marks were moved to the next line. Vi keeps them in the first line. When using ":n" ":rew", the previous context mark was at the top of the file, while Vi puts it in the same place as the cursor. Made it Vi compatible. Fixed Vi incompatibility: Text was not put in register 1 when using "c" and "d" with a motion character, when deleting within one line with one of the commands: % ( ) `<character>
/ ? N n { } Win32 GUI: The tooltip for tear-off items remained when the tear-off item was no longer selected. GUI: When typing ":" at the more prompt, would return to Normal mode and not redraw the screen. When starting Vim with an argument "-c g/at/p" the printed lines would overwrite each other. BeOS: Didn't compile. Configure didn't add the os_beos files, the QNX check removed them. Various changes to os_beos.cc. (Joshua Haberman) Removed the check for the hardware platform, the BeBox has not been produced for a long time now. Win32 GUI: don't use a message box when the shell returns an error code, display the message in the Vim window. Make_mvc.mak always included "/debug" for linking. "GUI=no" argument didn't work. Use "DEBUG=yes" instead of "DEBUG=1" to make it consistent. (Dan Sharp) When a line in the tags file ended in ;" (no TAB following) the command would not be recognized as a search command. X11: The inputMethod resource never worked. Don't use the "none" input method for SGI, it apparently makes the first character in Input method dropped. Fixed incorrect tests in os_mac.h. (Axel Kielhorn) Win32 console: When the console where Vim runs in is closed, Vim could hang in trying to restore the window icon. (Yasuhiro Matsumoto) When using ":3call func()" or ":3,3call func() the line number was ignored. When 'showbreak' and 'linebreak' were both set, Visual highlighting sometimes continued until the end of the line. GTK GUI: Tearoff items were added even when 'guioptions' didn't contain 't' when starting up. MS-Windows: When the current directory includes a "~", searching files with "gf" or ":find" didn't work. A "$" in the directory had the same problem. Added mch_has_exp_wildcard() functions. When reducing the Vim window height while starting up, would get an out-of-memory error message. When editing a very long search pattern, 'incsearch' caused the redraw of the command line to fail. Motif GUI: On some systems the "Help" menu would not be on the far right, as it should be. On some other systems (esp. IRIX) the command line would not completely show. Solution is to only resize the menubar for Lesstif. Using "%" in a line that contains "\\" twice didn't take care of the quotes properly. Now make a difference between \" and \\". For non-Unix systems a dummy file is created when finding a swap name to detect a 8.3 filesystem. When there is an existing swap file, would get a warning for the file being created outside of Vim. Also, when closing the Vim window the file would remain. Motif: The menu height was always computed, using a "-menuheight" argument was setting the room for the command line. Now make clear the argument is not supported. For some (EBCDIC) systems, POUND was equal to '#'. Added an #if for that to avoid a duplicate case in a switch. The GUI may have problems when forking. Always call _exit() instead of exit() in the parent, the child will call exit(). Win32 GUI: Accented characters were often wrong in dialogs and tearoff menus. Now use CP_ACP instead of CP_OEMCP. (Vince Negri) When displaying text with syntax highlighting causes an error (e.g., running out of stack) the syntax highlighting is disabled to avoid further messages. When a command in a .vimrc or .gvimrc causes an ATTENTION prompt, and Vim was started from the desktop (no place to display messages) it would hang. Now open the GUI window early to be able to display the messages and pop up the dialog. "r<CR>
" on a multi-byte character deleted only the first byte of the character. "3r<CR>
" deleted three bytes instead of three characters. When interrupting reading a file, Vi considers the buffer modified. Added the 'i' flag in 'cpoptions' flag for this (we don't want it modified to be able to do ":q"). When using an item in 'guicursor' that starts with a colon, Vim would get stuck or crash. When putting a file mark in a help file and later jumping back to it, the options would not be set. Extended the modeline in all help files to make this work better. When a modeline contained "::" the local option values would be printed. Now ignore it. Some help files did not use a 8.3 names, which causes problems when using MS-DOS unzip. Renamed "multibyte.txt" to "mbyte.txt", "rightleft.txt" to "rileft.txt", "tagsearch.txt" to "tagsrch.txt", "os_riscos.txt" to "os_risc.txt". When Visual mode is blockwise, using "iw" or "aw" made it characterwise. That doesn't seem right, only do this when in linewise mode. But then do it always, not only when start and end of Visual mode are equal. When using "viw" on a single-letter word and 'selection' is exclusive, would not include the word. When formatting text from Insert mode, usingCTRL-O
, could mess up undo information. While writing a file (also for the backup file) there was no check for an interrupt (hittingCTRL-C
). Vim could hang when writing a large file over a slow network, and moving the mouse didn't make it appear (when 'mousehide' is set) and the screen wasn't updated in the GUI. Also allow interrupting when syncing the swap file, it can take a long time. When using ":mksession" while there is help window, it would later be restored to the right file but not marked as a help buffer. ":help" would then open another window. Now use the value "help" for 'buftype' to mark a help buffer. The session file contained absolute path names in option values, that doesn't work when the home directory depends on the situation. Replace the home directory with ~/ when possible. When using 'showbreak' a TAB just after the shown break would not be counted correctly, the cursor would be positioned wrong. With 'showbreak' set to "--->" or "------->" and 'sts' set to 4, inserting tabs did not work right. Could cause a crash. Backspacing was also wrong, could get stuck at a line break. Win32: crashed when tearing off a menu with over 300 items. GUI: A menu or toolbar item would appear when only a tooltip was defined for it. When 'scrolloff' is non-zero and "$" is in 'cpoptions', using "s" while the last line of the file is the first line on screen, the text wasn't displayed. When running "autoconf", delete the configure cache to force starting cleanly when configure is run again. When changing the Normal colors for cterm, the value of 'background' was changed even when the GUI was used. The warning for a missing vimrun.exe was always given on startup, but some people just editing a file don't need to be bothered by it. Only show it when vimrun would be used. When using "%" in a multibyte text it could get confused by trailbytes that match. (Muraoka Taro) Termcap entry for RiscOS was wrong, using 7 and 8 in octal codes. Athena: The title of a dialog window and the file selector window were not set. (David Harrison) The "htmlLink" highlight group specified colors, which gives problems when using a color scheme. Added the "Underlined" highlight group for this. After using ":insert" or ":change" the '[ mark would be one line too low. When looking for the file name after a match with 'include' one character was skipped. Same for 'define'. Win32 and DJGPP: When editing a file with a short name in a directory, and editing the same file but using the long name, would end up with two buffers on the same file. "gf" on a filename that starts with "../" only worked when the file being edited is in the current directory. An include file search didn't work properly for files starting with "../" or ".". Now search both relative to the file and to the current directory. When 'printheader', 'titlestring', 'iconstring', 'rulerformat' or 'statusline' contained "%{" but no following "}" memory was corrupted and a crash could happen. ":0append" and then inserting two lines did not redraw the blank lines that were scrolled back down. When using insert mode completion in a narrow window, the message caused a scroll up. Now shorten the message if it doesn't fit and avoid writing the ruler over the message. XIM still didn't work correctly on some systems, especially SGI/IRIX. Added the 'imdisable' option, which is set by default for that system. Patch 6.0aw.008 问题: When the first character of a file name is over 127, the Buffers menu entry would get a negative priority and cause problems. 解决方案: Reduce the multiplier for the first character when computing the hash value for a Buffers menu entry. 相关文件: runtime/menu.vim Patch 6.0aw.010 问题: Win32: ":browse edit dir/dir" didn't work. (Vikas) 解决方案: Change slashes to backslashes in the directory passed to the file browser. 相关文件: src/gui_w48.c Athena file browser: On some systems wcstombs() can't be used to get the length of a multi-byte string. Use the maximum length then. (Yasuhiro Matsumoto) Patch 6.0ax.001 问题: When 'patchmode' is set, appending to a file gives an empty original file. (Ed Ralston) 解决方案: Also make a backup copy when appending and 'patchmode' is set. 相关文件: src/fileio.c Patch 6.0ax.002 问题: When 'patchmode' is set, appending to a compressed file gives an uncompressed original file. (Ed Ralston) 解决方案: Create the original file before decompressing. 相关文件: runtime/plugin/gzip.vim Patch 6.0ax.005 问题: Athena file selector keeps the title of the first invocation. 解决方案: Set the title each time the file selector is opened. (David Harrison) 相关文件: src/gui_at_fs.c Patch 6.0ax.007 问题: When using GPM (mouse driver in a Linux console) a double click is interpreted as a scroll wheel click. 解决方案: Check if GPM is being used when deciding if a mouse event is for the scroll wheel. 相关文件: src/term.c Patch 6.0ax.010 问题: The Edit.Save menu and the Save toolbar button didn't work when the buffer has no file name. 解决方案: Use a file browser to ask for a file name. Also fix the toolbar Find item in Visual mode. 相关文件: runtime/menu.vim Patch 6.0ax.012 问题: When 'cpoptions' contains "$", breaking a line for 'textwidth' doesn't redraw properly. (Stefan Schulze) 解决方案: Remove the dollar before breaking the line. 相关文件: src/edit.c Patch 6.0ax.014 问题: Win32: On Windows 98 ":make -f file" doesn't work when 'shell' is "command.com" and 'makeprg' is "nmake". The environment isn't passed on to "nmake". 解决方案: Also use vimrun.exe when redirecting the output of a command. 相关文件: src/os_win32.c Patch 6.0ax.016 问题: The version number was reported wrong in the intro screen. 解决方案: Check for a version number with two additional letters. 相关文件: src/version.c Patch 6.0ax.019 问题: When scrolling a window with folds upwards, switching to another vertically split window and back may not update the scrollbar. 解决方案: Limit w_botline to the number of lines in the buffer plus one. 相关文件: src/move.c
6.1 版 本 *version-6.1*
本小节讨论 6.0 和 6.1 版本之间的改进。 这是一个漏洞修正版。其实没有什么新特性。 改动 *changed-6.1*
用 ":lmap" 定义语言映射时，不再有设置 'iminsert' 和 'imsearch' 的副作用。 新增 *added-6.1*
语法文件: ampl AMPL (David Krief) ant Ant (Johannes Zellner) baan Baan (Her van de Vliert) cs C# (Johannes Zellner) lifelines Lifelines (Patrick Texier) lscript LotusScript (Taryn East) moo MOO (Timo Frenay) nsis NSIS (Alex Jakushev) ppd Postscript Printer Description (Bjoern Jacke) rpl RPL/2 (Joel Bertrand) scilab Scilab (Benoit Hamelin) splint Splint (Ralf Wildenhues) sqlj SQLJ (Andreas Fischbach) wvdial WvDial (Prahlad Vaidyanathan) xf86conf XFree86 config (Nikolai Weibull) xmodmap Xmodmap (Nikolai Weibull) xslt Xslt (Johannes Zellner) monk Monk (Mike Litherland) xsd Xsd (Johannes Zellner) cdl CDL (Raul Segura Acevedo) sendpr Send-pr (Hendrik Scholz) 加入 Scheme 缩进文件。(Dorai Sitaram) 加入 Prolog 缩进文件。(Kontra Gergely) 加入 Povray 缩进文件。(David Necas) 加入 IDL 缩进文件 (Aleksandar Jelenak) 加入 C# 缩进和文件类型插件脚本。 加入乌克兰语菜单翻译。(Bohdan Vlasyuk) 加入捷克菜单的 ASCII 版本。(Jiri Brezina) 加入教程的简体中文翻译。(Mendel L Chan) 加入 yawerty 键盘的俄罗斯键盘映射表。 教程里加上使用 vimrc 文件的解释。 修改 tutor.vim，台湾版教程能使用合适的编码。 加入俄语教程。(Andrey Kiselev) 加入波兰语教程。(Mikolaj Machowski) 加入 darkblue 色彩方案。(Bohdan Vlasyuk) 打包时，dos 语言归档自动生成需要的 .mo 文件。 改进了 NSIS 脚本以支持 NSIS 180。加入打开/关闭状态的图标。(Mirek Pruchnik) cp1250 版本的斯洛伐克消息翻译版本。 IRIX 编译器的编译器插件。(David Harrison) 修正 *fixed-6.1*
The license text was updated to make the meaning clearer and make it compatible with the GNU GPL. Otherwise distributors have a problem when linking Vim with a GPL'ed library. When installing the "less.sh" script it was not made executable. (Chuck Berg) Win32: The "9" key on the numpad wasn't working. (Julian Kinraid) The NSIS install script didn't work with NSIS 1.80 or later. Also add Vim-specific icons. (Pruchnik) The script for conversion to HTML contained an "if" in the wrong place. (Michael Geddes) Allow using ":ascii" in the sandbox, it's harmless. Removed creat() from osdef2.h.in, it wasn't used and may cause a problem when it's redefined to creat64(). The text files in the VisVim directory were in "dos" format. This caused problems when applying a patch. Now keep them in "unix" format and convert them to "dos" format only for the PC archives. Add ruby files to the dos source archive, they can be used by Make_mvc.mak. (Mirek Pruchnik) "cp -f" doesn't work on all systems. Change "cp -f" in the Makefile to "rm -f" and "cp". Didn't compile on a Compaq Tandem Himalaya OSS. (Michael A. Benzinger) The GTK file selection dialog didn't include the "Create Dir", "Delete File" and "Rename File" buttons. When doing ":browse source" the dialog has the title "Run Macro". Better would be "Source Vim script". (Yegappan Lakshmanan) Win32: Don't use the printer font as default for the font dialog. "make doslang" didn't work when configure didn't run (yet). Set $MAKEMO to "yes". (Mirek Pruchnik) The ToolBar TagJump item used "g]", which prompts for a selection even when there is only one matching tag. Use "g<C-]>" instead. The ming makefile for message translations didn't have the right list of files. The MS-Windows 3.1 version complains about LIBINTL.DLL not found. Compile this version without message translations. The Borland 5 makefile contained a check for Ruby which is no longer needed. The URLs for the TCL library was outdated. (Dan Sharp) The eviso.ps file was missing from the DOS runtime archive, it's needed for printing PostScript in the 32bit DOS version. In menu files ":scriptencoding" was used in a wrong way after patch 6.1a.032 Now use ":scriptencoding" in the file where the translations are given. Do the same for all menus in latin1 encoding. Included a lot of fixes for the Macintosh, mostly to make it work with Carbon. (Dany StAmant, Axel Kielhorn, Benji Fisher) Improved the vimtutor shell script to use $TMPDIR when it exists, and delete the copied file when exiting in an abnormal way. (Max Ischenko) When "iconv.dll" can't be found, try using "libiconv.dll". When encryption is used, filtering with a shell command wasn't possible. DJGPP: ":cd c:" always failed, can't get permissions for "c:". Win32: ":cd c:/" failed if the previous current directory on c: had become invalid. DJGPP: Shift-Del and Del both produce \316\123. Default mapping for Del is wrong. Disabled it. Dependencies on header files in MingW makefile was wrong. Win32: Don't use ACL stuff for MSVC 4.2, it's not supported. (Walter Briscoe) Win32 with Borland: bcc.cfg was caching the value for $(BOR), but providing a different argument to make didn't regenerate it. Win32 with MSVC: Make_ivc.mak generates a new if_ole.h in a different directory, the if_ole.h in the src directory may be used instead. Delete the distributed file. When a window is vertically split and then ":ball" is used, the window layout is messed up, can cause a crash. (Muraoka Taro) When 'insertmode' is set, using File/New menu and then double clicking, "i" is soon inserted. (Merlin Hansen) When Select mode is active and using the Buffers menu to switch to another buffer, an old selection comes back. Reset VIsual_reselect for a ":buffer" command. When Select mode is active and 'insertmode' is set, using the Buffers menu to switch to another buffer, did not return to Insert mode. Make sure "restart_edit" is set. When double clicking on the first character of a word while 'selection' is "exclusive" didn't select that word. Patch 6.0.001 问题: Loading the sh.vim syntax file causes error messages. (Corinna Vinschen) 解决方案: Add an "if". (Charles Campbell) 相关文件: runtime/syntax/sh.vim Patch 6.0.002 问题: Using a '@' item in 'viminfo' doesn't work. (Marko Leipert) 解决方案: Add '@' to the list of accepted items. 相关文件: src/option.c Patch 6.0.003 问题: The configure check for ACLs on AIX doesn't work. 解决方案: Fix the test program so that it compiles. (Tomas Ogren) 相关文件: src/configure.in, src/auto/configure Patch 6.0.004 问题: The find/replace dialog doesn't reuse a previous argument properly. 解决方案: After removing a "\V" terminate the string. (Zwane Mwaikambo) 相关文件: src/gui.c Patch 6.0.005 问题: In Insert mode, "CTRL-O
:ls" has a delay before redrawing. 解决方案: Don't delay just after wait_return() was called. Added the did_wait_return flag. 相关文件: src/globals.h, src/message.c, src/normal.c, src/screen.c Patch 6.0.006 问题: With a vertical split, 'number' set and 'scrolloff' non-zero, making the window width very small causes a crash. (Niklas Lindstrom) 解决方案: Check for a zero width. 相关文件: src/move.c Patch 6.0.007 问题: When setting 'filetype' while there is no FileType autocommand, a following ":setfiletype" would set 'filetype' again. (Kobus Retief) 解决方案: Set did_filetype always when 'filetype' has been set. 相关文件: src/option.c Patch 6.0.008 问题: 'imdisable' is missing from the options window. (Michael Naumann) 解决方案: Add an entry for it. 相关文件: runtime/optwin.vim Patch 6.0.009 问题: Nextstep doesn't have S_ISBLK. (John Beppu) 解决方案: Define S_ISBLK using S_IFBLK. 相关文件: src/os_unix.h Patch 6.0.010 问题: Using "gf" on a file name starting with "./" or "../" in a buffer without a name causes a crash. (Roy Lewis) 解决方案: Check for a NULL file name. 相关文件: src/misc2.c Patch 6.0.011 问题: Python: After replacing or deleting lines get an ml_get error. (Leo Lipelis) 解决方案: Adjust the cursor position for deleted or added lines. 相关文件: src/if_python.c Patch 6.0.012 问题: Polish translations contain printf format errors, this can result in a crash when using one of them. 解决方案: Fix for translated messages. (Michal Politowski) 相关文件: src/po/pl.po Patch 6.0.013 问题: Using ":silent! cmd" still gives some error messages, like for an invalid range. (Salman Halim) 解决方案: Reset emsg_silent after calling emsg() in do_one_cmd(). 相关文件: src/ex_docmd.c Patch 6.0.014 问题: When 'modifiable' is off and 'virtualedit' is "all", "rx" on a TAB still changes the buffer. (Muraoka Taro) 解决方案: Check if saving the line for undo fails. 相关文件: src/normal.c Patch 6.0.015 问题: When 'cpoptions' includes "S" and "filetype plugin on" has been used, can get an error for deleting the b:did_ftplugin variable. (Ralph Henderson) 解决方案: Only delete the variable when it exists. 相关文件: runtime/ftplugin.vim Patch 6.0.016 问题: bufnr(), bufname() and bufwinnr() don't find unlisted buffers when the argument is a string. (Hari Krishna Dara) Also for setbufvar() and getbufvar(). 解决方案: Also find unlisted buffers. 相关文件: src/eval.c Patch 6.0.017 问题: When 'ttybuiltin' is set and a builtin termcap entry defines t_Co and the external one doesn't, it gets reset to empty. (David Harrison) 解决方案: Only set t_Co when it wasn't set yet. 相关文件: src/term.c Patch 6.0.018 问题: Initializing 'encoding' may cause a crash when setlocale() is not used. (Dany St-Amant) 解决方案: Check for a NULL pointer. 相关文件: src/mbyte.c Patch 6.0.019 问题: Converting a string with multi-byte characters to a printable string, e.g., with strtrans(), may cause a crash. (Tomas Zellerin) 解决方案: Correctly compute the length of the result in transstr(). 相关文件: src/charset.c Patch 6.0.020 问题: When obtaining the value of a global variable internally, could get the function-local value instead. Applies to using<Leader>
and<LocalLeader>
and resetting highlighting in a function. 解决方案: Prepend "g:" to the variable name. (Aric Blumer) 相关文件: src/syntax.c, src/term.c Patch 6.0.021 问题: The 'cscopepathcomp' option didn't work. 解决方案: Change USE_CSCOPE to FEAT_CSCOPE. (Mark Feng) 相关文件: src/option.c Patch 6.0.022 问题: When using the 'langmap' option, the second character of a command starting with "g" isn't adjusted. 解决方案: Apply 'langmap' to the second character. (Alex Kapranoff) 相关文件: src/normal.c Patch 6.0.023 问题: Loading the lhaskell syntax doesn't work. (Thore B. Karlsen) 解决方案: Use ":runtime" instead of "source" to load haskell.vim. 相关文件: runtime/syntax/lhaskell.vim Patch 6.0.024 问题: Using "CTRL-V
u 9900" in Insert mode may cause a crash. (Noah Levitt) 解决方案: Don't insert a NUL byte in the text, use a newline. 相关文件: src/misc1.c Patch 6.0.025 问题: The pattern "\vx(.|$)" doesn't match "x" at the end of a line. (Preben Peppe Guldberg) 解决方案: Always see a "$" as end-of-line after "\v". Do the same for "^". 相关文件: src/regexp.c Patch 6.0.026 问题: GTK: When using arrow keys to navigate through the menus, the separators are selected. 解决方案: Set the separators "insensitive". (Pavel Kankovsky) 相关文件: src/gui_gtk.c, src/gui_gtk_x11.c Patch 6.0.027 问题: VMS: Printing doesn't work, the file is deleted too quickly. No longer need the VMS specific printing menu. gethostname() is not available with VAXC. The makefile was lacking selection of the tiny-huge feature set. 解决方案: Adjust the 'printexpr' option default. Fix the other problems and update the documentation. (Zoltan Arpadffy) 相关文件: runtime/doc/os_vms.txt, runtime/menu.vim, src/INSTALLvms.txt, src/Make_vms.mms, src/option.c, src/os_unix.c, src/os_vms_conf.h Patch 6.0.028 问题: Can't compile without +virtualedit and with +visualextra. (Geza Lakner) 解决方案: Add an #ifdef for +virtualedit. 相关文件: src/ops.c Patch 6.0.029 问题: When making a change in line 1, then in line 2 and then deleting line 1, undo info could be wrong. Only when the changes are undone at once. (Gerhard Hochholzer) 解决方案: When not saving a line for undo because it was already done before, remember for which entry the last line must be computed. Added ue_getbot_entry pointer for this. When the number of lines changes, adjust the position of newer undo entries. 相关文件: src/structs.h, src/undo.c Patch 6.0.030 问题: Using ":source! file" doesn't work inside a loop or after ":argdo". (Pavol Juhas) 解决方案: Execute the commands in the file right away, do not let the main loop do it. 相关文件: src/ex_cmds2.c, src/ex_docmd.c, src/getchar.c, src/globals.h, src/proto/ex_docmd.pro, src/proto/getchar.pro Patch 6.0.031 问题: Nextstep doesn't have setenv() or putenv(). (John Beppu) 解决方案: Move putenv() from pty.c to misc2.c 相关文件: src/misc2.c, src/pty.c Patch 6.0.032 问题: When changing a setting that affects all folds, they are not displayed immediately. 解决方案: Set the redraw flag in foldUpdateAll(). 相关文件: src/fold.c Patch 6.0.033 问题: Using 'wildmenu' on MS-Windows, file names that include a space are only displayed starting with that space. (Xie Yuheng) 解决方案: Don't recognize a backslash before a space as a path separator. 相关文件: src/screen.c Patch 6.0.034 问题: Calling searchpair() with three arguments could result in a crash or strange error message. (Kalle Bjorklid) 解决方案: Don't use the fifth argument when there is no fourth argument. 相关文件: src/eval.c Patch 6.0.035 问题: The menu item Edit/Global_Settings/Toggle_Toolbar doesn't work when 'ignorecase' is set. (Allen Castaban) 解决方案: Always match case when checking if a flag is already present in 'guioptions'. 相关文件: runtime/menu.vim Patch 6.0.036 问题: OS/2, MS-DOS and MS-Windows: Using a path that starts with a slash in 'tags' doesn't work as expected. (Mathias Koehrer) 解决方案: Only use the drive, not the whole path to the current directory. Also make it work for "c:dir/file". 相关文件: src/misc2.c Patch 6.0.037 问题: When the user has set "did_install_syntax_menu" to avoid the default Syntax menu it still appears. (Virgilio) 解决方案: Don't add the three default items when "did_install_syntax_menu" is set. 相关文件: runtime/menu.vim Patch 6.0.038 问题: When 'selection' is "exclusive", deleting a block of text at the end of a line can leave the cursor beyond the end of the line. 解决方案: Correct the cursor position. 相关文件: src/ops.c Patch 6.0.039 问题: "gP" leaves the cursor in the wrong position when 'virtualedit' is used. Using "c" in blockwise Visual mode leaves the cursor in a strange position. 解决方案: For "gP" reset the "coladd" field for the '] mark. For "c" leave the cursor on the last inserted character. 相关文件: src/ops.c Patch 6.0.040 问题: When 'fileencoding' is invalid and writing fails because of this, the original file is gone. (Eric Carlier) 解决方案: Restore the original file from the backup. 相关文件: src/fileio.c Patch 6.0.041 问题: Using ":language messages en" when LC_MESSAGES is undefined results in setting LC_CTYPE. (Eric Carlier) 解决方案: Set $LC_MESSAGES instead. 相关文件: src/ex_cmds2.c Patch 6.0.042 问题: ":mksession" can't handle file names with a space. 解决方案: Escape special characters in file names with a backslash. 相关文件: src/ex_docmd.c Patch 6.0.043 问题: Patch 6.0.041 was wrong. 解决方案: Use mch_getenv() instead of vim_getenv(). 相关文件: src/ex_cmds2.c Patch 6.0.044 问题: Using a "containedin" list for a syntax item doesn't work for an item that doesn't have a "contains" argument. Also, "containedin" doesn't ignore a transparent item. (Timo Frenay) 解决方案: When there is a "containedin" argument somewhere, always check for contained items. Don't check for the transparent item but the item it's contained in. 相关文件: src/structs.h, src/syntax.c Patch 6.0.045 问题: After creating a fold with a Visual selection, another window with the same buffer still has inverted text. (Sami Salonen) 解决方案: Redraw the inverted text. 相关文件: src/normal.c Patch 6.0.046 问题: When getrlimit() returns an 8 byte number the check for running out of stack may fail. (Anthony Meijer) 解决方案: Skip the stack check if the limit doesn't fit in a long. 相关文件: src/auto/configure, src/config.h.in, src/configure.in, src/os_unix.c Patch 6.0.047 问题: Using a regexp with "\(\)" inside a "\%[]" item causes a crash. (Samuel Lacas) 解决方案: Don't allow nested atoms inside "\%[]". 相关文件: src/regexp.c Patch 6.0.048 问题: Win32: In the console the mouse doesn't always work correctly. Sometimes after getting focus a mouse movement is interpreted like a button click. 解决方案: Use a different function to obtain the number of mouse buttons. Avoid recognizing a button press from undefined bits. (Vince Negri) 相关文件: src/os_win32.c Patch 6.0.049 问题: When using evim the intro screen is misleading. (Adrian Nagle) 解决方案: Mention whether 'insertmode' is set and the menus to be used. 相关文件: runtime/menu.vim, src/version.c Patch 6.0.050 问题: UTF-8: "viw" doesn't include non-ASCII characters before the cursor. (Bertilo Wennergren) 解决方案: Use dec_cursor() instead of decrementing the column number. 相关文件: src/search.c Patch 6.0.051 问题: UTF-8: UsingCTRL-R
on the command line doesn't insert composing characters. (Ron Aaron) 解决方案: Also include the composing characters and fix redrawing them. 相关文件: src/ex_getln.c, src/ops.c Patch 6.0.052 问题: The check for rlim_t in patch 6.0.046 does not work on some systems. (Zdenek Sekera) 解决方案: Also look in sys/resource.h for rlim_t. 相关文件: src/auto/configure, src/configure.in Patch 6.0.053 (extra) 问题: Various problems with QNX. 解决方案: Minor fix for configure. Switch on terminal clipboard support in main.c. Fix "pterm" mouse support. os_qnx.c didn't build without photon. (Julian Kinraid) 相关文件: src/auto/configure, src/configure.in, src/gui_photon.c, src/main.c, src/misc2.c, src/option.h, src/os_qnx.c, src/os_qnx.h, src/syntax.c Patch 6.0.054 问题: When using mswin.vim,CTRL-V
pastes a block of text like it is normal text. UsingCTRL-V
in blockwise Visual mode leaves "x" characters behind. 解决方案: MakeCTRL-V
work as it should. Do the same for the Paste menu entries. 相关文件: runtime/menu.vim, runtime/mswin.vim Patch 6.0.055 问题: GTK: The selection isn't copied the first time. 解决方案: Own the selection at the right moment. 相关文件: src/gui_gtk_x11.c Patch 6.0.056 问题: Using "CTRL-O
cw" in Insert mode results in a nested Insert mode.<Esc>
doesn't leave Insert mode then. 解决方案: Only use nested Insert mode when 'insertmode' is set or when a mapping is used. 相关文件: src/normal.c Patch 6.0.057 问题: Using ":wincmd g}" in a function doesn't work. (Gary Holloway) 解决方案: Execute the command directly, instead of putting it in the typeahead buffer. 相关文件: src/normal.c, src/proto/normal.pro, src/window.c Patch 6.0.058 问题: When a Cursorhold autocommand moved the cursor, the ruler wasn't updated. (Bohdan Vlasyuk) 解决方案: Update the ruler after executing the autocommands. 相关文件: src/gui.c Patch 6.0.059 问题: Highlighting for 'hlsearch' isn't visible in lines that are highlighted for diff highlighting. (Gary Holloway) 解决方案: Let 'hlsearch' highlighting overrule diff highlighting. 相关文件: src/screen.c Patch 6.0.060 问题: Motif: When the tooltip is to be popped up, Vim crashes. (Gary Holloway) 解决方案: Check for a NULL return value from gui_motif_fontset2fontlist(). 相关文件: src/gui_beval.c Patch 6.0.061 问题: The toolbar buttons to load and save a session do not correctly use v:this_session. 解决方案: Check for v:this_session to be empty instead of existing. 相关文件: runtime/menu.vim Patch 6.0.062 问题: Crash when 'verbose' is > 3 and using ":shell". (Yegappan Lakshmanan) 解决方案: Avoid giving a NULL pointer to printf(). Also output a newline and switch the cursor on. 相关文件: src/misc2.c Patch 6.0.063 问题: When 'cpoptions' includes "$", using "cw" to type a ')' on top of the "$" doesn't update syntax highlighting after it. 解决方案: Stop displaying the "$" when typing a ')' in its position. 相关文件: src/search.c Patch 6.0.064 (extra) 问题: The NSIS install script doesn't work with newer versions of NSIS. The diff feature doesn't work when there isn't a good diff.exe on the system. 解决方案: Replace the GetParentDir instruction by a user function. Fix a few cosmetic problems. Use defined constants for the version number, so that it's defined in one place only. Only accept the install directory when it ends in "vim". (Eduardo Fernandez) Add a diff.exe and use it from the default _vimrc. 相关文件: nsis/gvim.nsi, nsis/README.txt, src/dosinst.c Patch 6.0.065 问题: When using ":normal" in 'indentexpr' it may use redo characters before its argument. (Neil Bird) 解决方案: Save and restore the stuff buffer in ex_normal(). 相关文件: src/ex_docmd.c, src/getchar.c, src/globals.h, src/structs.h Patch 6.0.066 问题: Sometimes undo for one command is split into two undo actions. (Halim Salman) 解决方案: Don't set the undo-synced flag when reusing a line that was already saved for undo. 相关文件: src/undo.c Patch 6.0.067 问题: if_xcmdsrv.c doesn't compile on systems where fd_set isn't defined in the usual header file (e.g., AIX). (Mark Waggoner) 解决方案: Include sys/select.h in if_xcmdsrv.c for systems that have it. 相关文件: src/if_xcmdsrv.c Patch 6.0.068 问题: When formatting a Visually selected area with "gq" and the number of lines increases the last line may not be redrawn correctly. (Yegappan Lakshmanan) 解决方案: Correct the area to be redrawn for inserted/deleted lines. 相关文件: src/ops.c Patch 6.0.069 问题: Using "K" on a word that includes a "!" causes a "No previous command" error, because the "!" is expanded. (Craig Jeffries) 解决方案: Put a backslash before the "!". 相关文件: src/normal.c Patch 6.0.070 问题: Win32: The error message for a failed dynamic linking of a Perl, Ruby, Tcl and Python library is unclear about what went wrong. 解决方案: Give the name of the library or function that could not be loaded. Also for the iconv and gettext libraries when 'verbose' is set. 相关文件: src/eval.c, src/if_perl.xs, src/if_python.c, src/if_ruby.c, src/if_tcl.c, src/mbyte.c, src/os_win32.c, src/proto/if_perl.pro, src/proto/if_python.pro, src/proto/if_ruby.pro, src/proto/if_tcl.pro, src/proto/mbyte.pro Patch 6.0.071 问题: The "iris-ansi" builtin termcap isn't very good. 解决方案: Fix the wrong entries. (David Harrison) 相关文件: src/term.c Patch 6.0.072 问题: When 'lazyredraw' is set, a mapping that stops Visual mode, moves the cursor and starts Visual mode again causes a redraw problem. (Brian Silverman) 解决方案: Redraw both the old and the new Visual area when necessary. 相关文件: src/normal.c, src/screen.c Patch 6.0.073 (extra) 问题: DJGPP: When usingCTRL-Z
to start a shell, the prompt is halfway the text. (Volker Kiefel) 解决方案: Position the system cursor before starting the shell. 相关文件: src/os_msdos.c Patch 6.0.074 问题: When using "&" in a substitute string a multi-byte character with a trailbyte 0x5c is not handled correctly. 解决方案: Recognize multi-byte characters inside the "&" part. (Muraoka Taro) 相关文件: src/regexp.c Patch 6.0.075 问题: When closing a horizontally split window while 'eadirection' is "hor" another horizontally split window is still resized. (Aron Griffis) 解决方案: Only resize windows in the same top frame as the window that is split or closed. 相关文件: src/main.c, src/proto/window.pro, src/window.c Patch 6.0.076 问题: Warning for wrong pointer type when compiling. 解决方案: Use char instead of char_u pointer. 相关文件: src/version.c Patch 6.0.077 问题: Patch 6.0.075 was incomplete. 解决方案: Fix another call to win_equal(). 相关文件: src/option.c Patch 6.0.078 问题: Using "daw" at the end of a line on a single-character word didn't include the white space before it. At the end of the file it didn't work at all. (Gavin Sinclair) 解决方案: Include the white space before the word. 相关文件: src/search.c Patch 6.0.079 问题: When "W" is in 'cpoptions' and 'backupcopy' is "no" or "auto", can still overwrite a read-only file, because it's renamed. (Gary Holloway) 解决方案: Add a check for a read-only file before renaming the file to become the backup. 相关文件: src/fileio.c Patch 6.0.080 问题: When using a session file that has the same file in two windows, the fileinfo() call in do_ecmd() causes a scroll and a hit-enter prompt. (Robert Webb) 解决方案: Don't scroll this message when 'shortmess' contains 'O'. 相关文件: src/ex_cmds.c Patch 6.0.081 问题: After using ":saveas" the new buffer name is added to the Buffers menu with a wrong number. (Chauk-Mean Proum) 解决方案: Trigger BufFilePre and BufFilePost events for the renamed buffer and BufAdd for the old name (which is with a new buffer). 相关文件: src/ex_cmds.c Patch 6.0.082 问题: When swapping screens in an xterm and there is an (error) message from the vimrc script, the shell prompt is after the message. 解决方案: Output a newline when there was output on the alternate screen. Also when starting the GUI. 相关文件: src/main.c Patch 6.0.083 问题: GTK: When compiled without menu support the buttons in a dialog don't have any text. (Erik Edelmann) 解决方案: Add the text also when GTK_USE_ACCEL isn't defined. And define GTK_USE_ACCEL also when not using menus. 相关文件: src/gui_gtk.c Patch 6.0.084 问题: UTF-8: a "r" command with an argument that is a keymap for a character with a composing character can't be repeated with ".". (Raphael Finkel) 解决方案: Add the composing characters to the redo buffer. 相关文件: src/normal.c Patch 6.0.085 问题: When 'mousefocus' is set, using "s" to go to Insert mode and then moving the mouse pointer to another window stops Insert mode, while this doesn't happen with "a" or "i". (Robert Webb) 解决方案: Reset finish_op before calling edit(). 相关文件: src/normal.c Patch 6.0.086 问题: When using "gu" the message says "~ed". 解决方案: Make the message say "changed". 相关文件: src/ops.c Patch 6.0.087 (lang) 问题: Message translations are incorrect, which may cause a crash. (Peter Figura) The Turkish translations needed more work and the maintainer didn't have time. 解决方案: Fix order of printf arguments. Remove %2$d constructs. Add "-v" to msgfmt to get a warning for wrong translations. Don't install the Turkish translations for now. Update a few more translations. 相关文件: src/po/Makefile, src/po/af.po, src/po/cs.po, src/po/cs.cp1250.po, src/po/de.po, src/po/es.po, src/po/fr.po, src/po/it.po, src/po/ja.po, src/po/ja.sjis.po, src/po/ko.po, src/po/pl.po, src/po/sk.po, src/po/uk.po, src/po/zh_CN.UTF-8.po, src/po/zh_CN.cp936.po, src/po/zh_CN.po, src/po/zh_TW.po Patch 6.0.088 问题: "." doesn't work after using "rx" in Visual mode. (Charles Campbell) 解决方案: Also store the replacement character in the redo buffer. 相关文件: src/normal.c Patch 6.0.089 问题: In a C file, using "==" to align a line starting with "* " after a line with "* -" indents one space too few. (Piet Delport) 解决方案: Align with the previous line if the comment-start-string matches there. 相关文件: src/misc1.c Patch 6.0.090 问题: When a wrapping line does not fit in a window and 'scrolloff' is bigger than half the window height, moving the cursor left or right causes the screen to flash badly. (Lubomir Host) 解决方案: When there is not enough room to show 'scrolloff' screen lines and near the end of the line, show the end of the line. 相关文件: src/move.c Patch 6.0.091 问题: UsingCTRL-O
in Insert mode, while 'virtualedit' is "all" and the cursor is after the end-of-line, moves the cursor left. (Yegappan Lakshmanan) 解决方案: Keep the cursor in the same position. 相关文件: src/edit.c Patch 6.0.092 问题: The explorer plugin doesn't ignore case of 'suffixes' on MS-Windows. (Mike Williams) 解决方案: Match or ignore case as appropriate for the OS. 相关文件: runtime/plugin/explorer.vim Patch 6.0.093 问题: When the Tcl library couldn't be loaded dynamically, get an error message when closing a buffer or window. (Muraoka Taro) 解决方案: Only free structures if already using the Tcl interpreter. 相关文件: src/if_tcl.c Patch 6.0.094 问题: Athena: When clicking in the horizontal scrollbar Vim crashes. (Paul Ackersviller) 解决方案: Use the thumb size instead of the window pointer of the scrollbar (which is NULL). (David Harrison) Also avoid that scrolling goes the wrong way in a narrow window. 相关文件: src/gui_athena.c Patch 6.0.095 问题: Perl: Deleting lines may leave the cursor beyond the end of the file. 解决方案: Check the cursor position after deleting a line. (Serguei) 相关文件: src/if_perl.xs Patch 6.0.096 问题: When ":saveas fname" fails because the file already exists, the file name is changed anyway and a following ":w" will overwrite the file. (Eric Carlier) 解决方案: Don't change the file name if the file already exists. 相关文件: src/ex_cmds.c Patch 6.0.097 问题: Re-indenting in Insert mode withCTRL-F