:ha(rdcopy) has been deleted from Neo Vim.
I can understand why, since it makes code refactoring for developers easiear without having to consider an infinite number of things.
Here is the workaround.
Use this function in your
There is no need to save the working file to print.
Remember to change the printer name to your own printer name
The first letter of a command has to be upper case so we cannot have
:hardcopy and have instead to have
Place all of this inside your
silent execute '!lpoptions -d HP_LaserJet_2200_LOCAL_hpcups'
silent execute 'w !lp -n 1 -o media=a4 -o sides=two-sided-long-edge -'
command! Ha call PrintBuffer()
command! Hardcopy call PrintBuffer()
Or use the below function to print to the default printer, again no need to save the file to print.
This time I have mapped this to
" below for instant printing to default printer
silent execute 'w !lp'
command! Hc call PrintBufferWithCR()
To find out which is your default printer use
lpstat -d on the command line.