comparison runtime/ftplugin/rmd.vim @ 32294:b2e8663e6dcc

Update runtime files Commit: https://github.com/vim/vim/commit/71badf9547e8f89571b9a095183671cbb333d528 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 22 22:40:14 2023 +0100 Update runtime files
author Bram Moolenaar <Bram@vim.org>
date Sat, 22 Apr 2023 23:45:05 +0200
parents b2412874362f
children 033f22d4a52a
comparison
equal deleted inserted replaced
32293:6f7c948e5b15 32294:b2e8663e6dcc
1 " Vim filetype plugin file 1 " Vim filetype plugin file
2 " Language: R Markdown file 2 " Language: R Markdown file
3 " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com> 3 " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
4 " Homepage: https://github.com/jalvesaq/R-Vim-runtime 4 " Homepage: https://github.com/jalvesaq/R-Vim-runtime
5 " Last Change: Sun Apr 24, 2022 09:12AM 5 " Last Change: Mon Feb 27, 2023 07:15PM
6 " Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann) 6 " Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann)
7 7
8 " Only do this when not yet done for this buffer 8 " Only do this when not yet done for this buffer
9 if exists("b:did_ftplugin") 9 if exists("b:did_ftplugin")
10 finish 10 finish
21 setlocal iskeyword=@,48-57,_,. 21 setlocal iskeyword=@,48-57,_,.
22 22
23 let s:cpo_save = &cpo 23 let s:cpo_save = &cpo
24 set cpo&vim 24 set cpo&vim
25 25
26 function! FormatRmd() 26 function FormatRmd()
27 if search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW") 27 if search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")
28 setlocal comments=:#',:###,:##,:# 28 setlocal comments=:#',:###,:##,:#
29 else 29 else
30 setlocal comments=fb:*,fb:-,fb:+,n:> 30 setlocal comments=fb:*,fb:-,fb:+,n:>
31 endif 31 endif
32 return 1 32 return 1
33 endfunction 33 endfunction
34 34
35 function! SetRmdCommentStr() 35 function SetRmdCommentStr()
36 if (search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")) || ((search('^---$', 'Wn') || search('^\.\.\.$', 'Wn')) && search('^---$', 'bnW')) 36 if (search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")) || ((search('^---$', 'Wn') || search('^\.\.\.$', 'Wn')) && search('^---$', 'bnW'))
37 set commentstring=#\ %s 37 set commentstring=#\ %s
38 else 38 else
39 set commentstring=<!--\ %s\ --> 39 set commentstring=<!--\ %s\ -->
40 endif 40 endif