使emacs默认突出显示postgresql语法 [英] Making emacs to highlight postgresql syntax by default
本文介绍了使emacs默认突出显示postgresql语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
通常在emacs中,如果要在每次打开某个模式时更改设置,都可以使用挂钩。与此类似的应该有效:
(add-to-list'auto-mode-alist
/ pre>
' \\.psql $(lambda()
(sql-mode)
(sql-highlight-postgres-keywords))))
I use emacs for editing my sql code. I work 99% of time on postgresql plpgsql code. All my files with extension .sql contain postgresql. I'm curious is there a way to set sql-highlight-postgres-keywords SQL highlighting default instead of ANSI SQL, because it's pretty annoying to switch mode every time I open a file.
解决方案Usually in emacs, if you want to change the settings every time some mode is opened, you use a hook. Something similar to this should work:
(add-to-list 'auto-mode-alist '("\\.psql$" . (lambda () (sql-mode) (sql-highlight-postgres-keywords))))
这篇关于使emacs默认突出显示postgresql语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文