Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VIM: how to jump the cursor to its previous location?

902 views
Skip to first unread message

Sang-Ho Yun

unread,
Jan 23, 2009, 2:29:01 PM1/23/09
to
Is there an easy way to jump the cursor to its previous location?

I just learned that "gd" conveniently jump the cursor to the declaration of
the variable over which the cursor is currently located. However, I found
that it takes a bit of an effort to come back to where I used to be. It'd
be nice if I could jump "back".

Thank you,
Sang-Ho

Ben C

unread,
Jan 23, 2009, 3:36:19 PM1/23/09
to
On 2009-01-23, Sang-Ho Yun <Sang-...@jpl.nasa.gov> wrote:
> Is there an easy way to jump the cursor to its previous location?

Ctrl-O, then Ctrl-I to come back

Mark

unread,
Jan 23, 2009, 5:16:08 PM1/23/09
to
On Fri, 23 Jan 2009 11:29:01 -0800, Sang-Ho Yun wrote:
> Is there an easy way to jump the cursor to its previous location?

'' returns you to the position before the latest jump. This is standard
vi, not just vim.

Kaz Kylheku

unread,
Jan 23, 2009, 6:15:30 PM1/23/09
to
On 2009-01-23, Sang-Ho Yun <Sang-...@jpl.nasa.gov> wrote:
> Is there an easy way to jump the cursor to its previous location?

There are two related methods the double backtick `` and the double tick ''.

The double tick is line oriented. The backtick jumps to the line and exact
column where you were.

Also, use marks. Marks are named by letters. For instance typing ma remembers
the current location under mark a. To jump to the line containing mark a,
type 'a. To the exact location use `a.

Lower-case-letter marks are per-file. Upper-case-letter marks are global;
`A will switch to the file containing mark A, to the exact location.

0 new messages