1

I have the habit of leaving comments in my C source files like // @TODO or // @CHECK to quickly be able to get back to where I may have things to do. I can already match those in pretty much any language with vimgrep and get them in the quickfix list.

However, they're all a bit different and/or anywhere in a particular line: some are TODOs, some are CHECKs, and others may anything else. The quickfix list unfortunately lists them in no useful order, and to get the "type" (the few capital letters after the @) I sometimes have to look at all the line if the pattern is near the end.

What I'd like to do is "add a column" to the quickfix list that displays that "type" (so, for @CHECK it would be CHECK, and so on), and to be able to filter this to keep only one "type" (so maybe keep only FIXME or only TODO). If possible, I'd also like to sort this list alphabetically according to the type.

I have dug a bit, and it seems it may not be possible with the quickfix list, but I don't really know that many plugins. It also seems to be a use case for tags, but likewise, I don't really know how I could generate and update a list of those particular tags and add a column to the quickfix to show the "tag name".

Would I need a plugin to do this ? Could you point me to a particular one, maybe with a few configuration tips ?

Many thanks in advance !

  • I am not sure the quicklist can be changed, but would a command allowing you to search to a specific pattern (or by default to all of them) fit your need? – padawin May 13 at 14:16
  • In fact, I already have that. The current command I use is vimgrep #@\u\+#j **, which seems to do the trick for now. I guess I can write a function that searches for only one type is easy enough to do, too. The main problem here is just convenience ^^ I'd really like to find out how to get more customizable lists. – FlatBartender May 13 at 14:20
  • I understand. I would have had a function and handful of mappings to help, but it would be solving the part you know how to do, not to actually change the list (or its format) :-/ – padawin May 13 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.