Unicode printing in vim

I work with text files that contain many Unicode characters (β‰Ό, βŠ“, βŠ”, ...). Vim displays them in order, but when printed, they are replaced by a common character. Gedit prints them without problems, but it’s a little painful to run another editor to print. A.

Is there a way to get vim (on Linux / Gnome) to print correctly? I tried using it vim-gnome, hoping that it would use the same infrastructure as gedit, but that is not the case.

+5
source share
2 answers

Vim can only use 8-bit encoding for printing. If there is an encoding that includes all of these characters, all you need is to use

set printencoding={encoding}

, vim. :TOhtml, @DaoWen, do

:TOhtml
:w /tmp/print.html
:!command-that-makes-browser-print-a-file(I-do-not-know-one) /tmp/print.html
:!rm /tmp/print.html

. formatvim, pdf ( : -xcolor ):

:Format format latex-xcolor to /tmp/print.tex
:!pdflatex /tmp/print.tex && lp /tmp/print.pdf && rm /tmp/print.*

( html, ). , .

+8

: TOhtml HTML. .

+2

All Articles