V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
KevinOfNeu
V2EX  ›  macOS

让你的 cat less more 输出带语法高亮

  •  
  •   KevinOfNeu · Jan 8, 2016 · 4427 views
    This topic created in 3774 days ago, the information mentioned may be changed or developed.

    在 Terminal 执行 cat less more 查看源代码的时候,多希望有语法高亮~~

    preview

    实现的话,投机取巧。 repo 奉上,轻喷。。。
    repo

    4 replies    2016-01-09 19:41:00 +08:00
    yangg
        2
    yangg  
       Jan 8, 2016
    这样? pygmentize test.js | less -R
    KevinOfNeu
        3
    KevinOfNeu  
    OP
       Jan 8, 2016
    @yangg 基本是这样子 简单利用了下管道
    dalang
        4
    dalang  
       Jan 9, 2016
    我觉得这点内容专门放 repo 有点浪费,放到 gist 就足够了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   897 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 21:23 · PVG 05:23 · LAX 14:23 · JFK 17:23
    ♥ Do have faith in what you're doing.