Anton Sharonov wrote:
> Brett Stahlman wrote:
>> 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...
>
> Thanks, Brett - I will keep solution with ctags in mind for the
> case if I will not be happy with built-in :helptags command in
> some future.
No problem. In case you ever decide to go this route, here are a few
things you should probably be aware of, which I neglected to mention in
my original post...
To get Vim help file syntax highlighting in your notes files, you would
need simply to set ft=help. You could do this either in a modeline, or
using autocommands based upon the file extension. If you want additional
highlighting capabilities, beyond those provided by Vim's help syntax,
you can set 'filetype' to a dot-separated list of filetypes. For example...
ft=help.txtfmt
...would allow you to create rich text style highlighting regions to
complement the fixed-format Vim help markup regions.
http://www.vim.org/scripts/script.php?script_id=2208
Another point to note is that your notes files can be located anywhere
(recursively) within a directory structure, which may contain other
types of files (e.g,. source files), which will also be processed by
ctags according to their own language definitions. So, for example, you
could keep notes files documenting a large C/C++ project within the
subdirectories containing the source files they document.
Finally, note that you don't give up any search capabilities, as Vim
provides many useful mappings and commands for working with tags: e.g.,
CTRL-], CTRL-T, :ta, :ts, etc... Tag completion (e.g., <Tab>, <CTRL-D>,
etc...) and the ability to specify tags as regexes ensure that you don't
have to know the full name of the tag you're trying to find. Of course,
Vim's builtin :help command provides this as well, but as you pointed
out, your tags are added to the global Vim help "namespace", so you may
find yourself adding unnecessary prefixes to your tags names, not to
mention searching a much larger namespace than necessary. Of course, the
performance penalty is generally very small, and probably not even
noticed, so this may be more of an aesthetic than a practical issue.
Brett Stahlman
>
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---