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