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 enjoy using CTags to quickly jump to a file and back using CTRL-] and CTRL-T. I would like to have something similar when editing DokuWiki files. In other words I have something like this in file 'start.txt':

[[link]]

I would like to jump to 'link.txt' within the same directory as 'start.txt'.

My thought was to use to 'goto file' feature, but it would require an implicit file extension and base path. Ideally, I would like to use the 'tag' functionality in Vim referenced here: http://vim.wikia.com/wiki/Browsing_programs_with_tags

Does anyone know of a way to do this or a utility that will create the required tag file?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

My thought was to use to 'goto file' feature, but it would require an implicit file extension and base path.

Vim handles all of this:

:setlocal path=.
:setlocal suffixesadd=.txt

(Best put these commands into a ~/.vim/ftplugin/DocuWiki.vim script.)

Alternatively, you need a way to generate a tags database for source code. The format is simple, see :help tags-file-format. The default tags program, Exuberant Ctags can be extended with regular expressions (--langmap, --regex), that only yields an approximate parsing for complex languages, but should suffice to parse out the DokuWiki links.

share|improve this answer
    
This is exactly what I wanted. Thank you. –  Daeden Sep 10 '13 at 20:11
add comment

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.