On 04/13/2011 04:27 PM, Scottb wrote:
The reference "19 0 R" points to a PDF object declaration somewhere in
the file like "19 0 obj". So, right now (thanks to your help) I can
put my cursor over the "19" in the /Outlines reference value, hit F4
and navigate directly to the "19 0 obj". Now... it would be even
better if I didn't have to put the cursor on the id number itself,
just the line it's on. I suppose that would mean navigating to the
first reference ("\d+\s\d+\sR") and then executing the object search
which you just provided.
If you want an example of this sort of text, just open any PDF file in
Vim and look for "/Outlines" or "/Catalog".
Sounds like something like
:nnoremap <f4> :nnoremap <f4> /^<c-r>=matchstr(getline('.'),
'\d\+')<cr>\s\+\d\+\s\+obj<cr>
would do the trick. That picks out the first digits, so if you
have something like
/Foo42Bar 19 0 R
you'd have to tweak it to
:nnoremap <f4> /^<c-r>=matchstr(getline('.'),
'\d\+\ze\s\+\d\+\s\+R')<cr>\s\+\d\+\s\+obj<cr>
to get the "19" instead of the "42".
-tim
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php