annotate runtime/ftplugin/rmd.vim @ 29247:5f314b2ed494 v8.2.5142

patch 8.2.5142: startup test fails if there is a status bar Commit: https://github.com/vim/vim/commit/fa04eae5a5b9394079bde2d37ce6f9f8a5567d48 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jun 21 14:38:40 2022 +0100 patch 8.2.5142: startup test fails if there is a status bar Problem: Startup test fails if there is a status bar at the top of the screen. (Ernie Rael) Solution: Use a larger vertical offset in the test.
author Bram Moolenaar <Bram@vim.org>
date Tue, 21 Jun 2022 18:45:07 +0200
parents 5bda4653aced
children b2412874362f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6051
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 " Vim filetype plugin file
9975
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 8497
diff changeset
2 " Language: R Markdown file
6051
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
3 " Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
8497
da01d5da2cfa commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents: 6051
diff changeset
4 " Homepage: https://github.com/jalvesaq/R-Vim-runtime
24520
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
5 " Last Change: Sat Aug 15, 2020 12:03PM
9975
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 8497
diff changeset
6 " Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann)
6051
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 " Only do this when not yet done for this buffer
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 if exists("b:did_ftplugin")
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10 finish
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
11 endif
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
12
14637
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
13 if exists('g:rmd_include_html') && g:rmd_include_html
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
14 runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
9975
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 8497
diff changeset
15 endif
03fa8a51e9dc commit https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
Christian Brabandt <cb@256bit.org>
parents: 8497
diff changeset
16
14637
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
17 setlocal comments=fb:*,fb:-,fb:+,n:>
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
18 setlocal commentstring=#\ %s
6051
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
19 setlocal formatoptions+=tcqln
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
20 setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 setlocal iskeyword=@,48-57,_,.
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23 let s:cpo_save = &cpo
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
24 set cpo&vim
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
25
14637
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
26 function! FormatRmd()
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
27 if search("^[ \t]*```[ ]*{r", "bncW") > search("^[ \t]*```$", "bncW")
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
28 setlocal comments=:#',:###,:##,:#
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
29 else
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
30 setlocal comments=fb:*,fb:-,fb:+,n:>
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
31 endif
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
32 return 1
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
33 endfunction
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
34
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
35 " If you do not want 'comments' dynamically defined, put in your vimrc:
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
36 " let g:rmd_dynamic_comments = 0
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
37 if !exists("g:rmd_dynamic_comments") || (exists("g:rmd_dynamic_comments") && g:rmd_dynamic_comments == 1)
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
38 setlocal formatexpr=FormatRmd()
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
39 endif
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
40
0ecb909e3249 Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 9975
diff changeset
41
6051
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
42 " Enables pandoc if it is installed
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
43 unlet! b:did_ftplugin
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
44 runtime ftplugin/pandoc.vim
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
45
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
46 " Don't load another plugin for this buffer
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
47 let b:did_ftplugin = 1
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
48
24520
5bda4653aced Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 14637
diff changeset
49 if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
6051
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
50 let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" .
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
51 \ "All Files (*.*)\t*.*\n"
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
52 endif
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
53
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
54 if exists('b:undo_ftplugin')
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
55 let b:undo_ftplugin .= " | setl cms< com< fo< flp< isk< | unlet! b:browsefilter"
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
56 else
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
57 let b:undo_ftplugin = "setl cms< com< fo< flp< isk< | unlet! b:browsefilter"
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
58 endif
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
59
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
60 let &cpo = s:cpo_save
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
61 unlet s:cpo_save
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
62
0efec12f52ac Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
63 " vim: sw=2