PostgreSQL7.0手册-开发者手册 -60. Postgres 源代码

减小字体 增大字体 作者:佚名  来源:本站整理  发布时间:2009-03-16 13:45:05
第六十章. Postgres 源代码
格式
源代码格式使用每个制表符(tab)4列的空白,目前是保留制表符状态(也就是说制表符不被展开为空白)。 
对于使用 emacs 的人,把下面行(或者类似的东西)增加到你的~/.emacs 初始化文件里面去: 

;; check for files with a path containing "postgres" or "pgsql"
(setq auto-mode-alist (cons '("\\(postgres\\pgsql\\).*\\.[ch]\\'" . pgsql-c-mode) auto-mode-alist))
(setq auto-mode-alist (cons '("\\(postgres\\pgsql\\).*\\.cc\\'" . pgsql-c-mode) auto-mode-alist))

(defun pgsql-c-mode ()
  ;; sets up formatting for Postgres C code
  (interactive)
  (c-mode)
  (setq-default tab-width 4)
  (c-set-style "bsd")             ; set c-basic-offset to 4, plus other stuff
  (c-set-offset 'case-label '+)   ; tweak case indent to match PG custom
  (setq indent-tabs-mode t))      ; make sure we keep tabs when indenting
对于 vi,你的 ~/.vimrc 或者相当的文件应该包含下面的东西: 
set tabstop=4
或者在 vi 里面键入 
:set ts=4
文本浏览工具 more 和 less 可以用下面命令调用 
more -x4
less -x4

--------------------------------------------------------------------------------

Tags:

作者:佚名
分享到: 微信 更多