How can I wrap text in lists without adding linebreaks? - vim

In all the years that I have been using VIM, I have never been able to "wrap" the text in lists as below.
Wrap off:
- this is a list entry with an amount of text that can exceed 100 characters.
Wrap on:
- this is a list entry with an amount of text that can
exceed 100 characters.
Expected with wrap on:
- this is a list entry with an amount of text that can
exceed 100 characters.
My settings:
"comments
set comments=f:-,f:*
"see this as list
let &formatlistpat='^\s*\([-*]\|\d\{1,2}[a-z]\?[.)]\|\a[.)]\)\s\+'
"format options
set formatoptions=tcqnw
How can I wrap the text (in lists) as expected (without adding linebreaks).
Not all text, only the text in lists.

Related

Wrap Text in openPD

Is there a way to wrap text around an image in openPDF? or around other text? I'm trying to mesh two texts onto one page (texts which may contain pictures), but one text may be larger or smaller then the other. They could look like one of these two pictures:
I was going to make a column text, and test the length of text 2 against the length of the text of text 1 that remains after the first few lines (see the picture), but I couldn't return the remaining text with columnText.go(true).
Is there an easy way to wrap text around a picture or other variable object (aka text)?

vim indentation: disable inference of enumerated list

In vim, when I format the following paragraph in a plain text file using gqip, the formatter indents it like an enumerated list.
Original paragraph:
Here is some text including a number
3 in the paragraph, which may be
regarded as the start of a numbered
list when I format it.
Formatted (after gqip):
Here is some text including a number
3 in the paragraph, which may be
regarded as the start of a numbered
list when I format it.
The problem is that vim aligns the word "regarded" as if the line "3 in the paragraph..." somehow means "(3) in the paragraph". In my opinion, this is a bug in the formatting rules, because there are obvious counter-examples that occur frequently in ordinary text. So how can I refine this indentation rule to apply only when there is list-like punctuation on the number? For example, I think this is ok:
Here is some text including a number
3) in the paragraph, which may be
regarded as the start of a numbered
list when I format it.
There are counter-examples to this rule as well, but at least the error occurs less frequently. The rule could be further refined by checking for balanced parentheses--i.e.:
Here is some text (including a number
3) in the paragraph, which is not
regarded as the start of a numbered
list when I format it (because the
parenthesis is accounted for by the
opening parenthesis on line 1).
See :h fo-table 's n letter meaning, then see :h formatlistpat, which is used to recogize a list header:
" 'formatlistpat' 'flp' string (default: "^\s*\d\+[\]:.)}\t ]\s*")
" ignore '3 ' by removing space in pattern
let &formatlistpat='^\s*\d\+[\]:.)}\t]\s*'
" ignore (\n3) or [\n3] or {\n3} by adding a preceding NOT match
let &formatlistpat='\([\[({]\s*\n\)\#<!\_^\s*\d\+[\]:.)}\t]\s*'

Replace text with variable

I'd like to use the bulk uploader to override text in a document. E.g. I could have JOB_TITLE in the document and this should be replaced with the contents of the CSV file. I can see how I can put the fields in but it doesn't make space for long titles - text goes over the existing text.
How can I replace a tag with a long string and still have everything fit?
Thanks!
You specify an absolute (i.e., specific) width when you place a new field (tab) in a document, and DocuSign reserves exactly that much space for the field value, irrespective of the location of surrounding text in the document. As it sounds like you're experiencing, if the field value you specify exceeds the space that's been reserved for that field in the document, the value will be written in its entirety to the document, overlapping any adjacent text located to the right of the field.
Therefore, if possible, it's best to format/arrange your document contents in such a way that any variable length fields are placed at the end of their own line, rather than 'inline' within a sentence (in close proximity to other text).
For example, instead of contents like this:
We are pleased to offer you the position of [JOB_TITLE] with a salary of [SALARY], beginning on [START_DATE].
You could instead arrange things more like this:
We are pleased to offer you the following position:
Title: [JOB_TITLE]
Salary: [SALARY]
Start Date: [START_DATE]
That way, regardless of the length of JOB_TITLE, SALARY, or START_DATE (within reason, of course), the final document will be formatted nicely.

Sort alphanumeric values

I need to sort a list of part numbers alphanumerically. Excel will not sort them correctly though when I open the auto filter drop down it shows them in the order that I need.
They aren't uniform in length, some contain letters, some have leading zeros, with a maximum length of 15 characters. Here is a list along with the correct sorting:
Part Correct Sort
00863 00863
1123 02257
02257 07706
6549 10338
6834 11212
07706 1123
8001 65412SSCY
8001 6549
10338 6834
11212 8001
65412SSCY 8001
EN93 EN93
SCSM11BE SCSM11BE
Hoping for a macro or method.
If you have values formatted as Text and not numbers with custom number formats (for leading zeroes) then all you need to do is choose the correct Sort Warning option.
        
If you opt for *Sort numbers and numbers stored as text separately, you will come up with teh correct (as per your sample) sort order.
Note that text by default is left-aligned in a cell while numbers (regardless of their number formatting) are right-aligned by default.
You need to specify the correct option to Excel:
and after the sort:
Select the column with the original data and then click on "Text to Columns".
Pick Delimited as the file type, and then click "Next".
Uncheck all the delimiters and then click "Next".
On the Step 3 of 3 window, choose Text as the Column data format.
Then click Finish.
All your data will now act as type = text.
Then select all the data again, and in the sort you can choose "Sort numbers and numbers stored as text separately"

Text alignment in Crystal Reports

I am developing a crystal report and data is also coming fine but I am unable to format the fields in the same, just like a comment field must be multiline but when I select the "can Grow" in Format object section, the display is vague.
Can Grow with a value zero stands for the display will grow to multiple lines till it is displayed fully.
As the grow can happen multiple lines, you can adjust the width of the item so that it will not overlap with other item.
What should You do:
Set can grow property to zero
Resize the item (for which you set cangrow 0) so that it will not overlap the item of the next column.

Resources