Blender comes with a
.editorconfig file that specifies conventions like
indentation for C/C++, Python, CMake and other code.
The editorconfig-vim plugin can be used to let Vim take it into account.
Multiple plugins are available, as well as a script bundled with clang-format.
The bundled script can be configured like this to format on file save:
For more convienently editing reStructuredText for the manual, add the following to your
To avoid conflict with any of your preferred settings for other file-types:
"autocmd FileType" is used where possible.
" Example '.vimrc'
" needed to detect '.rst' files for special handling.
filetype plugin on
" indent based on filetype
filetype indent on
" These settings will only impact editing '.rst' files.
" so as not to conflict with any of your other settings.
" indentation settings
autocmd FileType rst setlocal expandtab shiftwidth=3 tabstop=3
" show a ruler at the right hand margin
autocmd FileType rst setlocal colorcolumn=120
" for wrapping text
autocmd FileType rst setlocal textwidth=118
" set spelling
autocmd FileType rst setlocal spell spelllang=en_us
" enable syntax highlighting
autocmd FileType rst syntax on
" all files use utf-8 encoding
autocmd FileType rst setlocal encoding=utf-8
This has not been tested in a while and information may be outdated.
This is a short guide on how I've been editing the blender-manual with real-time feedback (WYSIWYG).
This guide relies on vim and the Instant-rst system by Rykka
Build the Blender user manual (for this guide I'm assuming the sources are in ~/blender-manual)
Install InstantRst (this is a plugin for vim)
Install InstantRst Server (this is a patched python plugin)
Running the Server¶
Editing the Manual¶
This will open the file in vim, and now you can run the plugin
Start editing and look at your browser being updated while you edit it.
Some RST syntaxes are not supported by Instanst-Rst server (in particularly guilabel, which we use a lot). So it's good to build the docs as you would normally to make sure everything looks fine. In this case you could either do make to build everything, or make render to build only the parts relative to the rendering.