Wiki

by yszheda

View project onGitHub

Tip 99: Collect TODO Items in a Register

Return to the top: <<Practical Vim>>

  • view all the TODO items at a glance:
    :g/TODO
    
  • yank each line containing the word "TODO" into register a:
    • clear register a by qaq, check the content by :reg a
    • :g/TODO/yank A
      • uppercase means appending to the specified register.
      • lowercase means overwriting the register's content.

Discussion

Copy all the TODO items to the end of the file:

:g/TODO/t$