V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
KevinOfNeu
V2EX  ›  macOS

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

  •  
  •   KevinOfNeu · 2016-01-08 17:31:03 +08:00 · 3750 次点击
    这是一个创建于 3053 天前的主题,其中的信息可能已经有所发展或是发生改变。

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

    preview

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

    4 条回复    2016-01-09 19:41:00 +08:00
    KevinOfNeu
        1
    KevinOfNeu  
    OP
       2016-01-08 17:31:44 +08:00
    yangg
        2
    yangg  
       2016-01-08 17:45:49 +08:00
    这样? pygmentize test.js | less -R
    KevinOfNeu
        3
    KevinOfNeu  
    OP
       2016-01-08 17:48:03 +08:00
    @yangg 基本是这样子 简单利用了下管道
    dalang
        4
    dalang  
       2016-01-09 19:41:00 +08:00
    我觉得这点内容专门放 repo 有点浪费,放到 gist 就足够了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2186 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 05:54 · PVG 13:54 · LAX 22:54 · JFK 01:54
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.