Anton Sharonov wrote:
> jan wrote:
>> Hello,
>>
>> I am taking lengthy notes on something. I want to write a table of contents
>> to
>> find my way around these notes. I want to jump to a specified place in the
>> notes-file from this TOC.
>>
>> Do I have to create a custom tagfile?
>> Are there better ways to achieve this?
>>
>> Pointers to relevant help-sections are very welcome.
>
> For making my own notes I just use existing VIM help facilities,
> like this
Anton,
If you want to use the Vim help file syntax, but don't want to keep your
generic notes in a Vim doc directory, here's a possible strategy that
uses ctags...
--- command to build tags file ---
# The following command builds tags for all 'mynotes'
# files (*.not) in the current directory recursively.
# The tags are specified just like the tags in a Vim
# help file.
# Note: You can use --language-force=mynotes instead
# of --langmap=mynotes:.not if you don't want to
# require a specific extension for the notes files.
ctags -R --langdef=mynotes \
--langmap=mynotes:.not \
--regex-mynotes=/\*([!-)+-{}-~]+)\*/\1/
--- sample *.not file containing tagged notes ---
========TOC========
|some-tag|
|some-other-tag|
|and-one-final-tag|
===================
*some-tag*
Here's some text.
*some-other-tag*
Here's some more text.
*and-one-final-tag*
And the final block of text.
vim:isk=!-~,^*,^\|,^\"
---
Note that the 'iskeyword' option setting in the modeline above matches
the regex in the ctags command line, and both are close to the value
used in Vim help files. You can tweak it however you like...
Hope it helps...
Brett Stahlman
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---