Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using vi as a note-taking and outlining tool. I am constructing the "tags" file by myself. What I would like to do is that when I open my notes or outline file, vi reads the tags present in this file, highlights them and also displays the tag labels in a vertical preview window. I have no experience in vim scripting so I would appreciate some help.

Currently I am using a bash script to generate a tag labels file "taglabels" in $PWD using cut and loading it in a separate vertical window

My script looks like this

#! /bin/bash

cut -f1 $PWD/tags > $PWD/taglabels
vi -c ":30vsp $PWD/taglabels" $1

As is obvious, the script does not highlight the tags present in the file nor does it it show only the tags present in the file. On the contrary it shows all the tags present in $PWD/tags

I looked into ctags and the taglist plugin but they seem to be more suited for code than for free form text.

share|improve this question
Is there a reason why you are not using vim and the outline facilities a plugin provides? – Sardathrion Sep 14 '11 at 7:09
@Sardathrion -- I have been trying to look for such a plugin for some time now!! I took a look at taglist.vim but it seems to need exuberant ctags which suggests to me that it would not be suitable for my purpose, since I am tagging free-form text. I did try to use it anyways but it did not work (it only opened the side pane with an error message and no tags from the tags file in the current working directory). – latexnewbie Sep 18 '11 at 5:37
Ah, sorry it did not work. – Sardathrion Sep 19 '11 at 7:34

If your tags file is in proper tags database format (like generated by ctags), there are some plugins that offer tag highlighting:

However, both assume tags generation by ctags. Maybe you can turn off that part or extract the highlighting part.

share|improve this answer

Your Answer


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.