Hacker News new | ask | show | jobs
by syrrim 2849 days ago
:g/^#/p

for markdown at least.

1 comments

If you put a #after the p you'll get the line numbers of the instances too, and you can jump to them with :num.

So for LaTeX if I do...

    :g/^\\\(sub\)*section/p#
I get...

     35 \section{Introduction}
     37 \section{Setup}
     39 \subsection{CSS Setup}
     66 \subsection{JS Setup}
     74 \subsection{HTML Setup}
     92 \subsection{React setup}
    113 \section{Components}
    261 \subsection{Card Box}
    541 \section{Old Chunks}
    562 \section{Index}
    566 \section{Code Chunks}
and...

    :92
Takes me to the React Setup subsection.