TransWikia.com

Is there an equivalent to Xcode's quick jump bar (to navigate Swift MARK annotations within a file)?

Vi and Vim Asked by aehlke on October 28, 2020

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.

One Answer

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>:

Answered by D. Ben Knoble on October 28, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP