2 ms·
My .vimrc is the following: <quote>set number</quote> Which shows the line number no matter what in a vi editor. Jumping to a loop on the screen is as easy as
by tmarthal 14y ago
My .vimrc is the following:
<quote>set number</quote>
Which shows the line number no matter what in a vi editor.
Jumping to a loop on the screen is as easy as viewing the line the loop is on, then hitting colon+line number (e.g. ":68"). This might be what you're referring to with a "hard jump".
I also use the "number+command" shortcuts quite a bit. If you want to jump up/down 20 lines (or 2000), then "2000k" or "2000j" will move the cursor up 2000 lines or down 2000 lines. Also a hard jump.
But to find an occurrence of a word at the end of the file, the typical search sequence is the following:
1) :$ - this jumps to the end of the file ($ is a common regex meaning 'end of', the same way that '^' means beginning of)
2) ?word - this does a backwards search for the word. this is at the bottom of the file, searching upwards
3) n - this jumps to the next occurrence of the word
So thats like 5 keystrokes not including typing in the word. Jumping around and viewing files really is neat with vi/vim.