Update runtime files
diff --git a/runtime/ftplugin/rmd.vim b/runtime/ftplugin/rmd.vim
index 2ee72ff..355b88f 100644
--- a/runtime/ftplugin/rmd.vim
+++ b/runtime/ftplugin/rmd.vim
@@ -2,7 +2,7 @@
 " Language: R Markdown file
 " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
 " Homepage: https://github.com/jalvesaq/R-Vim-runtime
-" Last Change:	Sat Aug 15, 2020  12:03PM
+" Last Change:	Sun Apr 24, 2022  09:12AM
 " Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann)
 
 " Only do this when not yet done for this buffer
@@ -32,13 +32,24 @@
   return 1
 endfunction
 
-" If you do not want 'comments' dynamically defined, put in your vimrc:
-" let g:rmd_dynamic_comments = 0
+function! SetRmdCommentStr()
+    if (search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")) || ((search('^---$', 'Wn') || search('^\.\.\.$', 'Wn')) && search('^---$', 'bnW'))
+        set commentstring=#\ %s
+    else
+        set commentstring=<!--\ %s\ -->
+    endif
+endfunction
+
+" If you do not want both 'comments' and 'commentstring' dynamically defined,
+" put in your vimrc: let g:rmd_dynamic_comments = 0
 if !exists("g:rmd_dynamic_comments") || (exists("g:rmd_dynamic_comments") && g:rmd_dynamic_comments == 1)
   setlocal formatexpr=FormatRmd()
+  augroup RmdCStr
+    autocmd!
+    autocmd CursorMoved <buffer> call SetRmdCommentStr()
+  augroup END
 endif
 
-
 " Enables pandoc if it is installed
 unlet! b:did_ftplugin
 runtime ftplugin/pandoc.vim
@@ -47,7 +58,7 @@
 let b:did_ftplugin = 1
 
 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
-  let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" .
+  let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n" .
         \ "All Files (*.*)\t*.*\n"
 endif