On 27/09/09 17:55, Stahlman Family wrote:
>
>
>
> 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

IIUC, what adds the tags to the Vim help space is not the fact of 
running :helptags (which you could do in any directory) but of having 
the *.txt and tags files in a /doc/ subdirectory of some directory named 
in 'runtimepath' (or, if different, in the same directory as the file 
named by the 'helpfile' option). IMO, adding custom files to the Vim 
help (e.g. in ~/.vim/doc on Unix, ~/vimfiles/doc on Windows) could be an 
advantage if they aren't too many or too heavy and you want them to 
appear as possible completions of the ":help" command, and to be opened 
in the help window. OTOH, IIUC you could still use *.txt, ft=help (or 
variations such as ft=help.foo.bar.baz) and :helptags, but _outside_ of 
the 'runtimepath' trees, to use them with "tag" commands, including 
Ctrl-] and Ctrl-T, but not ":help {subject}", so that you won't need 
anymore to avoid name clashes with existing help tags. But in this case, 
invoking the tags won't put the file containing them in a help window 
but in the current window, which means that if the tag is not in the 
current file and the latter is 'modified', the tag command will fail 
unless you have either 'autowrite' (or 'autowriteall') set, or use a 
bang! in the :tag command to force |abandon|ing the changes to the 
current file (see ":help tag-!").

Best regards,
Tony.
-- 
Absentee, n.:
        A person with an income who has had the forethought to remove
himself from the sphere of exaction.
                -- Ambrose Bierce, "The Devil's Dictionary"

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to