首页 > 数据库 > PostgreSQL > 正文

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

2019-09-08 23:34:09
字体:
来源:转载
供稿:网友
第六十章. 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

--------------------------------------------------------------------------------
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选