Folks,
Here's my attempt to $subject. I've tested with vim, but I'm much less
certain I got the EMACS code right.
Is there any interest in such a feature?
Best,
David.
---
.dir-locals.el | 3 ++-
src/tools/editors/vim.samples | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/.dir-locals.el b/.dir-locals.el
index 9525d6b604..858461e6bd 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -4,7 +4,8 @@
(c-file-style . "bsd")
(fill-column . 78)
(indent-tabs-mode . t)
- (tab-width . 4)))
+ (tab-width . 4)
+ (lambda () (add-to-list 'write-file-functions 'delete-trailing-whitespace)))))
(dsssl-mode . ((indent-tabs-mode . nil)))
(nxml-mode . ((indent-tabs-mode . nil)))
(perl-mode . ((perl-indent-level . 4)
diff --git a/src/tools/editors/vim.samples b/src/tools/editors/vim.samples
index ccbc93f69b..f5e2181bc3 100644
--- a/src/tools/editors/vim.samples
+++ b/src/tools/editors/vim.samples
@@ -11,6 +11,7 @@
: set cinoptions=(0
: set tabstop=4
: set shiftwidth=4
+: autocmd FileType asm,c,conf,sql,xml,xs,xslt,yacc autocmd BufWritePre <buffer> %s/\s\+$//e
:endif
--
2.17.1
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778
Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate