DEV Community

Discussion on: What's your favorite Vim trick?

Collapse
 
brandonwallace profile image
brandon_wallace

I set up a shortcut to print in my .vimrc.

I run this command to see available printers.

$ lpstat -v
Enter fullscreen mode Exit fullscreen mode

I set a default printer.

$ lpoptions -d <printer_name>
Enter fullscreen mode Exit fullscreen mode

In my .vimrc I have this line to print the current file.

nnoremap <silent> <leader>p :%w !lp<cr>
Enter fullscreen mode Exit fullscreen mode