diff --git a/profile/rda/.vimrc b/profile/rda/.vimrc
index 7601aa908de6f595dc5a61523e2e774d5fae1471..6cc327b84d50d8743b47c6fc56a15456dd627365 100644
--- a/profile/rda/.vimrc
+++ b/profile/rda/.vimrc
@@ -241,7 +241,7 @@ au filetype markdown syntax match RedTodo /TODO/
 let g:markdown_folding = 1
 au filetype markdown setlocal foldlevel=1
 
-let g:markdown_fenced_languages = ['ruby', 'perl', 'bash=sh', 'sh', 'vim', 'html', 'javascript', 'css', 'python']
+let g:markdown_fenced_languages = ['ruby', 'perl', 'bash=sh', 'sh', 'vim', 'html', 'javascript', 'css', 'python', 'yaml']
 let g:markdown_minlines = 100       "synchronize syntax highlighting with more lines (default:50)
 
 ""Enable concealing of links (https://github.com/tpope/vim-markdown/pull/9/commits/44dec444c959fa57c2fc835980ad15dbbbf11d1c)
@@ -249,6 +249,28 @@ let g:markdown_minlines = 100       "synchronize syntax highlighting with more l
 "au filetype markdown syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained conceal
 "au filetype markdown syn region markdownId matchgroup=markdownIdDelimiter start="\s*\[" end="\]" keepend contained conceal
 "au filetype markdown syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline concealends
+
+"Custom markdown folding
+au filetype markdown setlocal foldexpr=MyMarkdownFold()
+au filetype markdown setlocal foldmethod=expr
+au filetype markdown setlocal foldlevel=1
+function! MyMarkdownFold()
+    let line = getline(v:lnum)
+    " regular headers
+    let depth = match(line, '\(^##\+\)\@<=\( .*$\)\@=')
+    if depth > 0
+        return ">" . depth
+    endif
+    " setext headers
+    let nextline = getline(v:lnum + 1)
+    if (line =~ '^.\+$') && (nextline =~ '^=\+$')
+        return ">1"
+    endif
+    if (line =~ '^.\+$') && (nextline =~ '^-\+$')
+        return ">2"
+    endif
+    return "="
+endfunction
 "}}}
 
 " --- ansible ---{{{