Notepad++, windows command line, and unicode - python-3.x

I've been playing around with unicode block elements and box drawing in python3.6, just printing to the command line to see what happens. I've found that only some of the characters will actually print. The full box (2588), halves (258C, 2590), certain lines (2550-256C) will print fine, but the quadrants(2596-2598, 259D), dashed lines (2504-250B), some of the corners, swaths of the intersections show as the boxed question mark. They appear as squared in notepad++ too.
Using the names (\N{QUADRANT LOWER LEFT}) doesn't work either.
According to Wikipedia all the characters should be in UTF-8, which is being used in notepad++, the command line, and Python 3. What's going on?

Related

how to remove spaces between lines ENTIRELY on terminal?

I'm writing a CLI 3d rendering program, and in order for it to display correctly, I want it not to have spaces between lines at all. is there a terminal that can change its line spacing to zero or any other solution?

how to underline text in python 3.6.5

How can I print underlined text similar to what is shown on wikipedia in python? What unicode characters would I give to python to make this work?
In Python, arbitrary unicode characters can be expressed with \uXXXX where XXXX is a four-digit hex number identifying the code point.
Wikipedia shows the use of "combining low line" (U+0332).
Since it's a combining character, you need to place it after each character you want to be underlined.
So this code should print aaau̲zzz (u should be underlined in most browsers).
print('aaau\u0332zzz')
Note that this doesn't seem to work very well.
My gnome-terminal (which identifies as GNOME Terminal 3.26.2 Using VTE version 0.50.3 +GNUTLS), using Monospace Regular font, mis-renders the underline on the following character:
But if I copy the resulting text and paste it onto Stack Overflow, it seems to render correctly (Chrome on Linux):
aaau̲zzz
Unless I format it as code:
aaau̲zzz
In which case it doesn't "combine" at all.
Here's a screenshot of the above, in case your browser renders it differently:

Why my vim split window line so ugly?

When I split window, an ugly split line appears. I wonder why there is grey spaces between the '|' separator. I want only the '|'.
By the way, I use mac iterm2. I wonder some vim plugins cause this, but not sure.
In most fonts, the default pipe symbol (|) doesn't run the whole height of the display cell. In your screenshot, the spacing between lines is particularly pronounced.
You may either influence this in your terminal emulator settings (by changing fonts or reducing the line spacing), or in Vim by configuring a different character for the vertical separator:
set fillchars-=vert:\| | set fillchars+=vert:\
This replaces the default with a space (note the trailing space!) You can also try a Unicode character (should your terminal be able to display this); there are some vertical bars that run the whole length.

Line breaks in built-in documentations?

Bulit-in documentations look like this in smaller gVim windows:
while normally it should look like (capture from larger gVim window):
Is there any way to 'fix' the line breaks when viewing documentation in smaller windows?
Use the :nowrap option, which says (in part):
This option changes how text is displayed. It doesn't change the text
in the buffer, see 'textwidth' for that.
When on, lines longer than the width of the window will wrap and
displaying continues on the next line. When off lines will not wrap
and only part of long lines will be displayed. When the cursor is
moved to a part that is not shown, the screen will scroll
horizontally.
The help files are written with hard wraps at position 78; see the modeline at the bottom; it contains tw=78.
Especially with todays gigantic monitor sizes, terminals with less that the 1970s-standard 80 character width don't make sense. If your issue is with vertical splits of the help, just don't do that :-) (use the default horizontal splits).
The long-proposed, but so far not applied breakindent patch would provide a lot of what you want, though: The indent wouldn't be cluttered by the broken lines (but you'd still have a ragged right edge).

How to have a carriage return without bringing about a linebreak in VIM?

Is it possible to have a carriage return without bringing about a linebreak ?
For instance I want to write the following sentences in 2 lines and not 4 (and I do not want to type spaces of course) :
On a ship at sea: a tempestuous noise of thunder and lightning heard.
Enter a Master and a Boatswain
Master : Boatswain!
Boatswain : Here, master: what cheer?
Thanks in advance for your help
Thierry
In a text file, the expected line-end character or character sequence is platform dependent. On Windows, the sequence "carriage return (CR, \r) + line feed (LF, \n)" is used, while Unix systems use newline only (LF \n). Macintoshes traditionally used \r only, but these days on OS X I see them dealing with just about any version. Text editors on any system are often able to support all three versions, and to convert between them.
For VIM, see this article for tips how to convert/set line end character sequences.
However, I'm not exactly sure what advantage the change would have for you: Whichever sequence or character you use, it is just the marker for the end of the line (so there should be one of these, at the end of the first line and you'd have a 2 line text file in any event). However, if your application expects a certain character, you can either change the application -- many programming languages support some form of "universal" newline -- or change the data.
Just in case this is what you're looking for:
:set wrap
:set linebreak
The first tells vim to wrap long lines, and the second tells it to only break lines at word breaks, instead of in the middle of words when it reaches the window size.

Resources