* vim module: modify line wrapping
@ 2015-05-12 16:06 Andreas Schneider
2015-05-12 19:09 ` Aditya Mahajan
0 siblings, 1 reply; 7+ messages in thread
From: Andreas Schneider @ 2015-05-12 16:06 UTC (permalink / raw)
To: ntg-context
Hi,
vimtyping already offers line wrapping by specifying "lines=split".
However, some /lines/with/very/long/sequences/of/somehow/breakable/chars
do not break at all.
In that given example, I would like to also allow vimtyping to break
lines at "/". Is something like that possible? And if so: how?
Best regards,
Andreas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: vim module: modify line wrapping
2015-05-12 16:06 vim module: modify line wrapping Andreas Schneider
@ 2015-05-12 19:09 ` Aditya Mahajan
2015-05-13 7:02 ` Andreas Schneider
0 siblings, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2015-05-12 19:09 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Tue, 12 May 2015, Andreas Schneider wrote:
> Hi,
>
> vimtyping already offers line wrapping by specifying "lines=split".
> However, some /lines/with/very/long/sequences/of/somehow/breakable/chars
> do not break at all.
> In that given example, I would like to also allow vimtyping to break
> lines at "/". Is something like that possible? And if so: how?
Does \setbreakpoints[compound] help? If not, please post a minimal
example.
Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: vim module: modify line wrapping
2015-05-12 19:09 ` Aditya Mahajan
@ 2015-05-13 7:02 ` Andreas Schneider
2015-05-14 14:36 ` Aditya Mahajan
0 siblings, 1 reply; 7+ messages in thread
From: Andreas Schneider @ 2015-05-13 7:02 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 12.05.2015 21:09, schrieb Aditya Mahajan:
>
> Does \setbreakpoints[compound] help? If not, please post a minimal
> example.
>
> Aditya
Unfortunately not.
Here is an example:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\usemodule[vim]
\definevimtyping[JSON][syntax=javascript, lines=split, strip=yes]
\starttext
The example:
\startJSON
{
"sample_parameter":
"http://some/url/with/a/lot/of/path/elements?and=some&variables=too"
}
\stopJSON
\stoptext
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: vim module: modify line wrapping
2015-05-13 7:02 ` Andreas Schneider
@ 2015-05-14 14:36 ` Aditya Mahajan
2015-05-14 15:26 ` Aditya Mahajan
0 siblings, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2015-05-14 14:36 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Wed, 13 May 2015, Andreas Schneider wrote:
> Here is an example:
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> \usemodule[vim]
> \definevimtyping[JSON][syntax=javascript, lines=split, strip=yes]
Add `option=hyphenated`.
> \starttext
> The example:
>
> \startJSON
> {
> "sample_parameter":
> "http://some/url/with/a/lot/of/path/elements?and=some&variables=too"
> }
> \stopJSON
>
> \stoptext
Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: vim module: modify line wrapping
2015-05-14 14:36 ` Aditya Mahajan
@ 2015-05-14 15:26 ` Aditya Mahajan
2015-05-15 8:11 ` Andreas Schneider
0 siblings, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2015-05-14 15:26 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Thu, 14 May 2015, Aditya Mahajan wrote:
> On Wed, 13 May 2015, Andreas Schneider wrote:
>
>> Here is an example:
>>
>>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> \usemodule[vim]
>> \definevimtyping[JSON][syntax=javascript, lines=split, strip=yes]
>
> Add `option=hyphenated`.
I just released a newer version to t-vim where the `option=hypenated` is
documented. It is also possible to hyphenate words by using
\definevimtyping[...][..., option={packed,hyphenated}, align=hyphenated,
....]
Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: vim module: modify line wrapping
2015-05-14 15:26 ` Aditya Mahajan
@ 2015-05-15 8:11 ` Andreas Schneider
2015-05-15 15:25 ` Aditya Mahajan
0 siblings, 1 reply; 7+ messages in thread
From: Andreas Schneider @ 2015-05-15 8:11 UTC (permalink / raw)
To: mailing list for ConTeXt users
Am 14.05.2015 17:26, schrieb Aditya Mahajan:
>
> I just released a newer version to t-vim where the `option=hypenated`
> is documented. It is also possible to hyphenate words by using
>
> \definevimtyping[...][..., option={packed,hyphenated},
> align=hyphenated, ....]
>
> Aditya
Thank you for that solution. It doesn't work quite that way, though:
1. Only [...,option=hyphenated,...] breaks many, but not all lines.
\setupalign[verytolerant,stretch] helps here.
2. [...,option={packed,hyphenated},align=hyphenated,...] doesn't work at
all
3. Omitting "packed", ie. [...,option=hyphenated,align=hyphenated,...]
works as expected. Even single words are broken then.
I will currently stick with option 1, since option 3 has a negative side
effect: it inserts hyphen marks ("-"), which looks weird in source code.
All in all I have two wishes regarding wordwrap and hyphenation, and
hope they aren't too hard to grant :-)
1. Add an option to omit the hyphenation mark/sign (whatever it is
actually called).
2. Add an option to indent the wrapped line to the line it was wrapped
from.
Remark for wish #2:
Currently breaking lines look like:
| This is an indented and |
|broken line. |
It would be nicer to have:
| This is an indented and |
| broken line. |
Thanks for adjusting the documentation of the vim module and giving me
all these options. I now have a ConTeXt produced document I can proudly
release to the customer :-)
Best regards,
Andreas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: vim module: modify line wrapping
2015-05-15 8:11 ` Andreas Schneider
@ 2015-05-15 15:25 ` Aditya Mahajan
0 siblings, 0 replies; 7+ messages in thread
From: Aditya Mahajan @ 2015-05-15 15:25 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Fri, 15 May 2015, Andreas Schneider wrote:
> Am 14.05.2015 17:26, schrieb Aditya Mahajan:
>>
>> I just released a newer version to t-vim where the `option=hypenated`
>> is documented. It is also possible to hyphenate words by using
>>
>> \definevimtyping[...][..., option={packed,hyphenated},
>> align=hyphenated, ....]
>>
>> Aditya
>
> Thank you for that solution. It doesn't work quite that way, though:
>
> 1. Only [...,option=hyphenated,...] breaks many, but not all lines.
> \setupalign[verytolerant,stretch] helps here.
Depends on a bit on the breakpoints. Can you send an example where it
doesn't work.
> 2. [...,option={packed,hyphenated},align=hyphenated,...] doesn't work at
> all
It should. I'll look into this.
> 3. Omitting "packed", ie. [...,option=hyphenated,align=hyphenated,...]
> works as expected. Even single words are broken then.
> I will currently stick with option 1, since option 3 has a negative side
> effect: it inserts hyphen marks ("-"), which looks weird in source code.
I know. That is why, as I say in the documentation, option 3 is a last
case resort.
> All in all I have two wishes regarding wordwrap and hyphenation, and
> hope they aren't too hard to grant :-)
>
> 1. Add an option to omit the hyphenation mark/sign (whatever it is
> actually called).
This should be easy (provided someone can tell how to do this in normal
text :-)
> 2. Add an option to indent the wrapped line to the line it was wrapped
> from.
This is too difficult to do correctly, and I am not going to implement a
half-baked solution. One option is to run your code through a formatter
(prettifier) upfront. It is easy to plug that in to the t-vim module.
Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-05-15 15:25 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-12 16:06 vim module: modify line wrapping Andreas Schneider
2015-05-12 19:09 ` Aditya Mahajan
2015-05-13 7:02 ` Andreas Schneider
2015-05-14 14:36 ` Aditya Mahajan
2015-05-14 15:26 ` Aditya Mahajan
2015-05-15 8:11 ` Andreas Schneider
2015-05-15 15:25 ` Aditya Mahajan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).