On 14/04/09 05:01, Yue Wu wrote:
>
> On Tue, 14 Apr 2009 10:13:38 +0800, Tony Mechelynck wrote:
>
>>>
>>> afaik all help files specify its own modeline. try :help
>>> and go to the last line, you see:
>>>
>>> vim:tw=78:fo=tcq2:isk=!-~,^*,^\|,^\":ts=8:ft=help:norl:
>>>
>>> Since the above lies in the official help.txt, we can safely think that
>>> this is the official way to write a help file. (see isk= in help.txt)
>>
>> OTOH, many others don't include an 'isk' setting:
>>
>> usr01.txt
>> Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:
>>
>> options.txt
>> vim:tw=78:ts=8:ft=help:norl:
>>
>> version7.txt
>> vim:tw=78:ts=8:ft=help:norl:
>>
>> etc.; note that all these are by Bram Moolenaar and include hotlinks
>> with dots in them. Nevertheless clicking these hotlinks, or hitting
>> Ctrl-] on them, leads you to the proper place. For instance, hitting
>> Ctrl-] on the t of arabic.txt at line 729 of options.txt (after getting
>> there by issuing ":help 'arabic'" and possibly scrolling to the end of
>> the 'arabic' section) leads you to the arabic.txt helpfile, not to
>> gui.txt which is the first result when matching for txt or .txt as the
>> helptag.
>>
>> (Note: I have an after-ftplugin which sets the 'isk' option for
>> helpfiles but I checked it with gvim -N -u NONE which doesn't load any
>> plugin. The only scripts it sources are menu.vim and autoload/paste.vim.)
>
> Right, that confuses me, why does it happen?
>
Because when you open a vim helpfile _as a helpfile_ (i.e. as a result
of ":help", ":helpgrep", etc.) Vim is clever enough to set 'iskeyword'
as if there had been
:setlocal isk=!-~,^*,^\|,^\",192-255
for that file. But that doesn't happen if you open the file as "just any
file" with ":view", ":vsplit", ":vimgrep" etc.
If you want help hotlinks to work even in the latter case, IMHO the
simplest solution is to add that line as ~/.vim/after/ftplugin/help.vim
(create the directories if they don't yet exist).
Note that, according to my experiments, Vim sets that 'iskeyword' value
after reading the modelines but before sourcing ftplugins, so it
overrides the modeline in help.txt but not a user's
after/ftplugin/help.txt. (It also happens even when modelines are
disabled.) (The value set by my user-plugin is almost equivalent but
differently worded: I use
:setlocal isk=33-126,161-255,^*,^\",^\|
to _really_ set it to all printable nonspace except bar, star and
quote.) (In Latin1, 127 is Del, 128-159 are rarely-used control
characters, 160 is the no-break space, 161-191 are "special" signs like
yen, pound, paragraph, copyright, etc.; and the "accented letters" start
at 192.)
Best regards,
Tony.
--
f u cn rd ths, itn tyg h myxbl cd.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---