In Vim what command will put the cursor at the last character in a file, not the last line?

0

I realize that G will move the cursor to the last line in a file, but is there a command that will move to the last character?
I know I can type G$ to do this but I thought there might be a single command which does this.

dedwarmo

Posted 2013-02-10T16:52:02.120

Reputation: 43

Answers

1

This has been asked before, and no single-keypress command was listed, though you might prefer Ctrl-End to G$:

https://unix.stackexchange.com/questions/30761/how-to-move-to-last-character-of-the-file-in-vim

Croad Langshan

Posted 2013-02-10T16:52:02.120

Reputation: 818

Ah. I searched SuperUser but I didn't search Unix and Linux. Thanks. I guess I should always start my searches at StackExchange.com. There are so many StackExchange sites you never know where an answer might pop up. – dedwarmo – 2013-02-11T18:15:26.093

0

There is indeed a command, the obscure go (go to {count} byte), but you have to specify a count >= the file size (e.g. 99999go), which makes it kinda impractical.

Ingo Karkat

Posted 2013-02-10T16:52:02.120

Reputation: 19 513