I've been using the notes.vim plugin to manage my notes, and I've been tagging them by making the second line in the text file have a list of tags prefixed with the @ symbol. One of my note files looks like this:

Freud

@psychology @psychologists @people

Freud was one of the first psychoanalyists... Lorem ipsum

Where the first line is the title (automatically renames the text file in notes.vim) and the second line is a list of tags.

How can I automatically generate lists of files that contain these tags? I want to, say, find a list of files that contain @psychology. I've read a little bit about ctags and exuberant ctags, but as a non-programmer I don't really understand what any of it means, or how to tell vim where my tags are.

link|improve this question

78% accept rate
feedback

1 Answer

up vote 1 down vote accepted

Ok, I think I figured it out. I added a mapping to run a vimgrep on all files in my notes directory and subdirectories, according to this article: http://vim.wikia.com/wiki/Find_in_files_within_Vim

map <F4> :execute "vimgrep /" . expand("<cword>") . "/j **" <Bar> cw<CR>

So now I just position my cursor above a tag and press F4 to get a list of other files that contain this tag. Not bad.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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