ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: vim module: modify line wrapping
Date: Fri, 15 May 2015 11:25:24 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LNX.2.03.1505151121220.12597@hzvpu.rqh> (raw)
In-Reply-To: <18774430d3c61359114418d20a1eed05@chemnitz.dyndns.aksdb.de>

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
___________________________________________________________________________________

      reply	other threads:[~2015-05-15 15:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12 16:06 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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.03.1505151121220.12597@hzvpu.rqh \
    --to=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).