- 积分
- 16132
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-9-14
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
emacs 高亮显示ncl脚本步骤:(参考http://www.ncl.ucar.edu/Applications/editor.shtml#emacs)
step1:下载ncl.el(见附件)或从上面网址上下载
step2: 在终端下打开.emacs 并在后面添加
$ emacs ~/.emacs 并添加以下行
(setq auto-mode-alist (cons '("\.ncl$" . ncl-mode) auto-mode-alist))
; this line associates ncl-mode with the lisp package that defines it.
(autoload 'ncl-mode "~/bin/ncl.el")
; a hook is a list of functions that get executed under certain
; conditions.
(add-hook 'ncl-mode-hook
(lambda () ; lambda is an anonymous function. e.g. has no name.
; highlight comments
(set-face-foreground font-lock-comment-face "FireBrick")
; highlight strings
(set-face-foreground font-lock-string-face "Salmon")
; highlight keywords, array descriptors, and tests
(set-face-foreground font-lock-keyword-face "Purple")
; highlight built-in functions
(set-face-foreground font-lock-builtin-face "Blue")
; highlight gsn* functions
(set-face-foreground font-lock-variable-name-face "SteelBlue")
; highlight shea_util and contributed functions
(set-face-foreground font-lock-function-name-face "CadetBlue")
; highlight resources
(set-face-foreground font-lock-constant-face "ForestGreen")
)
)
step3: 在以上添加的行(第三行)中找到"~/bin/ncl.el" 更改为step1中所存放ncl.el的路径,如改为
"\home\util\ncl\ncl.el"
即可完成 emacs 打开ncl脚本高亮显示
|
-
-
ncl.el
71.46 KB, 下载次数: 17, 下载积分: 金钱 -5
评分
-
查看全部评分
|