Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ root = true
indent_style = tab
indent_size = tab
tab_width = 4
max_line_length = 78

[*.{sgml,xml}]
indent_style = space
Expand All @@ -16,6 +17,7 @@ indent_size = 2
[*.cpp]
indent_style = tab
indent_size = 4
max_line_length = 78

[{GNUmakefile,Makefile}*]
indent_style = tab
Expand All @@ -32,4 +34,3 @@ indent_size = 4
[*.{dxl,mdp}]
indent_style = space
indent_size = 2

2 changes: 1 addition & 1 deletion src/tools/editors/clion.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<option name="SMART_TABS" value="true" />
</value>
</option>
<option name="RIGHT_MARGIN" value="80" />
<option name="RIGHT_MARGIN" value="78" />
<DBN-PSQL>
<case-options enabled="false">
<option name="KEYWORD_CASE" value="lower" />
Expand Down
14 changes: 11 additions & 3 deletions src/tools/editors/emacs.samples
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

(add-hook 'c-mode-hook
(defun postgresql-c-mode-hook ()
(when (string-match "/postgres\\(ql\\)?/" buffer-file-name)
(when (or (string-match "/postgres\\(ql\\)?/" buffer-file-name)
(string-match "/cbdb/" buffer-file-name)
(string-match "/cloudberrydb/" buffer-file-name))
(c-set-style "postgresql")
;; Don't override the style we just set with the style in
;; `dir-locals-file'. Emacs 23.4.1 needs this; it is obsolete,
Expand Down Expand Up @@ -59,8 +61,10 @@

(add-hook 'perl-mode-hook
(defun postgresql-perl-mode-hook ()
(when (string-match "/postgres\\(ql\\)?/" buffer-file-name)
(pgsql-perl-style))))
(when (or (string-match "/postgres\\(ql\\)?/" buffer-file-name)
(string-match "/cbdb/" buffer-file-name)
(string-match "/cloudberrydb/" buffer-file-name))
(pgsql-perl-style))))


;;; documentation files
Expand Down Expand Up @@ -89,3 +93,7 @@
;; use GNU make mode instead of plain make mode
(add-to-list 'auto-mode-alist '("/postgres\\(ql\\)?/.*Makefile.*" . makefile-gmake-mode))
(add-to-list 'auto-mode-alist '("/postgres\\(ql\\)?/.*\\.mk\\'" . makefile-gmake-mode))
(add-to-list 'auto-mode-alist '("/cloudberrydb/.*Makefile.*" . makefile-gmake-mode))
(add-to-list 'auto-mode-alist '("/cloudberrydb/.*\\.mk\\'" . makefile-gmake-mode))
(add-to-list 'auto-mode-alist '("/cbdb/.*Makefile.*" . makefile-gmake-mode))
(add-to-list 'auto-mode-alist '("/cbdb/.*\\.mk\\'" . makefile-gmake-mode))
6 changes: 5 additions & 1 deletion src/tools/editors/vim.samples
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
"
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

:if match(getcwd(), "/pgsql") >=0 || match(getcwd(), "/postgresql") >= 0
:if match(getcwd(), "/pgsql") >=0 || match(getcwd(), "/postgresql") >= 0 || match(getcwd(), "/cloudberrydb*") >= 0 || match(getcwd(), "/cbdb*") >= 0

: set cinoptions=(0
: set tabstop=4
: set shiftwidth=4
: set textwidth=78
: syntax on
: set colorcolumn=78
: highlight ColorColumn ctermbg=52

:endif

Expand Down