Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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