# vi colorfull source code, pipe output to console



## Alain De Vos (Apr 15, 2022)

When i open a file with vi it colors the sourcecode.
But can i start vi and pipe the output with color info to the console and have vi stopped without having to manually do ":q" ?
I.e. use vi like cat/less/more ?


----------



## bakul (Apr 15, 2022)

How to syntax highlight via Less
					

is there a way to syntax highlight a file I see in Less?  actually I'm using this command to open an xml file (and sometimes a series of them)  less htmleditors/htmleditors_config.xml or   less [




					superuser.com


----------



## Alain De Vos (Apr 15, 2022)

I'll try the port "textproc/source-highlight"


----------



## ajs (Apr 18, 2022)

also look to textproc/bat 









						GitHub - sharkdp/bat: A cat(1) clone with wings.
					

A cat(1) clone with wings. Contribute to sharkdp/bat development by creating an account on GitHub.




					github.com
				




Supports syntax highlighting, line numbering, libgit integration, colour themes and more.  I alias `cat` to it now.


----------

