时不时地,我会有一些字符留在缓冲区中,而它们应该消失,因为它们已从文件中删除。 Vim 编辑器和它正在读取的文件之间似乎缺乏同步性。例如,我试图写“位置”这个词,但写错了,而是写了“位置”。我回到第一个“a”并错误地删除了两个“a”。结果,单词末尾的旧“n”保留在先前的位置,而新的“n”则去了它应该在的位置(即“位置 n”)。这种情况发生在各种文件中,其中一个是 .md。当我在浏览器中阅读该文件时,没有额外的
n
。
这只发生在 Vim 中;当我使用 NeoVim 时一切正常。不过我必须使用 Vim,因为 NeoVim 中不存在一些重要的插件......
我尝试更改颜色方案并更改为 Vim 的默认值之一,但我仍然遇到相同的错误。我在谷歌上搜索了解决方案,但没有成功,因为我真的不知道如何表述问题......
编辑:根据要求,以下是
:version
的输出。
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Sep 30 2023 05:45:56)
macOS version - arm64
Included patches: 1-1894
Compiled by [email protected]
Normal version without GUI. Features included (+) or not (-):
+acl +file_in_path +mouse_urxvt -tag_any_white
-arabic +find_in_path +mouse_xterm -tcl
+autocmd +float +multi_byte +termguicolors
+autochdir +folding +multi_lang +terminal
-autoservername -footer -mzscheme +terminfo
-balloon_eval +fork() +netbeans_intg +termresponse
-balloon_eval_term -gettext +num64 +textobjects
-browse -hangul_input +packages +textprop
++builtin_terms +iconv +path_extra +timers
+byte_offset +insert_expand -perl +title
+channel +ipv6 +persistent_undo -toolbar
+cindent +job +popupwin +user_commands
-clientserver +jumplist +postscript -vartabs
+clipboard -keymap +printer +vertsplit
+cmdline_compl +lambda -profile +vim9script
+cmdline_hist -langmap -python +viminfo
+cmdline_info +libcall -python3 +virtualedit
+comments +linebreak +quickfix +visual
-- More --
我无法重现这种行为。也许你可以在命令模式或正常模式下执行 :redraw 。