Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sorting from current point to end of file in gvim?

Tags:

vim

The following in command mode (gvim)

:.,G!sort 

results in

E464: Ambiguous use of user defined-command

:help E464
  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

I have stared at this for a little while can someone throw a bone my way or offer a way to do this without resorting to visual mode?

like image 706
ojblass Avatar asked Dec 04 '22 15:12

ojblass


1 Answers

I usually use :.,$!sort; does that work for you?

Original Poster Edit

G is not the proper range specification. From the :help range output see below.

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.
like image 174
Chris Jester-Young Avatar answered Mar 04 '23 22:03

Chris Jester-Young