Paul wrote:
> 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?
I'd suggest using a couple of substitutes -- one to remove them and use
regular autoindent (:set ai), then put the bars in:
Put bars in:
[range]s/\t/\t|/g
Take bars out:
[range]s/\t|/\t/g
If you happen to be using utf-8, you might want to use \u2502 instead of
a |.
Regards,
Chip Campbell
-- 
-- 
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