Tim thanks for your reply.
See embedded how far I got.

[...]
Can you create your own (VHDL) fold markers? (not sure if the terminolgy is OK)

For example I have VHDL-code like below:

component bufg
port (
  o : out std_ulogic;
  i : in std_ulogic);
end component;

And when I'm at the first line in normal-mode and give zc command (fold close) then I want to see it fold like:

+-- 5 lines: component bufg


  :set foldmarker=component\ bufg,end\ component
  :set foldmethod=marker

This assumes that "component bufg" always starts the block. If "bufg" is some sort of variable/tag, you /can/ use


  :set foldmarker=component,end\ component

Yes, bufg is a variable. It can also be andport or multiplexer
This is working.
Can you create more foldmarkers?
For example, can I type:

:set foldmarker=component,end\ component
:set foldmarker=entity,end\ entity
:set foldmarker=process,end\ process

And should these then be stored in a foldmarker.vim file in my ftplugin directory?


[...]


Alternatively, with manual folding, you can force them by first clearing your folds (with "zE") and then using something like

        :g/^component\s\+\w+/,/^end component/fold

The use of regexps can give you more flexibility for nailing them down. An advantage over some of the 'foldmethod's is that you can also create your own manual folds on top of this as desired. This has a disadvantage that it doesn't refresh realtime, but the pairing (zE + the :g//) can be mapped to a single keypress to force a manual update if needed (though it will wipe out any other manually created folds). If you have trouble understanding what the above is doing, drop a line and I'd be glad to explain it.

Yes please explain, as I get the message:
E486: Pattern not found ^component\s\+\w+


I tend to go with the latter as allows me to be very precise with my regexps and it also allows me to create manual folds in addition.

Hope this gives you some ideas to work with...

-tim

Yes it does, If I get the latter also working I can see which one is better for my needs.

Thanks,
Rgds,
Eric

_________________________________________________________________
Mortgage refinance is hot 1) Rates near 30-yr lows 2) Good credit get intro-rate 4.625%* https://www2.nextag.com/goto.jsp?product=100000035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h2a5f&s=4056&p=5117&disc=y&vers=743

Reply via email to