fuckyeahterminals

this isnt intended to be a vim blog but i use it a lot so i like to pass down tips. if for x reason  you need to submit your code but dont want to submit your .java or .cpp file vim has a nice way to make a postscrip file
 add
let &printexpr="(v:cmdarg=='' ? ".
    \"system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice)".
    \". ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error".
    \" : system('mv '.v:fname_in.' '.v:cmdarg) + v:shell_error)"
to your .vimrc file, if you want a pdf file then just use the ps2pdf command to turn it into a pdf and now anyone can open your code without having direct access to it.

this isnt intended to be a vim blog but i use it a lot so i like to pass down tips. if for x reasonĀ  you need to submit your code but dont want to submit your .java or .cpp file vim has a nice way to make a postscrip file


add

let &printexpr="(v:cmdarg=='' ? ".
    \"system('lpr' . (&printdevice == '' ? '' : ' -P' . &printdevice)".
    \". ' ' . v:fname_in) . delete(v:fname_in) + v:shell_error".
    \" : system('mv '.v:fname_in.' '.v:cmdarg) + v:shell_error)"

to your .vimrc file, if you want a pdf file then just use the ps2pdf command to turn it into a pdf and now anyone can open your code without having direct access to it.

  1. tcfusion reblogged this from fuckyeahterminals and added:
    That’s exactly why I love vi(m), you can just do so much with it.
  2. fuckyeahterminals posted this