help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: vim's jumplist equivalent in emacs?


From: Drew Adams
Subject: RE: vim's jumplist equivalent in emacs?
Date: Sat, 16 Dec 2006 18:17:05 -0800

> In vim, some kind of user actions like text search, tag search or
> opening new file are regarded as 'jump action'. Every position, whether
> it's in one buffer or in another,  before/after those jumps are
> automatically recorded in 'jump list', so you can navigate
> forward/backward the postions using Ctrl+O / Ctrl+I. May I find a
> similar job done for emacs?

> doremi is helpful to me. Thank you.

> doremi-cmd is close to what I wanted though it is not the 'global list'
> that I mentioned above. Thank you.

Actually, there are two commands in doremi-cmd.el that could help, and one
is global: `doremi-marks' lets you cycle among marks in a buffer.
`doremi-global-marks' lets you cycle among global marks in multiple buffers.
Emacs has a ring of marks for each buffer, as well as a global ring of marks
that goes across all buffers. These two commands reflect that.

In addition, you might want to try Icicles. Commands `icicle-goto-marker'
and `icicle-goto-global-marker' let you navigate among the two kinds of
marks using completion, as well as by cycling. The completion is based on
the text of the line the mark is in (or "<EMPTY LINE>" if the line is
empty). IOW, in buffer *Completions*, you can "see" all of the marks that
are in lines that match your minibuffer input. You can use normal prefix
matching or regexp (e.g. substring) matching. When your input is empty, you
see the lines of all marks as navigation candidates. Typing filters the list
of candidates incrementally, so they always match your input.

`icicle-goto-marker' and `icicle-goto-global-marker' are multi-commands: You
can use `C-RET', `C-down', `C-next', and `C-mouse-2' to move around among
selected marks, before deciding on a final destination with `RET'. Just
repeating `C-down' is equivalent to what the doremi mark commands do by
repeating `down' - the Icicles commands offer quite a bit more flexibility.

These two Icicles commands are in fact specific applications of the generic
function (and command) `icicle-map'. That is, they are defined by using
`icicle-map' to apply a simple go-to function to mark-ring candidates.
`icicle-map' lets you apply any function to association-list entries in a
selective, interactive fashion. The alist keys are used as the completion
candidates, and choosing a candidate applies the function to that alist
entry (key + value).

When you use command `icicle-map' interactively, it prompts you for the
names of 1) a variable that has an alist value and 2) a function - you can
use completion for each name. In Emacs, there are many alist variables; by
default, they constitute the completion candidates for #1.

Icicles is here: http://www.emacswiki.org/cgi-bin/wiki/Icicles. HTH.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]