Wednesday, December 9, 2015

Re: I have a dream, about pseudocoding support

Hi,

Paul schrieb am 09.12.2015 um 07:41:
> I have a dream, about pseudocoding support
> ------------------------------------------
> I'm using vim to write pseudocode. This example must be viewed in
> fixed with font:
>
> For each machine type demanded, starting from the one with the
> most costly demand
> |
> | Set current machine instance timeline to 1
> |
> | For each machine instance demanded
> | |
> | | While current machine instance timeline <= qty of
> | | machine
> | | |
> | | | If the demand duration fits
> | | | |
> | | | | Tabulate the machine instance demanded
> | | | | against the machine instance and vice-versa
> | | | |
> | | | | Break out of machine instance timeline loop
> | | | |
> | | | Else
> | | | |
> | | | | Current machine instance timeline += 1
> | | | |
> | | | End If
> | | |
> | | End While
> | |
> | | If the machine instance demanded was not tabulated
> | | against the machine instance
> | | |
> | | | Add machines to fit balance of machines
> | | | instances demanded
> | | |
> | | | Tabulate machine instances demanded against new
> | | | machine instance timelines and vice-versa
> | | |
> | | | Break out of machine instance demanded loop
> | | |
> | | End If
> | |
> | Next machine instance demanded
> |
> Next machine type demanded
>
> The vertical lines really help. I currently use visual block to add
> them in a manually time consuming fashion. Once they're in, it's
> impossible to reword paragraphs and use "gq" to reformat them. I end
> up using substitution to get rid of the vertical lines in order to
> work with the pseudocode, then painstakingly add them back in to
> examine the pseudocode.
>
> What vim tricks might make this more efficient?

do you need the vertical lines to be present in your file or are they
just for easier reading? If the second case is true you can try the
following settings:

:set ts=3 sw=3 noexpandtab list
:let &listchars = substitute(&listchars, 'tab:[^,]*', 'tab:| ', '')

Then replace the bars and spaces with tabs

:%s/|\( \|$\)/\t/g

and you should have an almost identical display.

If you want the vertical lines to be present in your file check if the
following settings suit your needs

:set formatoptions+=tcql
:set comments+=n:\|

Regards,
Jürgen

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment