blob: 8c092ac13ff6725a6d821c5a8d720d75b7709bc4 [file] [log] [blame]
Bram Moolenaardb6ea062014-07-10 22:01:47 +02001" Vim filetype plugin file
Bram Moolenaare4a3bcf2016-08-26 19:52:37 +02002" Language: R Markdown file
Bram Moolenaardb6ea062014-07-10 22:01:47 +02003" Maintainer: Jakson Alves de Aquino <jalvesaq@gmail.com>
Bram Moolenaar77cdfd12016-03-12 12:57:59 +01004" Homepage: https://github.com/jalvesaq/R-Vim-runtime
Bram Moolenaare4a3bcf2016-08-26 19:52:37 +02005" Last Change: Mon Jun 06, 2016 09:41PM
6" Original work by Alex Zvoleff (adjusted from R help for rmd by Michel Kuhlmann)
Bram Moolenaardb6ea062014-07-10 22:01:47 +02007
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
Bram Moolenaare4a3bcf2016-08-26 19:52:37 +020015" 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
Bram Moolenaardb6ea062014-07-10 22:01:47 +020025setlocal 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