Vim different color scheme when printing

Is there a way in _vimrc to set a different color scheme that will be used when printing files?

I like the text layout of the dark background on the screen, but obviously this doesn't translate well to paper.

Edit: I can change the scheme manually before printing, and then change it back, and it works fine. Just curious if there is a way to tell Vim to always use a specific circuit when printing. A.

This is what produces :hardcopy: enter image description here

+4
source share
3 answers

How about something like

:command Hardcopy let colors_save = g:colors_name <Bar> colorscheme default <Bar> hardcopy <Bar> execute 'colorscheme' colors_save

Perhaps enter an option 'bg'. If you need local variables, make this a function:

command Hardcopy call Hardcopy()
function! Hardcopy()
  let colors_save = g:colors_name
  colorscheme default
  hardcopy
  execute 'colorscheme' colors_save
endfun
+5
source

Vim " " , - . ​​

" " \pd Vim, . :

enter image description here

. . :help printer-dialog. g:prd_syntaxList .

g:prd_syntaxList = "no,current,default,print_bw,zellner" 

. :help prd_syntaxList.

+3

:hardcopy . :help hardcopy:

The current highlighting colors are used in the printout, with the following
considerations:
1) The normal background is always rendered as white (i.e. blank paper).
2) White text or the default foreground is rendered as black, so that it shows
   up!
3) If 'background' is "dark", then the colours are darkened to compensate for
   the fact that otherwise they would be too bright to show up clearly on
   white paper.

, "[...] , [...]", @benjifisher.

:TOhtml, ( ), - . . :help TOhtml , . g:html_number_lines.

+1
source

Source: https://habr.com/ru/post/1530467/


All Articles