以下命令模式(gvim)
:.,G!sort
Run Code Online (Sandbox Code Playgroud)
结果是
E464: Ambiguous use of user defined-command
:help E464
Run Code Online (Sandbox Code Playgroud)
Ambiguous use of user-defined command
There are two user-defined commands with a common name prefix, and you used
Command-line completion to execute one of them. |user-cmd-ambiguous|
Example: >
:command MyCommand1 echo "one"
:command MyCommand2 echo "two"
:MyCommand
Not an editor command
我已经盯着这一段时间了,有人可以用我的方式扔骨头或提供一种方法来做到这一点而不诉诸视觉模式?
Chr*_*ung 11
我经常使用:.,$!sort; 那对你有用吗?
原始海报编辑
G不是适当的范围规格.从:帮助范围输出见下文.
Line numbers may be specified with: *:range* *E14* *{address}*
{number} an absolute line number
. the current line *:.*
$ the last line in the file *:$*
% equal to 1,$ (the entire file) *:%*
't position of mark t (lowercase) *:'*
'T position of mark T (uppercase); when the mark is in
another file it cannot be used in a range
/{pattern}[/] the next line where {pattern} matches *:/*
?{pattern}[?] the previous line where {pattern} matches *:?*
\/ the next line where the previously used search
pattern matches
\? the previous line where the previously used search
pattern matches
\& the next line where the previously used substitute
pattern matches
Each may be followed (several times) by '+' or '-' and an optional number.
This number is added or subtracted from the preceding line number. If the
number is omitted, 1 is used.