• Trivial question about the vi(m) command line.

    From gazelle@gazelle@shell.xmission.com (Kenny McCormack) to comp.editors on Sun Apr 5 13:43:50 2026
    From Newsgroup: comp.editors

    What is the best command line way to tell Vim to put the cursor on the last line for editing?

    I ended up with: vi -c '$' myLargeFile.txt

    which of course works fine. But I thought there was a dedicated command
    for this. In less, you can use "+G", but that doesn't seem to work with
    vi(m), which surprised me.
    --
    The randomly chosen signature file that would have appeared here is more than 4 lines long. As such, it violates one or more Usenet RFCs. In order to remain in compliance with said RFCs, the actual sig can be found at the following URL:
    http://user.xmission.com/~gazelle/Sigs/Seneca
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Eli the Bearded@*@eli.users.panix.com to comp.editors on Sun Apr 5 17:48:36 2026
    From Newsgroup: comp.editors

    In comp.editors, Kenny McCormack <gazelle@shell.xmission.com> wrote:
    What is the best command line way to tell Vim to put the cursor on the last line for editing?

    I ended up with: vi -c '$' myLargeFile.txt

    The -c commands operate in ex mode, so $ is the correct answer.

    which of course works fine. But I thought there was a dedicated command
    for this. In less, you can use "+G", but that doesn't seem to work with vi(m), which surprised me.

    In vi mode, you can use G to go to the end of the file, and <num>G to go
    to a particular line number. If you have vim, vi mode is also called
    "normal" mode and this works:

    vim -c 'normal G' myLargeFile.txt

    I pretty much only use "normal" for g// operations, like say increase
    the number in column three (tab separated) by two on lines matching foobar:

    :g/foobar/ normal 02f^V^I2^V^A

    where ^V^I is typed ctrl-V <tab>, for an escaped tab character, and ^V^A
    is typed ctrl-V ctrl-A, for an escaped control-A.

    Elijah
    ------
    and use ":set nrformats=" (empty value) for normal number handling
    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From Janis Papanagnou@janis_papanagnou+ng@hotmail.com to comp.editors on Mon Apr 6 16:18:46 2026
    From Newsgroup: comp.editors

    On 2026-04-05 15:43, Kenny McCormack wrote:
    What is the best command line way to tell Vim to put the cursor on the last line for editing?

    I ended up with: vi -c '$' myLargeFile.txt

    which of course works fine. But I thought there was a dedicated command
    for this. In less, you can use "+G", but that doesn't seem to work with vi(m), which surprised me.

    I just tried out omitting the line number and simply write

    vim + myLargeFile.txt (instead of +N)

    which places the cursor in the last line (similar to 'G' in
    command mode).

    Janis

    --- Synchronet 3.21f-Linux NewsLink 1.2
  • From gazelle@gazelle@shell.xmission.com (Kenny McCormack) to comp.editors on Mon Apr 6 15:11:12 2026
    From Newsgroup: comp.editors

    In article <10r0fc6$in2n$1@dont-email.me>,
    Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
    On 2026-04-05 15:43, Kenny McCormack wrote:
    What is the best command line way to tell Vim to put the cursor on the last >> line for editing?

    I ended up with: vi -c '$' myLargeFile.txt

    which of course works fine. But I thought there was a dedicated command
    for this. In less, you can use "+G", but that doesn't seem to work with
    vi(m), which surprised me.

    I just tried out omitting the line number and simply write

    vim + myLargeFile.txt (instead of +N)

    which places the cursor in the last line (similar to 'G' in
    command mode).

    Yup! That's what I was looking for.
    --
    Religion is what keeps the poor from murdering the rich.

    - Napoleon Bonaparte -

    --- Synchronet 3.21f-Linux NewsLink 1.2