xref: /vim-8.2.3635/runtime/ftplugin/rmd.vim (revision cb03397a)
1" Vim filetype plugin file
2" Language: R Markdown file
3" Maintainer: Jakson Alves de Aquino <[email protected]>
4" Homepage: https://github.com/jalvesaq/R-Vim-runtime
5" Last Change:	Mon Jun 06, 2016  09:41PM
6" Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann)
7
8" Only do this when not yet done for this buffer
9if exists("b:did_ftplugin")
10  finish
11endif
12
13runtime! ftplugin/html.vim ftplugin/html_*.vim ftplugin/html/*.vim
14
15" Nvim-R plugin needs this
16if exists("*CompleteR")
17  if &omnifunc == "CompleteR"
18    let b:rplugin_nonr_omnifunc = ""
19  else
20    let b:rplugin_nonr_omnifunc = &omnifunc
21  endif
22  set omnifunc=CompleteR
23endif
24
25setlocal comments=fb:*,fb:-,fb:+,n:> commentstring=>\ %s
26setlocal formatoptions+=tcqln
27setlocal formatlistpat=^\\s*\\d\\+\\.\\s\\+\\\|^\\s*[-*+]\\s\\+
28setlocal iskeyword=@,48-57,_,.
29
30let s:cpo_save = &cpo
31set cpo&vim
32
33" Enables pandoc if it is installed
34unlet! b:did_ftplugin
35runtime ftplugin/pandoc.vim
36
37" Don't load another plugin for this buffer
38let b:did_ftplugin = 1
39
40if has("gui_win32") && !exists("b:browsefilter")
41  let b:browsefilter = "R Source Files (*.R *.Rnw *.Rd *.Rmd *.Rrst)\t*.R;*.Rnw;*.Rd;*.Rmd;*.Rrst\n" .
42        \ "All Files (*.*)\t*.*\n"
43endif
44
45if exists('b:undo_ftplugin')
46  let b:undo_ftplugin .= " | setl cms< com< fo< flp< isk< | unlet! b:browsefilter"
47else
48  let b:undo_ftplugin = "setl cms< com< fo< flp< isk< | unlet! b:browsefilter"
49endif
50
51let &cpo = s:cpo_save
52unlet s:cpo_save
53
54" vim: sw=2
55