我正在尝试了解 vim 上的更改列表,但无法理解以下行为:
例如,我插入以下文本:
I like chips and fish.
意识到我的名词顺序错误,所以我想得到:
I like fish and chips.
从没有 .vimrc ( vim -u NONE
) 的新 vim 实例开始,这正是我所做的(# 仅用于解释):
iI like chips and fish.<Esc> # Insert text. Realize I want to switch the words
Fc # Jump back to 'chips'
de # Delete the word (and put it in anon register)
ff # Jump to the 'fish' word
vep # Select the word, and paste from anon register
g; # Try to jump back to the position where I change
# the word 'chips'. It doesn't work and I get:
E19: Mark has invalid line number
# To see what is going on i print the change list:
:changes
change line col text
2 1 12 I like and chips.
1 2 12 -invalid-
>
我的第一个问题是为什么跳跃一开始就不起作用?
其次,-invalid-
更改列表的条目对我来说没有任何意义。如您所见,我从未超出第 1 行。为什么第 2 行有一个条目?
我正在使用 Vim 7.4.52
更新: -invalid- 似乎是一个错误。我已经举报了: