![](https://secure.gravatar.com/avatar/201d5dc0ba4ed385f41b84a17acf1b9c.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/201d5dc0ba4ed385f41b84a17acf1b9c.jpg?s=120&d=mm&r=g)
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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/201d5dc0ba4ed385f41b84a17acf1b9c.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
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
participants (2)
-
Aditya Mahajan
-
Andreas Schneider