At my workplace, I want to do a presentation of a custom language I've developed for solving some problems we had. For easier development, I created my own vim syntax file for this particular language.Now, I need to present it on another computer, that will not have that syntax file. For all I know, it might even not have vim installed (but I doubt it).It would be perfect if I could less -r a file to get that same syntax highlighting that I do on my own computer.However, I do not know how to either copy&paste while preserving colors (in terminal from gnome on Debian), or how to output the file with its syntax highlighting as raw control chars from vim. I'm more confident in finding a solution from vim, but I have no idea what to look for to do that.Do you know any way to output the file you opened with its syntax highlighting as ANSI raw-control-chars in another file?
How to output highlighted source code into a file to use outside vim
command line;syntax highlighting
You can use the :TOhtml command that ships with Vim to create an HTML representation of the (syntax highlighted) buffer (or parts of it). Then, your only requirement on the target system would be a browser to display the captured file. See :help :TOhtml for details.If you insist on outputting ANSI escape sequences, you could probably modify the plugin to do that, but I guess that would be a non-trivial effort.