> On Sat, 14 Aug 2010, Jeri Raye wrote:
>
>> Hi Ben,
>>
>> On Fri, Aug 13, 2010 at 8:45 PM, Benjamin R. Haskell wrote:
>>> The attached file seems to do what you want, [...]
>>>
>>> [...] For some insight into how it works, do:
>>> :echo orig_syntax
>> when I type :echo original_syntax then I noticed that entity is still
>> reported in the vhdlStatement list.
>>
>> Then I've modified the line of block_words into
>> let block_keywords = [ 'if', 'else', 'entity', 'zab', 'end' , 'inout' , 'bar']
>> Then give the same command again :echo original_syntax
>>
>> Then also end and inout are still in the list.
>
> You left out the second instruction...
>
> :echo orig_syntax
> :syn list vhdlStatement
>
> The ':echo' gives you the original syntax entry for vhdlStatement.
> The ':syn' command gives you the current entry.
>
> (So you can compare them.)
>
>
>> It also says that only if and else are in the match group. At least
>> that's my understanding of the lines that comes after all the vhdl
>> keywords
>> match /\<\(if\|else\)\>/
>> links to statement
>>
>> zab and bar are now highlighted as vhdl keywords
>
> Right. But they aren't listed in that :echo orig_syntax, are they?
> (They shouldn't be -- they were added to the new list.)
>
>
>>> Essentially, the file gets the original vhdlStatement list of
>>> keywords, and recreates it, filtering out the keywords you want to
>>> use as folding block indicators. (The attached file uses the list:
>>> 'if', 'else', 'entity', and 'zab'. You should be able to modify
>>> block_keywords to whatever you want.)
>>>
>>> Then it does two things: one is to fill in the answer to your
>>> question above. Instead of creating the individual matches/regions
>>> 'vhdlFoo', 'vhdlBar', and 'vhdlFooBarFold', it just adds them as
>>> matches in vhdlStatement, and adds the single region
>>> 'vhdlBlockFold':
>>>
>> The folding of code starting with if or entity or else or zab doesn't
>> happen.
>
> You also have to set foldmethod=syntax. Sorry, probably could've added
> it to that file:
>
> :set fdm=syntax
>
:setlocal fdm=syntax
You don't want to make it the new default for all files of all
filetypes, do you?
Best regards,
Tony.
--
Chemicals, n.:
Noxious substances from which modern foods are made.
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
No comments:
Post a Comment