Wednesday, December 9, 2015

Re: I have a dream, about pseudocoding support

On Wednesday, December 9, 2015 at 3:28:02 AM UTC-5, jott...@googlemail.com wrote:
>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?

Yes, though their presence helps in a document that captures the
pseudocode (say in a figure containing verbatim text).

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

I'm finding that I need to add extra tabs to blank lines. It might
help.

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

This seems much more suitable, in my opinion. I think it will help a
lot, because it works with gq. The labour of adding the vertical bars
is less, overall, compared to maintaining them when using gq.

Thanks you!

Now....I was also wondering if it was possible to shorten the height
of empty lines? Just kidding! But more seriously, that is one of the
limitations I'm finding, that the content viewable on one screen is
limited due to the spacing. Ah well. All-text editing: Has strong
advantages, but some down sides.

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