0

vim screenshot of swift pragma marks

Does a rough equivalent to this Xcode quick jump bar feature exist as a Vim plugin? I haven't been able to find any good leads on one in my research.

It's a way to navigate sections in a file - in the case of Swift, the // MARK: sections annotated like this.

1 Answer 1

1

You could search /MARK and then hit n, but faster and easier in my opinion is

global/MARK/list

And then you type : and the line number when you get the list of results.

The command can be shortened to :g/MARK/#, if you like, or mapped to a keysequence to make it even faster:

nnoremap <leader>m :global/MARK/#<CR>:
2
  • Thanks, /list is news to me!
    – aehlke
    Commented Jul 29, 2020 at 1:07
  • 1
    @aehlke the command is actually :list if you want to read the help :) you’re welcome.
    – D. Ben Knoble
    Commented Jul 29, 2020 at 2:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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