title: Using tags in Vim
body: <p>I know that Vim has sophisticated support for tags but I am struggling to get them to work with JavaScript and TCL.</p>
  
  <p>I am using Vim 7.2.330 under Ubuntu Lucid, a standard Vim install and standard Exuberant CTags install.</p>
  
  <p>I wish to keep my tags in a file called <code>~/.vimtags/tags</code></p>
  
  <p>I have included the tags file in my vimrc file <code>set tags+=$HOME."/vimtags/tags"</code>.</p>
  
  <p>I have run the following command from the base code directory:</p>
  
  <pre><code>ctags-exuberant -f ~/.vimtags/tags -h ".js" --totals=yes --tag-relative=yes --fields=+akst -R
  </code></pre>
  
  <p>I also have the following in my <code>.ctags</code> file - I saw an article somewhere online that said you should add these to make it compatible with modern JavaScript.</p>
  
  <pre><code>--langdef=js
  --langmap=js:.js
  --regex-js=/([A-Za-z0-9._$]+)[ \t]*[:=][ \t]*\{/\1/,object/
  --regex-js=/([A-Za-z0-9._$()]+)[ \t]*[:=][ \t]*function[ \t]*\(/\1/,function/
  --regex-js=/function[ \t]+([A-Za-z0-9._$]+)[ \t]*\(([^)])\)/\1/,function/
  --regex-js=/([A-Za-z0-9._$]+)[ \t]*[:=][ \t]*\[/\1/,array/
  --regex-js=/([^= ]+)[ \t]*=[ \t]*[^"]'[^']*/\1/,string/
  --regex-js=/([^= ]+)[ \t]*=[ \t]*[^']"[^"]*/\1/,string/
  </code></pre>
  
  <p>When I load up Vim, the tags file definitely gets loaded.  A <code>set tags?</code> shows that the tag file has been included.</p>
  
  <p>However, whenever I <code>CTRL-]</code> over a keyword, it always says that there are no tags.</p>
  
  <p>Please could you share how you set up Vim tags with JavaScript, and also show how you use the tag system? It seems to be a great feature of Vim, if only I could get it working.</p>