【问题标题】:Coloring/indenting a script within script in Emacs在 Emacs 中的脚本中着色/缩进脚本
【发布时间】:2011-04-16 21:52:05
【问题描述】:

我经常有调用其他脚本语言的 shell 脚本,比如:

#!/bin/bash cat somefile|awk ' BEGIN { #This line is not auto-indented and is colored as a string constant. ... } { #Same with this line. ... }' echo "More Bash code here." ...

有没有办法让 Emacs 将 awk 字符串识别为 awk 程序而不仅仅是字符串常量?

【问题讨论】:

    标签: bash emacs awk text-indent text-coloring


    【解决方案1】:

    您需要对现有的 emacs lisp 文件进行自己的扩展。这是一个学习emacs lisp的有用教程:
    http://www.gnu.org/software/emacs/emacs-lisp-intro/

    下面是一个为 html 着色的 .el 文件示例:
    http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el

    完成后,将其发布到网上,以便其他人受益!

    【讨论】:

      【解决方案2】:

      我将mmm-mode 用于Mason 文件(混合HTML 和Perl);也许它也可以在您的情况下使用?

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-02-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多