X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=doc%2Fdeveloper.texi;h=32d666ac6829efdbde4a165998703e776185e504;hb=3c5fe5b52758225e58fec917cc29281d6025aa67;hp=75895d914776b6f861090bf4c35f6b0230a3c749;hpb=1fa8ff38e47b3e0fc63e2a2e8fbbcf9e4fb071c5;p=ffmpeg diff --git a/doc/developer.texi b/doc/developer.texi index 75895d91477..32d666ac682 100644 --- a/doc/developer.texi +++ b/doc/developer.texi @@ -179,6 +179,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 +@subsection Editor configuration +In order to configure Vim to follow FFmpeg formatting conventions, paste +the following snippet into your @file{.vimrc}: +@example +" indentation rules for FFmpeg: 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\+\%#\@@