Loading ...
Sorry, an error occurred while loading the content.

Re: Slightly OT: Vim/Cat

Expand Messages
  • Antoine J. Mechelynck
    ... I don t know how to dump a syntax-colored file with interspersed terminal-control sequences, which seems to be what you want. But, starting at :help
    Message 1 of 4 , Sep 30 8:40 AM
    • 0 Attachment
      A. S. Budden <vim.mail@...> wrote:
      > Hi there,
      >
      > This is possibly optimistic and almost certainly off-topic, but I was
      > wondering if it is possible to make vim open a file and just dump it
      > to standard out, with syntax highlighting/tab spacing etc done.
      >
      > My linux console certainly supports colours if I do "ls" or "ls
      > --color=always | more" (this doesn't work with less), and I was
      > wondering if I could have a version of cat that uses vim to syntax
      > highlight and dump the output on the screen.
      >
      > Just wondering...
      >
      > Cheers,
      >
      > Al

      I don't know how to dump a syntax-colored file with interspersed
      terminal-control sequences, which seems to be what you want. But, starting
      at ":help 2html.vim", there is a description (in some 80 lines of help text)
      of how to convert a syntax-colored file you see in Vim, to something that
      can be viewed with the same colors in a web browser such as (for instance)
      Netscape. To view the result, just use as your URL the full path name of the
      output file, prefixed with the word "file", a colon, and three slashes.

      OTOH, using the 'printoptions' option and the ":hardcopy" command, you can
      write your file to a printer (or to a file suitable to be sent to a
      printer), with or without syntax coloring.

      HTH,
      Tony.
    Your message has been successfully submitted and would be delivered to recipients shortly.