13

Try something like this: :syntax match Error "yourterm" or (to ignore case and match "Yourterm", "YOURTERM", "yourTerm" etc.): :syntax match Error "\cyourterm" ... and print with hardcopy - the term should be highlighted using the Error highlight rules. (see also this). Here's a pdf sample printed from my vimrc, using :syntax match Error "Plug": If the ...


10

The loss of kprinter in the move to kde4 was one of the reasons I stuck with kde3 for as long as I could. After some searching, I found this "3rd party" replacement: http://kde-apps.org/content/show.php/KPrinter4?content=163537, https://github.com/credativ/kprinter4. It looks like you have to compile it yourself (Its not included in distros since it isn't ...


7

Instead of printing from Vim, you could instead generate an HTML file using :TOhtml. Then you can use CSS to set the font used for the HTML and print that.


5

From :help popt-option: formfeed:y When a form feed character is encountered, continue printing of the current line at the beginning of the first line on a new page. So… add the line below to your vimrc: set printoptions+=formfeed:y insert a form feed where you want your page break to occur with <C-l> in insert mode, do :...


4

From :help pexpr-option: Expression that is evaluated to print the PostScript produced with :hardcopy. The file name to be printed is in v:fname_in. It's a bit of a hack, but you can simply echo the v:fname_in variable to a file: :let &printexpr = "system('echo '.v:fname_in.'>> /home/martin/hardcopy')" And then examine the created ...


4

I found it using lsof: /private/var/folders/cr/jsb8dl_50lbdy05hj7v2l9wr0000gn/T/com.apple.Preview/PreviewTemp-79NyiU/0.pdf And then I found the other files alongside it using find: find /private/var/folders/cr/jsb8dl_50lbdy05hj7v2l9wr0000gn/T/com.apple.Preview -type f I still don't know why it was put here, but at least I found it.


2

This will make the header blank. There has to be a space following the backslash. Otherwise it will print a backslash as the header. :set printheader=\


2

Send the buffer to the browser by converting to HTML, then print from there: :TOhtml | w | !open -a Safari % For example I have this in vim: If I type :ha I get this: But when I send it to the browser I get this (with color scheme!): I have this in my .vimrc, which deletes the new html buffer and stored file: nnoremap <F2> <ESC> :TOhtml &...


2

Per this Stackoverflow:4586628 Q/A, How do you pipe a vim buffer through lpr?, I have this entry in my ~/.vimrc: nmap PpP :%w !lpr -o lpi=8 -o cpi=14<CR><CR> that replaces my old entry, nmap PpP :ha<CR> (:ha = :hardcopy). Using :ha, Neovim was not printing Greek letters, ... even though my (Arch Linux) locale was LANG=en_US.UTF-8 ... ...


2

Just for the sake of completeness: If kprinter4 doesn't work, you can also make a parallel installation of (relevant components of) Trinity KDE (TDE) desktop, which is available in some distros such as Debian or Arch. Then you can use good old kprinter instead of kprinter4: set popt=duplex:off set printexpr=PrintFile(v:fname_in) function PrintFile(fname) ...


2

I tried with your very own settings and I encountered no issue. If I understand the help correctly, by default Vim will use A4 as the medium size; maybe your output gets on a smaller medium size than A4? Could you try to add something like: paper:letter in your printoptions. Does it change something? What exact size of medium are you using?


2

I worked it out myself. I need to add the setting to $HOME/.gvimrc as well. If the setting is in $HOME/.vimrc, then MacVim overrides it. If the setting is in $HOME/.gvimrc, then MacVim doesn't override it.


1

My suggestion is convert to HTML and print from the browser with :TOhtml


Only top voted, non community-wiki answers of a minimum length are eligible