blob: f3b4960b7fb578fae18e56feada73e8aa8086b14 [file] [log] [blame]
Bram Moolenaardb6ea062014-07-10 22:01:47 +02001" Vim filetype plugin file
2" Language: R
3" 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 Moolenaardd60c362023-02-27 15:49:53 +00005" Last Change: Sun Apr 24, 2022 09:14AM
Doug Kearns93197fd2024-01-14 20:59:02 +01006" 2024 Jan 14 by Vim Project (browsefilter)
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
13" Don't load another plugin for this buffer
14let b:did_ftplugin = 1
15
16let s:cpo_save = &cpo
17set cpo&vim
18
19setlocal iskeyword=@,48-57,_,.
20setlocal formatoptions-=t
21setlocal commentstring=#\ %s
22setlocal comments=:#',:###,:##,:#
23
Bram Moolenaar11e3c5b2021-04-21 18:09:37 +020024if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
Bram Moolenaardb6ea062014-07-10 22:01:47 +020025 let b:browsefilter = "R Source Files (*.R)\t*.R\n" .
Doug Kearns93197fd2024-01-14 20:59:02 +010026 \ "Files that include R (*.Rnw *.Rd *.Rmd *.Rrst *.qmd)\t*.Rnw;*.Rd;*.Rmd;*.Rrst;*.qmd\n"
27 if has("win32")
28 let b:browsefilter .= "All Files (*.*)\t*\n"
29 else
30 let b:browsefilter .= "All Files (*)\t*\n"
31 endif
Bram Moolenaardb6ea062014-07-10 22:01:47 +020032endif
33
34let b:undo_ftplugin = "setl cms< com< fo< isk< | unlet! b:browsefilter"
35
36let &cpo = s:cpo_save
37unlet s:cpo_save