how to remove spaces between lines ENTIRELY on terminal? - linux

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?

Related

Notepad++, windows command line, and unicode

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?

vim/nvim line spacing when printing

I'm trying to use nvim for everything, including writing, and all is great but the text is too crammed when I print it out.
Is it possible to adjust the line spacing when printing with :hardcopy?
My idea of a kludge fix would be to insert a second newline character for every carriage return, including those automatically inserted by line wrapping. Is this possible?
One of the least frustrating ways to do it would be to use a tool like pandoc to convert the text (for example Markdown) to whatever format you need — preferably PDF. However, pandoc uses LaTeX to create the resulting PDF, so regarding the styling you would have to tinker with supplying it a template or other options.
You can do it even easier with (for example) a Node.js tool called mdpdf. After installation, just run
mdpdf file.md --style styles.css
to supply it with a CSS stylesheet in which you can modify the resulting text output with every feature CSS permits. Using larger line spacing would be something like this:
body { line-spacing: 150%; }
This results in a 1.5x line spacing for everything in the document.
Of course, you can also set up a custom Vim command to automate this for you, putting something like the following into your .vimrc:
command MdToPDF !mdpdf %:t --style /full/path/to/styles.css
Calling :MdToPDF in Vim will then run that command for you.
Finally, if you're happy with the output, just print the PDF.

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.

Setting linespace in gVim

When setting linespace to some value greater than zero, the characters in the line are vertically top-aligned. I want the characters to be vertically centered (in the middle of the line).
The 'linespace' setting allows to slightly adapt the visual spacing of lines to the used font (so that text is neither too dense nor too much apart). It is not meant to be used for the "widely-spaced lines" effect shown in your screenshot.
If you really need something like that, you'd need to patch Vim's source code, or use another editor, or what I would attempt is modifying the used font to include more vertical padding in all glyphs.

How do you enable word wrap in vim when printing

I wanted to print a simple text document and make sure words wrap on word boundaries. I tried both
set linebreak
and
set wrap
but when printing, it just breaks on the right column in the middle of words. Is this possible for printing?
You are creating a text file without any built-in linebreaks so each paragraph is a single "line", even though with linebreak and wrap set, it looks like they are multiple lines). This is why printing breaks at fixed places. (According to http://www.vim.org/htmldoc/various.html#printing it does not seem like you can have vim respect linebreak/wrap during print.)
To avoid this, if you want text to wrap while you are editing, do
set textwidth=70
to wrap at the 70th column. If you want your file to have long lines (e.g., so it formats fine when loaded into MS Word or something), then you will have to pre-process the text version before printing it. So, for example, you can try:
fmt file.txt | lpr
or if you have enscript installed, you should be able to try:
enscript --word-wrap file.txt
to print. An existing file can be wrapped by running in vim:
gggqG
that is, 'gg' to go to start of file and 'gqG' to reformat 'gq' from the current position (i.e. the first line) to the last line (by going to 'G'). 'gq' will respect your current textwidth setting.

Resources