Syntax highlighting/colorizing cat

前端 未结 18 1922
不思量自难忘°
不思量自难忘° 2020-12-02 03:39

Is there a method to colorize the output of cat, the way grep does.

For grep, in most consoles it displays a colored output hi

18条回答
  •  情歌与酒
    2020-12-02 04:27

    just use vim and this vimrc file.

    oneliner:

    vim -c '1' -c 'set cmdheight=1' -c 'set readonly' -c 'set nomodifiable' -c 'syntax enable' -c 'set guioptions=aiMr' -c 'nmap q :q!' -c 'nmap  ' -c 'nmap  ' -c 'nmap ^V ' "$@" 
    

    nano -v may also be an alternative.

提交回复
热议问题