I have the following on my vimrc file to handle custom folding: ++ Folding                                                                     set foldenable                       enable folding                             set foldmethod=syntax                global folding method                 set foldlevelstart=1                 folds with level 1 aren't closed augroup FileTypeVim                                                                                                                                                    autocmd!                                                                       autocmd FileType vim setlocal foldmethod=expr foldexpr=VimrcFold()          augroup ENDWhen I open my vimrc it works perfectly fine. However, if I re-source my vimrc the foldmethod is set to syntax (global) instead of expr (specific for filetype vim). What do I have to specify in order to keep the vimrc with expr foldmethod? I suspect it has to be with BufType rather than FileType but I am not sure how to deal with that. 
Setting foldmethod=expr when re-sourcing vimrc?
vimscript;vimrc;autocmd;folding;filetype
You can do that with a modeline and an autocommand. E.g. The modeline : vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell:With this modeline I can fold my vimrc based on {} pairs.The autocommands : augroup FileTypeVim   autocmd!    Source your vimrc on save   autocmd! BufWritePost .vimrc source %    Apply modeline option after re-openning the vimrc file (that is after sourcing it)   autocmd! BufWritePost .vimrc set modeline | doautocmd BufReadaugroup ENDReferences : https://stackoverflow.com/questions/24221294/vim-read-modeline-after-opening-the-filehttp://vim.wikia.com/wiki/Modeline_magic