Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

in vim, with

:jumps

I see the jumplist, with G I go to the end of jumplist.

How I can go the end of list with a map ? I think in some like this

nn <leader>j :jumps<CR>G

but this, show the jumplist and go to the end of original file

share|improve this question

2 Answers 2

up vote 0 down vote accepted

The “more prompt” is not subject to mappings. From :help more-prompt:

Note: The typed key is directly obtained from the terminal, it is not mapped and typeahead is ignored.

You can define a mapping to reset the more option just before executing :jumps (and restore it afterwards) like this (in your .vimrc):

map <Leader>j :
            \let prevmore=&more<Bar>
            \set nomore<Bar>
            \jumps<Bar>
            \let &more=prevmore<CR>

When you use this \j mapping (Leader is backslash by default, see :help mapleader), Vim will display the whole jump list without any pauses until it gets to the end (effectively, you will see the last “page” of the output).

Note that <Leader>, and mapleader have nothing to do with the backslashes used above; those are line continuations for :sourced files (like .vimrc).

share|improve this answer
    
nn <silent><leader>j :setl more!<bar>jumps<bar>setl more! –  juanpablo Oct 30 '11 at 14:41
    
@juanpablo: There is no need for setl since more is a global-only option. Watch out if you ever set nomore outside of the mapping though — your double-toggle approach would then end up giving you the opposite of what you want for the jumps command (more set when jumps is run). –  Chris Johnsen Oct 31 '11 at 1:45

Vim help documentation says the jump list is fixed to a maximum of 100 entries, and you can use a count with CTRL-I (prev) and CTRL-O (next) ... so the obvious way to "go to end" of the jumplist would be:

100<C-O>

This would perform what you're looking for. Put it in a mapping or whatever you desire.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.