Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Not to diminish OP's project, but I pipe most things to vim to get all my standard highlighting goodness:

    cat file_name | vi -


I do something similar except with "view" aka "vi -R" aka read-only mode.

A couple things I like about "view":

1. No warning screen when using "view file.c" if you or someone else happens to have the same file open for editing.

2. No "unsaved changes" prompt when quitting "view -" (or in other words, no need to force-quit with :q!)

Edit: Also worth noting is that "view file.c" vs "cat file.c |view -" gives vim a better chance of getting the syntax highlighting right since it knows the file extension.


to avoid the "useless use of cat", I find this approach most welcome at the end of a long pipe, i.e.:

    grep ... files | sed ... | awk ... | vim -


Mandatory mention: Emacs works here as well, but is less practical because of longer startup times.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: