Question

Oddly enough(and several hours later), I still feel this should work.

I am using ctags. The src directory also contain some .txt or .md files. I would like to get the todo,note,etc tags and view them in quickfix, or write to file.

relevant part from my .ctags file: `

"--langdef=text
"--langmap=text:.txt
--regex-txt=/#TODO(.*)todo\1/
... 
--regex-markdown=/#TODO(.*)todo\1/

`

I do not want to just generate my own tags file, because it is mixed with src that gets its own tags file from ctags. ( Also for future use, Id like to just be able to search from multiple files, or hardware(tablet, phone), and get all TODO tags from a vim server... )

Anyhow, how do I langdef for text and mardown?

Thankyou.

Was it helpful?

Solution

You probably want vimgrep for this particular use case. For example, opening vim in your source directory and entering :vimgrep /^#TODO/i *.txt *.md will populate the quickfix list with all the lines in text and markdown files which begin with #TODO. You can then use :cnext and :cprev to jump around the files.

Look at :help vimgrep and :help :filename for more information on vimgrep and the {file} argument respectively. You can expand the regex to match more tags (e.g. note) or use :w in your quickfix window to save the file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top