[FFmpeg-cvslog] doc: add editor configuration section with Vim and Emacs settings
Diego Biurrun
git at videolan.org
Thu Dec 8 00:31:49 CET 2011
ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Mon Dec 5 13:18:27 2011 +0100| [d8538f06e6c046680a0237ca5d3eeee43c2682e4] | committer: Diego Biurrun
doc: add editor configuration section with Vim and Emacs settings
based on a patch by Victor Vasiliev, vasilvv gmail com
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d8538f06e6c046680a0237ca5d3eeee43c2682e4
---
doc/developer.texi | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/doc/developer.texi b/doc/developer.texi
index c9cf7bd..dd31e37 100644
--- a/doc/developer.texi
+++ b/doc/developer.texi
@@ -207,6 +207,31 @@ Casts should be used only when necessary. Unneeded parentheses
should also be avoided if they don't make the code easier to understand.
@end itemize
+ at subsection Editor configuration
+In order to configure Vim to follow Libav formatting conventions, paste
+the following snippet into your @file{.vimrc}:
+ at example
+" indentation rules for libav: 4 spaces, no tabs
+set expandtab
+set shiftwidth=4
+set softtabstop=4
+" allow tabs in Makefiles
+autocmd FileType make set noexpandtab shiftwidth=8 softtabstop=8
+" Trailing whitespace and tabs are forbidden, so highlight them.
+highlight ForbiddenWhitespace ctermbg=red guibg=red
+match ForbiddenWhitespace /\s\+$\|\t/
+" Do not highlight spaces at the end of line while typing on that line.
+autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@@<!$/
+ at end example
+
+For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
+ at example
+(setq c-default-style "k&r")
+(setq-default c-basic-offset 4)
+(setq-default indent-tabs-mode nil)
+(setq-default show-trailing-whitespace t)
+ at end example
+
@section Development Policy
@enumerate
More information about the ffmpeg-cvslog
mailing list