I am new to Vim. My code file has 300 lines. Suppose currently the cursor is on line 254, and I used gg command the cursor turn to line 1. I want to go back to line 254 but I forget that line number. Is there a command the can do this?
How do I get back to the previous line after moving?
cursor movement
Use `` to jump back to the exact position you were in before you searched/jumped, or '' to jump back to the start of the line you were on before you searched/jumped.You can also use CTRL+O and CTRL+I for jumping back and forward.See also:In vim, how do I go back to where I was before a search?Move cursor to its last position