在Emacs中的脚本中着色/缩进脚本

Use*_*er1 5 emacs bash awk text-indent text-coloring

我经常有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程序而不仅仅是字符串常量?

Jas*_*ick 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

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